aspose file tools*
The moose likes Java in General and the fly likes FindWindow(), ShowWindow(), SetForegroundWindow() cant be effect in win7 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "FindWindow(), ShowWindow(), SetForegroundWindow() cant be effect in win7" Watch "FindWindow(), ShowWindow(), SetForegroundWindow() cant be effect in win7" New topic
Author

FindWindow(), ShowWindow(), SetForegroundWindow() cant be effect in win7

endswel shui
Ranch Hand

Joined: Jul 03, 2008
Posts: 33
Now, the state is I use a app1 to invoke app2, the precondition is app2 is hide to the system tray

I can use the


to make the app2 active in the desktop.
This operation can effect in win xp,
but cant be effect in win7.

What is the reason for the win7?
Stephan van Hulst
Bartender

Joined: Sep 20, 2010
Posts: 3649
    
  17

Hard to say without seeing your code. The methods you refer to sound like they're either from the Windows API , or your own methods.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19762
    
  20

They certainly look like Windows API functions. If they're not working, check the reason why. GetLastError() will always return the last error that occurred, which you can then either format (search for how to) or look up using the direct value.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
endswel shui
Ranch Hand

Joined: Jul 03, 2008
Posts: 33
Stephan van Hulst wrote:Hard to say without seeing your code. The methods you refer to sound like they're either from the Windows API , or your own methods.




hi, Stephan, above is the code

scene 1
I can activate app2 which hide in the system tray in winxp 32 bit

but cant activate the app2 hide in the system tray in windows 7 professinal 32/64bit
btw, for the windows7 professional the default setting, cant create the file in the folder of 'c:\Program Files' , and need to type sth to allow it to access


scene 2
also in the windows 7 professional 32/64 bit
and a little confused, when I using the app1 in the eclipse which open normal cant ativate
when I using the app1 in the eclipse which open as administrator can ativate

or is there anything need I to change for the windows7 professional 32/64 bit security?
and how?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: FindWindow(), ShowWindow(), SetForegroundWindow() cant be effect in win7