mr-es335 Posted Saturday at 04:01 AM Posted Saturday at 04:01 AM (edited) Good day, First off, a "Happy New Year!" to all of you!! In particular, to AndrewG, argumentum, Dan_555, ioa747 and pixelsearch! Their fortitude and assistance was invaluable to the completion of the various projects that I have working this past year! Anyhow, the following DOES NOT WORK... ; ----------------------------------------------- LaunchTextFile() ; ----------------------------------------------- Func LaunchTextFile() Local $MyTextFile0 = "C:\Testing\Info_Main.txt" ; ----------------------------------------------- ShellExecute($MyTextFile0) ; ----------------- ;Sleep(11) WinMove($MyTextFile0, "", 620, 300, 700, 900) EndFunc ;==>LaunchTextFile ; ----------------------------------------------- ...whilst the following DOES WORK... ; ----------------------------------------------- LaunchTextFile() ; ----------------------------------------------- Func LaunchTextFile() Local $MyTextFile0 = "C:\Testing\Info_Main.txt" ; ----------------------------------------------- ShellExecute($MyTextFile0) ; ----------------- Sleep(11) ; <==== APPARENTLY THE "KEY"!!! Sleep(10) DOES NOT WORK!! WinMove($MyTextFile0, "", 620, 300, 700, 900) EndFunc ;==>LaunchTextFile ; ----------------------------------------------- The question is, "Why?" The employment of "Sleep" is not mentioned in the HelpFile. If not...why not? Am I doing something "WRONG"? Edited Saturday at 04:03 AM by mr-es335 mr-es335 Sentinel Music Studios
Solution argumentum Posted Saturday at 04:18 AM Solution Posted Saturday at 04:18 AM 10 minutes ago, mr-es335 said: The question is, "Why?" Because if you need to wait for a window, you'd use WinWait() Also, ShellExecute() does not guaranty what is going to happen. The OS will decide what to do. Do read the help file to avoid these mishaps in your code. Because you'd become familiar with what AutoIt has to offer. So, do the katas. Otherwise you'll be asking yourself why, why, why. mr-es335 1 Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting.
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