Capture Window Problem

Windows specific forum
dmoc
Enthusiast
Enthusiast
Posts: 739
Joined: Sat Apr 26, 2003 12:40 am

Capture Window Problem

Post 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?
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post 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?
dmoc
Enthusiast
Enthusiast
Posts: 739
Joined: Sat Apr 26, 2003 12:40 am

Post by dmoc »

Nothing - no capture, as if key strokes are lost
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

Even if your application's window is not active?
dmoc
Enthusiast
Enthusiast
Posts: 739
Joined: Sat Apr 26, 2003 12:40 am

Post 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.
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post 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.)
dmoc
Enthusiast
Enthusiast
Posts: 739
Joined: Sat Apr 26, 2003 12:40 am

Post by dmoc »

I'll double check. Thanks for the suggestions
dmoc
Enthusiast
Enthusiast
Posts: 739
Joined: Sat Apr 26, 2003 12:40 am

Post 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?
Post Reply