I am working on an automation program, and the I thought about posting a dummy message, but I do not think edit: I came up with some, an ugly and hacked solution that seems to work : I hope that something better than this. Edit: sending It looks like Older message: I came up with a solution to solve my problem, still a hack but is not ugly. This idea is misusing the It was tested on Windows XP and Windows 8 and works as expected, i.e. does not fail despite the zero HDC value. WaitForInputIdle function helps me determine The problem is that when the window target app is started the problem is that, in my case, it works only with the first window - this is how
WaitForInputIdle works, only once.
The functionality of WaitForInputIdle can be implemented in a different way, as the target process is busy every time, and can wait until it is done ?
RECT RC; If (GetUpdateRect (hWnd, & amp; RC, FALSE)) {rc.left = rc.top = 0; Rc.right = rc.bottom = 1; Invalid note (hwnd, and rc, wrong); } Do {sleep (100); } (GetUpdateRect (hWnd, & amp; RC, FALSE));
PrintWindow hack has no advantage, because internally it sends only
WM_PAINT
PrintWindow function, which basically sends a WM_PAINT message to
Post and waits for action on the window. For - what I really want is a code below with some informational comments.
// BEWARE: The hack / printwondo below is used as a synchronization tool here. When it says, the system sends WM_PAINT and waits for it to be processed Note: If HWND is hanged, then the following call will hang well PrintWindow (hWnd, NULL, 0);
No comments:
Post a Comment