|
-
May 14th, 2009, 01:25 PM
#3
Re: mouse bitmap
actually i found a code that do exactly what i want but it's a C# code (http://netcode.ru/dotnet/?lang=&katI...264&artID=7239) so i tried to do the same thing in C++ and here is my code:
#include <windows.h>
#include <gdiplus.h>
Private void captureCursor(int* x, int* y)
{
BITMAPINFOHEADER bitmapInfo;
CURSORINFO* cInfo= new CURSORINFO();
(*cInfo).cbSize=sizeof(*cInfo);
GetCursorInfo(cInfo);
if((*cInfo).flags==CURSOR_SHOWING){
HICON handel =CopyIcon((*cInfo).hCursor);
ICONINFO icInfo;
if(GetIconInfo(handel,&icInfo)){
*x=(*cInfo).ptScreenPos.x - ((int)icInfo.xHotspot);
*y = (*cInfo).ptScreenPos.y - ((int)icInfo.yHotspot);
// Icon ic = Icon.FromHandle(handel);
//bmp = ic.ToBitmap();
}
}
}
when i got the errors I wanted to do this in another way without using GDI+ but i couldn't find out how?
I need just the image of the cursor (a bitmap) to copy it in the position I want.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|