WauloK Posted May 13, 2009 Share Posted May 13, 2009 Howdy! I've been reading through the forums and I can see where it's impossible to get a control in a Java app because, basically, they have none. However, I see there are functions to send commands/actions to controls on an inactive window (the app I'm writing needs to run when the PC is locked), but there seems to be no way to send a command/keypress to an inactive window. Have I missed somewhere? The Java app I am talking about only needs the F2 key pressed from time to time to stop it logging out due to inactivity. If I could send an F2 keypress to the whole inactive window, I believe it would solve my problem. Any takers? Or perhaps it could be something added to a future version of AutoIT if it doesn't already exist Link to comment Share on other sites More sharing options...
WideBoyDixon Posted May 14, 2009 Share Posted May 14, 2009 ControlSend? Alternatively, use _SendMessage with $WM_KEYDOWN and $WM_KEYUP with a VK_KEYCODE of $VK_F2 WBD [center]Wide by name, Wide by nature and Wide by girth[u]Scripts[/u]{Hot Folders} {Screen Calipers} {Screen Crosshairs} {Cross-Process Subclassing} {GDI+ Clock} {ASCII Art Signatures}{Another GDI+ Clock} {Desktop Goldfish} {Game of Life} {3D Pie Chart} {Stock Tracker}[u]UDFs[/u]{_FileReplaceText} {_ArrayCompare} {_ToBase}~ My Scripts On Google Code ~[/center] Link to comment Share on other sites More sharing options...
WauloK Posted May 14, 2009 Author Share Posted May 14, 2009 ControlSend sounded good, but there's no Controls in a Java application, as stated above so I don't think this would work? Will look at _SendMessage now. Thanks. Link to comment Share on other sites More sharing options...
WauloK Posted May 14, 2009 Author Share Posted May 14, 2009 (edited) Hmm...This sort of seems to work MOST of the time.It only works on my PC if the window is not Minimized. It seems to work if the one I want is not the Active window. It even seems to work if the PC is locked.However, I send the same script to friends, compiled or not, and it doesn't work unless the Window I want is the Active window. I have an AutoIT friend and he compiles it and it doesn't work for him.Curiouser and Curiouser.$hwnd = WinGetHandle( $SrvCtrTitle )ControlSend($hwnd, '', '', '{F2}') Edited May 14, 2009 by WauloK Link to comment Share on other sites More sharing options...
ResNullius Posted May 14, 2009 Share Posted May 14, 2009 I've been reading through the forums and I can see where it's impossible to get a control in a Java app because, basically, they have none.Have you seen this? http://www.autoitscript.com/forum/index.php?showtopic=87956 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now