This maybe one of those weird ways an application interacts with Macro Scheduler, but I wanted to see if I'm doing something wrong. I am starting a program, entering my data and then minimizing it so that I can do other things while it runs. Once the program is done running a child window will pop up to say the operation has completed. I have the macro set up so that once the main program is minimized, it waits until the child window opens and then presses Enter to dismiss the window. The way I have it written I cannot get the macro to wait for this child window if the Main window isn't minimized. The child window has the same window name as the main window.
Code: Select all
//Minimize CloneDVD2
WindowAction>2,CloneDVD2
//Wait for child window of CloneDVD2
Let>WF_TYPE=3
WaitWindowOpen>CloneDVD2
//Press OK to recognize that movie copy completed
Press ENTER
Release ENTER
My problem is recalling the main window that is minimized. When I attempt to close the window while it's minimized, after dismissing the child window, a new blank application window opens. I have a link to the screen shot below, since I can never figure out the whole picture hosting thing. Yes, I know I should be ashamed of myself since this is so basic.
http://flic.kr/p/93RZTc
This problem happens when I use the WindowAction, SetFocus, or CloseWindow commands. I was able to get around the problem, by minimizing the window a second time after I used the SetFocus command.
Code: Select all
//Reactivate CloneDVD2 dialog window so I can close it. Won't work otherwise
SetFocus>CloneDVD2
WindowAction>2,CloneDVD2
//Closes the CloneDVD2 dialog window
CloseWindow>CloneDVD2
I thought using a WindowHandle might help to solve the situation a better way, but I can't seem to figure out how to use it, or else it also doesn't work. I tried looking through the site, but I didn't see anything that helped me understand how to implement it.
FYI: I also have this problem when opening the program. After using WaitWindowOpen I needed a Wait> before I used SetFocus or I would get the same screen.
Code: Select all
//Starts Clone DVD 2
RunProgram>C:\Program Files\Elaborate Bytes\CloneDVD2\CloneDVD2.exe
//Waits for Clone DVD 2 to open
WaitWindowOpen>CloneDVD2
//Manual wait incase a little lag from "WaitWindowOpen" command - Might be able to use just one or the other but sometimes doesn't always work
Wait>2
//Activates CloneDVD2 Window
SetFocus>CloneDVD2
Sorry if similar has been posted before, but I couldn't seem to find it.