GoroX Posted March 20, 2012 Share Posted March 20, 2012 Here's what I would like to do: Launch a window without showing it, send some messages to it and close it again. In order to do that, I thought I could use the following: Run( ..., @SW_HIDE ) ; launch app WinWait( ... ) ; wait for app's main window to become available so that we can send messages to it WinMove( ... ) ; move window off screen to unhide it while still keeping it invisible from the user SetWinState( ..., $SW_SHOW ) ; show window (off screen) so that I can send messages to it ControlSend( ... ) ; send a bunch of messages including one that closes the window ...but it turns out that WinWait() goes into an infinite loop when I use Run() with the @SW_HIDE flag (works fine without the @SW_HIDE flag but window is briefly visible, which is unsightly). Which leads me to the following question: Is there a different way to determine when a hidden window exists? Or, is there a different approach altogether to launch an app and send some messages to it without the user ever seeing it? Thank you! Link to comment Share on other sites More sharing options...
Belini Posted March 20, 2012 Share Posted March 20, 2012 (edited) Take a look at these commands: WinExists ("title", "text"); verffica if the window is WinActivate ("title", "text"); active window WinSetTrans ("title", "text", 0); leaves the invisible window Edited March 20, 2012 by Belini My Codes: Virtual Key Code UDF: http://www.autoitscript.com/forum/topic/138246-virtual-key-code-udf/ GuiSplashTextOn.au3: http://www.autoitscript.com/forum/topic/143542-guisplashtexton-udf/ Menu versions of Autoit: http://www.autoitscript.com/forum/topic/137435-menu-versions-of-autoit/#entry962011 Selects first folder of letters: ]http://www.autoitscript.com/forum/topic/144780-select-folders-by-letter/#entry1021708/spoiler] List files and folders with long addresses.: http://www.autoitscript.com/forum/topic/144910-list-files-and-folders-with-long-addresses/#entry102 2926 Program JUKEBOX made in Autoit:some functions:http://www.youtube.com/watch?v=WJ2tC2fD5Qs Navigation to search:http://www.youtube.com/watch?v=lblwOFIbgtQ Link to comment Share on other sites More sharing options...
GoroX Posted March 20, 2012 Author Share Posted March 20, 2012 Thanks Belini! I did have a look at the functions, alas, the problem was that I omitted a parameter from Run() so that the @SW_HIDE flag was passed as the "workingdir" parameter of Run()... So, the WinWait() function works just fine, even when using @SW_HIDE. That said, I now have a different problem but that's a subject for a different post... 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