Click to See Complete Forum and Search --> : capturing cursor


eligeti
March 6th, 2005, 01:32 PM
Hi,

I want to capture the cursor on to the bit map. basically i am taking a screen shot using the BitBlt(), GetDIBits() functions.

But the problem here is it is not capturing the cursor. So i searched in msdn that one can get the cursor info using GetCursorInfo() and then use DrawIcon() but now the issue is how can i get the icon from the cursor handle?

thanks
ve

mdmd
March 6th, 2005, 09:11 PM
After you have a handle to a cursor, you can get the image with something like this
Check the flags. Check the docs to make sure you delete everything to prevent
resource leaks.

HICON hIcon = (HICON)CopyImage( (HANDLE)hCursor, IMAGE_ICON, 0, 0, 0 );