Looking to make use of Win32 ShowWindow from Java (looking at using JACOB, JAva-COm Bridge)
Posted on 2008-11-17
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);
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)