?
Solved

Looking to make use of Win32 ShowWindow from Java (looking at using JACOB, JAva-COm Bridge)

Posted on 2008-11-17
5
Medium Priority
?
640 Views
Last Modified: 2013-12-04
My goal is from my java program to hide a program that is already started. I have the proccess id already but I am not certain that will be much use for me. From my research it looks like I can either work very hard on some custom JNI hooks or I can take the easier route and use an open source API like JACOB (I looked at a number of other API projects but JACOB seemed most reliable and widely endorsed, please correct me if I am wrong ). I am not able to modify how the program initial program starts.

So I have the idea and I am now looking through the javadocs... but I don't have any clear examples...so I am googling and soon to be ramming code down the jvm's throat to see what it spits back... If anyone has any insight that they can share with me about using JACOB or any other Java to COM open-source API please help.

My thoughts are this (psuedo'ish):

//Find window of Oracle installer proccess
myWin = FindWindow("setup.exe", NULL);
//Force minimize
ShowWindow( myWin, SW_FORCEMINIMIZE);

That is my start... how to impliment this in JACOB is a good guess. I also have a feeling that I could be completely off base here (the main reason for this post would be for reassurance that I am not headed into a deadend)



0
Comment
Question by:techieBrandon
  • 3
  • 2
5 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 22981098
Are you sure the Oracle installer doesn't have a silent install option? ;-)
0
 
LVL 1

Author Comment

by:techieBrandon
ID: 22984058
It does have a silent option, however it still spawns a cmd window from the setup.exe even if the silent flag is used. I actually have another post on here prior to this one about just that. Having spoke with one other person that has dealt with the Oracle installer, he had same issue as I.

http://www.experts-exchange.com/Database/Oracle/Q_23879795.html

Regards,
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 22984111
Why use Oracle btw?
0
 
LVL 1

Author Comment

by:techieBrandon
ID: 22984890
I don't get to choose, I just get the task. ;o)

0
 
LVL 1

Accepted Solution

by:
techieBrandon earned 0 total points
ID: 23283127
So, I found I could *probably* use jndi to create a native interface in c++ and hook with java. However this was more than I was looking to do for the solution so I did not implement it. But, that would be my direction to take if I did need to do this at some point.
0

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
The viewer will learn how to implement Singleton Design Pattern in Java.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

616 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question