Commit d3de0c26 authored by Alexandre Julliard's avatar Alexandre Julliard

user32: Implemented GetIconInfoExA/W.

parent beba1f15
...@@ -1866,19 +1866,72 @@ HICON WINAPI LoadIconA(HINSTANCE hInstance, LPCSTR name) ...@@ -1866,19 +1866,72 @@ HICON WINAPI LoadIconA(HINSTANCE hInstance, LPCSTR name)
*/ */
BOOL WINAPI GetIconInfo(HICON hIcon, PICONINFO iconinfo) BOOL WINAPI GetIconInfo(HICON hIcon, PICONINFO iconinfo)
{ {
struct cursoricon_object *ptr; ICONINFOEXW infoW;
infoW.cbSize = sizeof(infoW);
if (!GetIconInfoExW( hIcon, &infoW )) return FALSE;
iconinfo->fIcon = infoW.fIcon;
iconinfo->xHotspot = infoW.xHotspot;
iconinfo->yHotspot = infoW.yHotspot;
iconinfo->hbmColor = infoW.hbmColor;
iconinfo->hbmMask = infoW.hbmMask;
return TRUE;
}
if (!(ptr = get_icon_ptr( hIcon ))) return FALSE; /**********************************************************************
* GetIconInfoExA (USER32.@)
*/
BOOL WINAPI GetIconInfoExA( HICON icon, ICONINFOEXA *info )
{
ICONINFOEXW infoW;
TRACE("%p => %dx%d\n", hIcon, ptr->width, ptr->height); if (info->cbSize != sizeof(*info))
{
SetLastError( ERROR_INVALID_PARAMETER );
return FALSE;
}
infoW.cbSize = sizeof(infoW);
if (!GetIconInfoExW( icon, &infoW )) return FALSE;
info->fIcon = infoW.fIcon;
info->xHotspot = infoW.xHotspot;
info->yHotspot = infoW.yHotspot;
info->hbmColor = infoW.hbmColor;
info->hbmMask = infoW.hbmMask;
info->wResID = infoW.wResID;
WideCharToMultiByte( CP_ACP, 0, infoW.szModName, -1, info->szModName, MAX_PATH, NULL, NULL );
WideCharToMultiByte( CP_ACP, 0, infoW.szResName, -1, info->szResName, MAX_PATH, NULL, NULL );
return TRUE;
}
iconinfo->fIcon = ptr->is_icon; /**********************************************************************
iconinfo->xHotspot = ptr->hotspot.x; * GetIconInfoExW (USER32.@)
iconinfo->yHotspot = ptr->hotspot.y; */
iconinfo->hbmColor = copy_bitmap( ptr->frames[0].color ); BOOL WINAPI GetIconInfoExW( HICON icon, ICONINFOEXW *info )
iconinfo->hbmMask = copy_bitmap( ptr->frames[0].mask ); {
release_icon_ptr( hIcon, ptr ); struct cursoricon_object *ptr;
if (info->cbSize != sizeof(*info))
{
SetLastError( ERROR_INVALID_PARAMETER );
return FALSE;
}
if (!(ptr = get_icon_ptr( icon )))
{
SetLastError( ERROR_INVALID_CURSOR_HANDLE );
return FALSE;
}
TRACE("%p => %dx%d\n", icon, ptr->width, ptr->height);
info->fIcon = ptr->is_icon;
info->xHotspot = ptr->hotspot.x;
info->yHotspot = ptr->hotspot.y;
info->hbmColor = copy_bitmap( ptr->frames[0].color );
info->hbmMask = copy_bitmap( ptr->frames[0].mask );
info->wResID = 0; /* FIXME */
info->szModName[0] = 0; /* FIXME */
info->szResName[0] = 0; /* FIXME */
release_icon_ptr( icon, ptr );
return TRUE; return TRUE;
} }
......
...@@ -290,6 +290,8 @@ ...@@ -290,6 +290,8 @@
@ stdcall GetGUIThreadInfo(long ptr) @ stdcall GetGUIThreadInfo(long ptr)
@ stdcall GetGuiResources(long long) @ stdcall GetGuiResources(long long)
@ stdcall GetIconInfo(long ptr) @ stdcall GetIconInfo(long ptr)
@ stdcall GetIconInfoExA(long ptr)
@ stdcall GetIconInfoExW(long ptr)
@ stub GetInputDesktop @ stub GetInputDesktop
@ stdcall GetInputState() @ stdcall GetInputState()
@ stdcall GetInternalWindowPos(long ptr ptr) @ stdcall GetInternalWindowPos(long ptr ptr)
......
...@@ -2107,6 +2107,34 @@ typedef struct _ICONINFO { ...@@ -2107,6 +2107,34 @@ typedef struct _ICONINFO {
HBITMAP hbmColor; HBITMAP hbmColor;
} ICONINFO, *PICONINFO; } ICONINFO, *PICONINFO;
typedef struct _ICONINFOEXA
{
DWORD cbSize;
BOOL fIcon;
DWORD xHotspot;
DWORD yHotspot;
HBITMAP hbmMask;
HBITMAP hbmColor;
WORD wResID;
CHAR szModName[MAX_PATH];
CHAR szResName[MAX_PATH];
} ICONINFOEXA, *PICONINFOEXA;
typedef struct _ICONINFOEXW
{
DWORD cbSize;
BOOL fIcon;
DWORD xHotspot;
DWORD yHotspot;
HBITMAP hbmMask;
HBITMAP hbmColor;
WORD wResID;
WCHAR szModName[MAX_PATH];
WCHAR szResName[MAX_PATH];
} ICONINFOEXW, *PICONINFOEXW;
DECL_WINELIB_TYPE_AW(ICONINFOEX);
DECL_WINELIB_TYPE_AW(PICONINFOEX);
typedef struct tagCURSORINFO typedef struct tagCURSORINFO
{ {
...@@ -4633,6 +4661,9 @@ WINUSERAPI HWND WINAPI GetFocus(void); ...@@ -4633,6 +4661,9 @@ WINUSERAPI HWND WINAPI GetFocus(void);
WINUSERAPI HWND WINAPI GetForegroundWindow(void); WINUSERAPI HWND WINAPI GetForegroundWindow(void);
WINUSERAPI BOOL WINAPI GetGUIThreadInfo(DWORD,GUITHREADINFO*); WINUSERAPI BOOL WINAPI GetGUIThreadInfo(DWORD,GUITHREADINFO*);
WINUSERAPI BOOL WINAPI GetIconInfo(HICON,PICONINFO); WINUSERAPI BOOL WINAPI GetIconInfo(HICON,PICONINFO);
WINUSERAPI BOOL WINAPI GetIconInfoExA(HICON,ICONINFOEXA*);
WINUSERAPI BOOL WINAPI GetIconInfoExW(HICON,ICONINFOEXW*);
#define GetIconInfoEx WINELIB_NAME_AW(GetIconInfoEx)
WINUSERAPI BOOL WINAPI GetInputState(void); WINUSERAPI BOOL WINAPI GetInputState(void);
WINUSERAPI UINT WINAPI GetInternalWindowPos(HWND,LPRECT,LPPOINT); WINUSERAPI UINT WINAPI GetInternalWindowPos(HWND,LPRECT,LPPOINT);
WINUSERAPI UINT WINAPI GetKBCodePage(void); WINUSERAPI UINT WINAPI GetKBCodePage(void);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment