atom0s Moderator
Reputation: 204 Joined: 25 Jan 2006 Posts: 8581 Location: 127.0.0.1
|
Posted: Mon Dec 27, 2010 7:56 pm Post subject: |
|
|
Firstly, don't call FreeConsole on a console application. If you want a windowless solution running in the background just create a normal Win32 application and just don't create a window.
Monitoring Key Press:
- GetAsyncKeyState (Global)
- RegisterHotKey (Global)
- WM_CHAR / WM_KEYDOWN / WM_KEYUP (Local)
Taking the screenshot can be done various different ways and saving it is up to you as well. You can use outside libraries such as libpng / libjpg etc. to save with a compressed format for size friendly images and so on.
Snapping an image of the screen (Gdi):
- CreateCompatibleDC
- CreateCompatibleBitmap
- BitBlt
- SelectObject / DeleteObject
Screenshot via Clipboard:
- When your key is detected, force the print screen button to be pressed.
- OpenClipboard / GetClipboardData / CloseClipboard
- Convert the clipboard data to a bmp and save it.
There are other ways of taking the image as well as creating an application to handle monitoring for the key press as well. Just use Google if you need more in depth examples. _________________ - Retired.
|
|