Page 1 of 1

Capture Window Problem

Posted: Fri Nov 04, 2005 2:02 pm
by dmoc
Strange problem: I can do a screen/window capture on various programs and on simple pb demo (eg, Image.pb) but not on my own pb program. It's too big to post but I do use a WinProc callback and it *does* work on win98. The only difference now is I am on XP. Any idea what may be causing the problem?

Posted: Fri Nov 04, 2005 5:48 pm
by Trond
You mean you can't take a screenshot using Print Screen? If so, what happens when you try? The window appears black or with "random" colours?

Posted: Fri Nov 04, 2005 6:17 pm
by dmoc
Nothing - no capture, as if key strokes are lost

Posted: Fri Nov 04, 2005 6:31 pm
by Trond
Even if your application's window is not active?

Posted: Sat Nov 05, 2005 6:09 am
by dmoc
When my window is active I cannot capture either the screen or the window itself. If I make another window active (eg, notepad) then capturing works fine. I'm using the ordinary Alt/PrtSc keys and these worked for same program under win98 but not now on XP.

Posted: Sat Nov 05, 2005 9:33 am
by Trond
Some of your code must be grabbing the keystrokes. It works fine here with a window with some controls and a window callback (that doesn't touch keyboard output, only control resizing.)

Posted: Sat Nov 05, 2005 10:06 pm
by dmoc
I'll double check. Thanks for the suggestions

Posted: Mon Nov 07, 2005 2:58 pm
by dmoc
hmmm, I'm using PB's keyboard/directx routines which I suspect consumes all key strokes not handled in my code. So if I don't capture the alt-prtsc then the event is lost entirely. If I do code for it and call keybd_event_(#VK_SNAPSHOT,0,0,0) then this also gets consumed by directx. The reason for this, and why it differs from win98, is because each app has it's own message queue where-as in win98 the event could be captured before the app got it. Sound right? So the question now is how/where to send a kb event such that WinXP itself does the window capture to clipboard? I suspect if the desktop is sent a VK_SNAPSHOT then I'll just end up wit a snapshot of the desktop, not my window.

PS: Can anyone confirm keybd_event_(#VK_SNAPSHOT,0,0,0) did actually work in win98?