Emiel Wieldraaijer Posted January 8, 2008 Posted January 8, 2008 Hi All, I've got a small problem with hidden a program and showing it afterwards Example $ProgramPID = Run("ProgramName.exe", "", @SW_HIDE) $PWC1 = ProcessWait(ProgramName.exe) If $PWC1 = "1" Then WinSetState("ProgramTitle", "", @SW_SHOW) ; Also tried WinActivate("ProgramTitle") EndIf Sometimes the program is not shown but the process is running. I know i do not have to use the @SW_HIDE but this is not the complete code Thnx Emiel Best regards,Emiel Wieldraaijer
Siao Posted January 9, 2008 Posted January 9, 2008 (edited) Have you checked the return value of WinSetState()? I think it fires too soon. Because, process is not the same as window. If process exists, it doesn't mean any window belonging to that process exist yet, it just means that process exists. Some programs really take their time initializing data before creating main window. WinWait/WinExists would make more sense than ProcessWait in your case. Edited January 9, 2008 by Siao "be smart, drink your wine"
Emiel Wieldraaijer Posted January 9, 2008 Author Posted January 9, 2008 Hi Siao, thnx you are totally correct.. I hope your image has nothing to do with my stupidity hahahahahaha Emiel Best regards,Emiel Wieldraaijer
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