Hiya,
I'm working on a plugin which basically takes a screen shot then saves it...
here's my code so far
HBITMAP ImageFromClipboard(HWND hWnd)
{
if (!OpenClipboard(hWnd))
return NULL;
HBITMAP hBitmap = (HBITMAP)GetClipboardData(CF_BITMAP);
CloseClipboard();
return hBitmap;
}
void DLL_EXPORT CaptureDesktop( void )
{
for(int i = 0; i <= 1; i++ ){
keybd_event(VK_SNAPSHOT, 0x2C, 0, 0);
keybd_event(VK_SNAPSHOT, 0x2C, KEYEVENTF_KEYUP, 0);
}
MessageBoxA( GetActiveWindow(), "Captured", "CaptureDll Message", MB_OK | MB_ICONINFORMATION );
HWND hWnd = GetDesktopWindow();
HBITMAP hBitmap = ImageFromClipboard(hWnd);
if (hBitmap != NULL){
MessageBoxA( GetActiveWindow(), "Got hBitmap", "CaptureDll Message", MB_OK | MB_ICONINFORMATION );
}
}
as you can see, it takes a screen shot and gets the hBitmap from the clipboard, But i have no idea on how to save it, or better yet, return it to DBPro as an image...
any ideas?
Yours
N3wton