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

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)

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Are you sure the Oracle installer doesn't have a silent install option? ;-)
techieBrandonAuthor Commented:
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.


Why use Oracle btw?
techieBrandonAuthor Commented:
I don't get to choose, I just get the task. ;o)

techieBrandonAuthor Commented:
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.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Development

From novice to tech pro — start learning today.