Alexandre Julliard : user32: Add support for loading animated cursors/ icons from resources.

Alexandre Julliard julliard at winehq.org
Wed Apr 20 11:05:16 CDT 2011


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Wed Apr 20 11:16:18 2011 +0200

user32: Add support for loading animated cursors/icons from resources.

---

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

diff --git a/dlls/user32/cursoricon.c b/dlls/user32/cursoricon.c
index a4200d8..014a4b9 100644
--- a/dlls/user32/cursoricon.c
+++ b/dlls/user32/cursoricon.c
@@ -1403,7 +1403,15 @@ static HICON CURSORICON_Load(HINSTANCE hInstance, LPCWSTR name,
 
     if (!(hRsrc = FindResourceW( hInstance, name,
                                  (LPWSTR)(fCursor ? RT_GROUP_CURSOR : RT_GROUP_ICON) )))
-        return 0;
+    {
+        /* try animated resource */
+        if (!(hRsrc = FindResourceW( hInstance, name,
+                                    (LPWSTR)(fCursor ? RT_ANICURSOR : RT_ANIICON) ))) return 0;
+        if (!(handle = LoadResource( hInstance, hRsrc ))) return 0;
+        bits = LockResource( handle );
+        return CURSORICON_CreateIconFromANI( bits, SizeofResource( hInstance, handle ),
+                                             width, height, depth, !fCursor, loadflags );
+    }
 
     /* Find the best entry in the directory */
 




More information about the wine-cvs mailing list