I recently obtained a license for WinX DVD Ripper Platinum, and am annoyed by the fact that, when it's done ripping a DVD, it doesn't tell me so. There's no popup, no system "beep"- nothing. The progress dialog simply closes. The main window doesn't even focus itself...
To speed up my DVD-ripping proccess, I'm making a simple console application (using C# and VS2010) that:
- Finds the handle of the process named "WinX_DVD_Ripper_Platinum" (the process name of the WinX DVD Ripper Platinum software)
- Finds the handle of the progress dialog on that process using the
GetChildWindowsmethod defined in this sample at pinvoke.net - Starts a
System.Timers.Timerinstance that checks (or is supposed to check) whether the progress dialog has closed every 5 seconds (using theGetWindowLongfunction, and - Plays a few beeps with the
System.Console.Beepmethod to tell the user that the rip is complete. The timer auto-resets, performing the check (or repeating the beep if the dialog has closed) every 5 seconds until the user presses a key in the console window.
Steps 1, 2, and 4 are working fine, but I'm having problems with step 3- this, my question is, which of the window style constants should I use to check if the window is visible? (WS_VISIBLE did NOT work...)
For more details, this is the function I'm using to check the dialog's visibility:
private static bool IsWindowVisible(IntPtr hwnd) { var style = GetWindowLong(hwnd, GWL.GWL_EXSTYLE); var visible = style & (WS flag goes here); return visible != 0; }