hello all

I m making a program that print the screen when the key printscreen is down .

But i don't know if there is an API to know the state of a key .I have tried GetAsyncKeyState but it's not the good function.
I don't want to make a hook but if i can't do within tell me ;)


Escuse me for my poor english i'm french :)
Posted on 2002-12-16 05:56:00 by krusaf
What about a global hook? AFAIK there is no message sent to your applications window by the print screen key.
Posted on 2002-12-16 07:25:58 by bazik
I once did a program that saved the captured image every time print screen was pressed. I used the WM_DRAWCLIPBOARD message and then checked if the clipboard content was a bitmap. Also check out the SetClipBoardViewer API.

You can also try to use a print screen hotkey.
Posted on 2002-12-16 07:37:50 by Delight
Why not GetAsyncKeyState? If the LSB of the return value is set then the key was pressed since the last call.

invoke Sleep,whatever
invoke GetAsyncKeyState,VK_SNAPSHOT
test eax,1
jz keyloop
<... code to take snapshot ...>

or you could use SetTimer etc.

Posted on 2002-12-16 07:50:07 by stormix

Why not DirectInput?
Posted on 2002-12-16 08:24:57 by Maverick
i hope this is a joke :grin:
Posted on 2002-12-16 08:59:04 by mob