Alexandre Julliard : user32: Use CreateIconIndirect to implement CreateCursor.

Alexandre Julliard julliard at winehq.org
Mon Dec 21 09:39:52 CST 2009


Module: wine
Branch: master
Commit: 001abc3c62c125d93ebbd558ecd7e750ccc9fe28
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=001abc3c62c125d93ebbd558ecd7e750ccc9fe28

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon Dec 21 14:10:06 2009 +0100

user32: Use CreateIconIndirect to implement CreateCursor.

---

 dlls/user32/cursoricon.c |   21 +++++++++++----------
 1 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/dlls/user32/cursoricon.c b/dlls/user32/cursoricon.c
index 631c469..37bbcda 100644
--- a/dlls/user32/cursoricon.c
+++ b/dlls/user32/cursoricon.c
@@ -1431,20 +1431,21 @@ HCURSOR WINAPI CreateCursor( HINSTANCE hInstance,
                                  INT nWidth, INT nHeight,
                                  LPCVOID lpANDbits, LPCVOID lpXORbits )
 {
-    CURSORICONINFO info;
+    ICONINFO info;
+    HCURSOR hCursor;
 
     TRACE_(cursor)("%dx%d spot=%d,%d xor=%p and=%p\n",
                     nWidth, nHeight, xHotSpot, yHotSpot, lpXORbits, lpANDbits);
 
-    info.ptHotSpot.x = xHotSpot;
-    info.ptHotSpot.y = yHotSpot;
-    info.nWidth = nWidth;
-    info.nHeight = nHeight;
-    info.nWidthBytes = 0;
-    info.bPlanes = 1;
-    info.bBitsPerPixel = 1;
-
-    return HICON_32(CreateCursorIconIndirect16(0, &info, lpANDbits, lpXORbits));
+    info.fIcon = FALSE;
+    info.xHotspot = xHotSpot;
+    info.yHotspot = yHotSpot;
+    info.hbmMask = CreateBitmap( nWidth, nHeight, 1, 1, lpANDbits );
+    info.hbmColor = CreateBitmap( nWidth, nHeight, 1, 1, lpXORbits );
+    hCursor = CreateIconIndirect( &info );
+    DeleteObject( info.hbmMask );
+    DeleteObject( info.hbmColor );
+    return hCursor;
 }
 
 




More information about the wine-cvs mailing list