-
mouse bitmap
hi,
I have two screens and i need to copy my mouse to the other screen.
I tried to use bitblt but this function copy the screen and doesn't copy the mouse.
can any body help me just to get the bitmap of the mouse and then i can use bitblt ?
Note: I tried to use GDI+ but when I try to compile I get many errors like:
c:\program files\microsoft visual studio 8\vc\platformsdk\include\GdiplusImaging.h(67) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\program files\microsoft visual studio 8\vc\platformsdk\include\GdiplusImaging.h(67) : error C2440: 'initializing' : cannot convert from 'const char [37]' to 'int'
There is no context in which this conversion is possible
c:\program files\microsoft visual studio 8\vc\platformsdk\include\GdiplusImaging.h(67) : error C2146: syntax error : missing ';' before identifier 'IImageBytes'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\GdiplusImaging.h(67) : error C2470: 'IImageBytes' : looks like a function definition, but there is no parameter list; skipping apparent body
c:\program files\microsoft visual studio 8\vc\platformsdk\include\GdiplusImaging.h(67) : error C2059: syntax error : 'public'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\GdiplusImaging.h(246) : error C2146: syntax error : missing ';' before identifier 'id'
.....
and i don't know how to resolve this problem. can you please help me?
-
Re: mouse bitmap
Code:
I have two screens and i need to copy my mouse to the other screen.
Copy your mouse to the other screen... Really haven't got a clue what you mean by that.
Also... Post some code that generate the errors.
-
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.