Vincent Posted September 27, 2005 Posted September 27, 2005 Hi, all. Is there anyone know how to send "mouse clicks" to the file menu of a minimzed appliatin (e.g. go File->exit from the minimized MS Word)? I am asking this since I can't do anything while I run my script except sitting back and wait till the execution of my script is over, otherwise, say if I want to edit my code while I am executing my script, my script will "Exit" my editor. Is there anyway to avoid this situation? thanks all!!!
Sokko Posted September 27, 2005 Posted September 27, 2005 (edited) Look up "WinMenuSelectItem" in the help files. This does not actually do any clicking since that would be impossible for minimized windows, but it works just the same for programs that use regular Microsoft controls. Also watch out for those underlined letters, since they might not show themselves unless you press ALT. Your line might look something like this: WinMenuSelectItem("Microsoft Word","","&File","E&xit") Edited September 27, 2005 by Sokko
Vincent Posted September 29, 2005 Author Posted September 29, 2005 Look up "WinMenuSelectItem" in the help files. This does not actually do any clicking since that would be impossible for minimized windows, but it works just the same for programs that use regular Microsoft controls. Also watch out for those underlined letters, since they might not show themselves unless you press ALT. Your line might look something like this:WinMenuSelectItem("Microsoft Word","","&File","E&xit")ThanksSo will that work even after I minized the target application (e.g. I wan that script to work on the Notepad. Will it still work even after I minimized the notepad and the Window Media Player?
Sokko Posted September 29, 2005 Posted September 29, 2005 So will that work even after I minized the target application (e.g. I wan that script to work on the Notepad. Will it still work even after I minimized the notepad and the Window Media Player?Of course. Here's a quick example that opens Notepad, minimizes it, and then closes it using the WinMenuSelectItem function.Run("notepad.exe") Sleep(1000) WinSetState("Untitled","",@SW_MINIMIZE) Sleep(3000) WinMenuSelectItem("Untitled","","&File","E&xit")
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