Commit bc54d785 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

- change the internal functions in windows/cursoricon.c to use 32bit

handles - move the implementation of ExtractAssociatedIcon16 to ExtractAssociatedIconA - convert HICON to a void* - fixed some handle conversions that happened to be in the way while doing the above
parent b41d4fed
...@@ -93,19 +93,19 @@ const struct builtin_class_descr STATIC_builtin_class = ...@@ -93,19 +93,19 @@ const struct builtin_class_descr STATIC_builtin_class =
static HICON STATIC_SetIcon( HWND hwnd, HICON hicon, DWORD style ) static HICON STATIC_SetIcon( HWND hwnd, HICON hicon, DWORD style )
{ {
HICON prevIcon; HICON prevIcon;
CURSORICONINFO *info = hicon?(CURSORICONINFO *) GlobalLock16( hicon ):NULL; CURSORICONINFO *info = hicon?(CURSORICONINFO *) GlobalLock16(HICON_16(hicon)):NULL;
if ((style & SS_TYPEMASK) != SS_ICON) return 0; if ((style & SS_TYPEMASK) != SS_ICON) return 0;
if (hicon && !info) { if (hicon && !info) {
ERR("huh? hicon!=0, but info=0???\n"); ERR("huh? hicon!=0, but info=0???\n");
return 0; return 0;
} }
prevIcon = SetWindowLongA( hwnd, HICON_GWL_OFFSET, hicon ); prevIcon = (HICON)SetWindowLongA( hwnd, HICON_GWL_OFFSET, (LONG)hicon );
if (hicon) if (hicon)
{ {
SetWindowPos( hwnd, 0, 0, 0, info->nWidth, info->nHeight, SetWindowPos( hwnd, 0, 0, 0, info->nWidth, info->nHeight,
SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOZORDER ); SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOZORDER );
GlobalUnlock16( hicon ); GlobalUnlock16(HICON_16(hicon));
} }
return prevIcon; return prevIcon;
} }
...@@ -362,7 +362,7 @@ static LRESULT StaticWndProc_common( HWND hwnd, UINT uMsg, WPARAM wParam, ...@@ -362,7 +362,7 @@ static LRESULT StaticWndProc_common( HWND hwnd, UINT uMsg, WPARAM wParam,
lResult = STATIC_SetBitmap( hwnd, (HBITMAP)lParam, style ); lResult = STATIC_SetBitmap( hwnd, (HBITMAP)lParam, style );
break; break;
case IMAGE_ICON: case IMAGE_ICON:
lResult = STATIC_SetIcon( hwnd, (HICON)lParam, style ); lResult = (LRESULT)STATIC_SetIcon( hwnd, (HICON)lParam, style );
break; break;
default: default:
FIXME("STM_SETIMAGE: Unhandled type %x\n", wParam); FIXME("STM_SETIMAGE: Unhandled type %x\n", wParam);
...@@ -373,7 +373,7 @@ static LRESULT StaticWndProc_common( HWND hwnd, UINT uMsg, WPARAM wParam, ...@@ -373,7 +373,7 @@ static LRESULT StaticWndProc_common( HWND hwnd, UINT uMsg, WPARAM wParam,
case STM_SETICON16: case STM_SETICON16:
case STM_SETICON: case STM_SETICON:
lResult = STATIC_SetIcon( hwnd, (HICON)wParam, style ); lResult = (LRESULT)STATIC_SetIcon( hwnd, (HICON)wParam, style );
InvalidateRect( hwnd, NULL, TRUE ); InvalidateRect( hwnd, NULL, TRUE );
break; break;
...@@ -530,7 +530,7 @@ static void STATIC_PaintIconfn( HWND hwnd, HDC hdc, DWORD style ) ...@@ -530,7 +530,7 @@ static void STATIC_PaintIconfn( HWND hwnd, HDC hdc, DWORD style )
GetClientRect( hwnd, &rc ); GetClientRect( hwnd, &rc );
hbrush = SendMessageW( GetParent(hwnd), WM_CTLCOLORSTATIC, hdc, (LPARAM)hwnd ); hbrush = SendMessageW( GetParent(hwnd), WM_CTLCOLORSTATIC, hdc, (LPARAM)hwnd );
FillRect( hdc, &rc, hbrush ); FillRect( hdc, &rc, hbrush );
if ((hIcon = GetWindowLongA( hwnd, HICON_GWL_OFFSET ))) if ((hIcon = (HICON)GetWindowLongA( hwnd, HICON_GWL_OFFSET )))
DrawIcon( hdc, rc.left, rc.top, hIcon ); DrawIcon( hdc, rc.left, rc.top, hIcon );
} }
...@@ -538,24 +538,23 @@ static void STATIC_PaintBitmapfn(HWND hwnd, HDC hdc, DWORD style ) ...@@ -538,24 +538,23 @@ static void STATIC_PaintBitmapfn(HWND hwnd, HDC hdc, DWORD style )
{ {
RECT rc; RECT rc;
HBRUSH hbrush; HBRUSH hbrush;
HICON hIcon;
HDC hMemDC; HDC hMemDC;
HBITMAP oldbitmap; HBITMAP hBitmap, oldbitmap;
GetClientRect( hwnd, &rc ); GetClientRect( hwnd, &rc );
hbrush = SendMessageW( GetParent(hwnd), WM_CTLCOLORSTATIC, hdc, (LPARAM)hwnd ); hbrush = SendMessageW( GetParent(hwnd), WM_CTLCOLORSTATIC, hdc, (LPARAM)hwnd );
FillRect( hdc, &rc, hbrush ); FillRect( hdc, &rc, hbrush );
if ((hIcon = GetWindowLongA( hwnd, HICON_GWL_OFFSET ))) if ((hBitmap = (HBITMAP)GetWindowLongA( hwnd, HICON_GWL_OFFSET )))
{ {
BITMAP bm; BITMAP bm;
SIZE sz; SIZE sz;
if(GetObjectType(hIcon) != OBJ_BITMAP) return; if(GetObjectType(hBitmap) != OBJ_BITMAP) return;
if (!(hMemDC = CreateCompatibleDC( hdc ))) return; if (!(hMemDC = CreateCompatibleDC( hdc ))) return;
GetObjectW(hIcon, sizeof(bm), &bm); GetObjectW(hBitmap, sizeof(bm), &bm);
GetBitmapDimensionEx(hIcon, &sz); GetBitmapDimensionEx(hBitmap, &sz);
oldbitmap = SelectObject(hMemDC, hIcon); oldbitmap = SelectObject(hMemDC, hBitmap);
BitBlt(hdc, sz.cx, sz.cy, bm.bmWidth, bm.bmHeight, hMemDC, 0, 0, BitBlt(hdc, sz.cx, sz.cy, bm.bmWidth, bm.bmHeight, hMemDC, 0, 0,
SRCCOPY); SRCCOPY);
SelectObject(hMemDC, oldbitmap); SelectObject(hMemDC, oldbitmap);
......
...@@ -8483,7 +8483,7 @@ LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) ...@@ -8483,7 +8483,7 @@ LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return (LRESULT)infoPtr->hwndHeader; return (LRESULT)infoPtr->hwndHeader;
case LVM_GETHOTCURSOR: case LVM_GETHOTCURSOR:
return infoPtr->hHotCursor; return (LRESULT)infoPtr->hHotCursor;
case LVM_GETHOTITEM: case LVM_GETHOTITEM:
return infoPtr->nHotItem; return infoPtr->nHotItem;
...@@ -8661,7 +8661,7 @@ LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) ...@@ -8661,7 +8661,7 @@ LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
/* case LVN_SETGROUPMETRICS: */ /* case LVN_SETGROUPMETRICS: */
case LVM_SETHOTCURSOR: case LVM_SETHOTCURSOR:
return LISTVIEW_SetHotCursor(infoPtr, (HCURSOR)lParam); return (LRESULT)LISTVIEW_SetHotCursor(infoPtr, (HCURSOR)lParam);
case LVM_SETHOTITEM: case LVM_SETHOTITEM:
return LISTVIEW_SetHotItem(infoPtr, (INT)wParam); return LISTVIEW_SetHotItem(infoPtr, (INT)wParam);
......
...@@ -2566,11 +2566,11 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) ...@@ -2566,11 +2566,11 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
else else
hIcon = psInfo->ppshheader.u.hIcon; hIcon = psInfo->ppshheader.u.hIcon;
SendMessageW(hwnd, WM_SETICON, 0, hIcon); SendMessageW(hwnd, WM_SETICON, 0, (LPARAM)hIcon);
} }
if (psInfo->ppshheader.dwFlags & PSH_USEHICON) if (psInfo->ppshheader.dwFlags & PSH_USEHICON)
SendMessageW(hwnd, WM_SETICON, 0, psInfo->ppshheader.u.hIcon); SendMessageW(hwnd, WM_SETICON, 0, (LPARAM)psInfo->ppshheader.u.hIcon);
psInfo->strPropertiesFor = strCaption; psInfo->strPropertiesFor = strCaption;
......
...@@ -1112,7 +1112,7 @@ StatusWindowProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) ...@@ -1112,7 +1112,7 @@ StatusWindowProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
return STATUSBAR_GetBorders ((INT *)lParam); return STATUSBAR_GetBorders ((INT *)lParam);
case SB_GETICON: case SB_GETICON:
return STATUSBAR_GetIcon (infoPtr, nPart); return (LRESULT)STATUSBAR_GetIcon (infoPtr, nPart);
case SB_GETPARTS: case SB_GETPARTS:
return STATUSBAR_GetParts (infoPtr, (INT)wParam, (INT *)lParam); return STATUSBAR_GetParts (infoPtr, (INT)wParam, (INT *)lParam);
......
...@@ -69,12 +69,12 @@ static const WCHAR FILE_star[] = {'*','.','*', 0}; ...@@ -69,12 +69,12 @@ static const WCHAR FILE_star[] = {'*','.','*', 0};
static const WCHAR FILE_bslash[] = {'\\', 0}; static const WCHAR FILE_bslash[] = {'\\', 0};
static const WCHAR FILE_specc[] = {'%','c',':', 0}; static const WCHAR FILE_specc[] = {'%','c',':', 0};
static HICON16 hFolder = 0; static HICON hFolder = 0;
static HICON16 hFolder2 = 0; static HICON hFolder2 = 0;
static HICON16 hFloppy = 0; static HICON hFloppy = 0;
static HICON16 hHDisk = 0; static HICON hHDisk = 0;
static HICON16 hCDRom = 0; static HICON hCDRom = 0;
static HICON16 hNet = 0; static HICON hNet = 0;
static const int fldrHeight = 16; static const int fldrHeight = 16;
static const int fldrWidth = 20; static const int fldrWidth = 20;
......
...@@ -49,6 +49,10 @@ WINE_DEFAULT_DEBUG_CHANNEL(ole); ...@@ -49,6 +49,10 @@ WINE_DEFAULT_DEBUG_CHANNEL(ole);
WINE_DECLARE_DEBUG_CHANNEL(accel); WINE_DECLARE_DEBUG_CHANNEL(accel);
#define HACCEL_16(h32) (LOWORD(h32)) #define HACCEL_16(h32) (LOWORD(h32))
#define HICON_16(h32) (LOWORD(h32))
#define HDC_32(h16) ((HDC)(ULONG_PTR)(h16))
#define HICON_32(h16) ((HICON)(ULONG_PTR)(h16))
/****************************************************************************** /******************************************************************************
* These are static/global variables and internal data structures that the * These are static/global variables and internal data structures that the
...@@ -2241,15 +2245,15 @@ HGLOBAL16 WINAPI OleMetaFilePictFromIconAndLabel16( ...@@ -2241,15 +2245,15 @@ HGLOBAL16 WINAPI OleMetaFilePictFromIconAndLabel16(
HINSTANCE16 hInstance = LoadLibrary16(lpszSourceFile); HINSTANCE16 hInstance = LoadLibrary16(lpszSourceFile);
/* load the icon at index from lpszSourceFile */ /* load the icon at index from lpszSourceFile */
hIcon = (HICON16)LoadIconA(hInstance, (LPCSTR)(DWORD)iIconIndex); hIcon = HICON_16(LoadIconA(hInstance, (LPCSTR)(DWORD)iIconIndex));
FreeLibrary16(hInstance); FreeLibrary16(hInstance);
} else } else
return (HGLOBAL)NULL; return (HGLOBAL)NULL;
} }
hdc = CreateMetaFile16(NULL); hdc = CreateMetaFile16(NULL);
DrawIcon(hdc, 0, 0, hIcon); /* FIXME */ DrawIcon(HDC_32(hdc), 0, 0, HICON_32(hIcon)); /* FIXME */
TextOutA(hdc, 0, 0, lpszLabel, 1); /* FIXME */ TextOutA(HDC_32(hdc), 0, 0, lpszLabel, 1); /* FIXME */
hmf = GlobalAlloc16(0, sizeof(METAFILEPICT16)); hmf = GlobalAlloc16(0, sizeof(METAFILEPICT16));
mf = (METAFILEPICT16 *)GlobalLock16(hmf); mf = (METAFILEPICT16 *)GlobalLock16(hmf);
mf->mm = MM_ANISOTROPIC; mf->mm = MM_ANISOTROPIC;
......
...@@ -120,7 +120,7 @@ BOOL CALLBACK RunDlgProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) ...@@ -120,7 +120,7 @@ BOOL CALLBACK RunDlgProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
case WM_INITDIALOG : case WM_INITDIALOG :
prfdp = (RUNFILEDLGPARAMS *)lParam ; prfdp = (RUNFILEDLGPARAMS *)lParam ;
SetWindowTextA (hwnd, prfdp->lpstrTitle) ; SetWindowTextA (hwnd, prfdp->lpstrTitle) ;
SetClassLongA (hwnd, GCL_HICON, prfdp->hIcon) ; SetClassLongA (hwnd, GCL_HICON, (LPARAM)prfdp->hIcon) ;
SendMessageA (GetDlgItem (hwnd, 12297), STM_SETICON, (WPARAM)LoadIconA ((HINSTANCE)NULL, IDI_WINLOGOA), 0) ; SendMessageA (GetDlgItem (hwnd, 12297), STM_SETICON, (WPARAM)LoadIconA ((HINSTANCE)NULL, IDI_WINLOGOA), 0) ;
FillList (GetDlgItem (hwnd, 12298), NULL) ; FillList (GetDlgItem (hwnd, 12298), NULL) ;
SetFocus (GetDlgItem (hwnd, 12298)) ; SetFocus (GetDlgItem (hwnd, 12298)) ;
......
...@@ -197,7 +197,7 @@ static HICON WINE_UNUSED SIC_GetIcon (LPCSTR sSourceFile, INT dwSourceIndex, BOO ...@@ -197,7 +197,7 @@ static HICON WINE_UNUSED SIC_GetIcon (LPCSTR sSourceFile, INT dwSourceIndex, BOO
if (INVALID_INDEX == index) if (INVALID_INDEX == index)
{ {
return INVALID_INDEX; return (HICON)INVALID_INDEX;
} }
if (bSmallIcon) if (bSmallIcon)
...@@ -415,11 +415,11 @@ HICON WINAPI ExtractIconExA ( LPCSTR lpszFile, INT nIconIndex, HICON * phiconLar ...@@ -415,11 +415,11 @@ HICON WINAPI ExtractIconExA ( LPCSTR lpszFile, INT nIconIndex, HICON * phiconLar
TRACE("file=%s idx=%i %p %p num=%i\n", lpszFile, nIconIndex, phiconLarge, phiconSmall, nIcons ); TRACE("file=%s idx=%i %p %p num=%i\n", lpszFile, nIconIndex, phiconLarge, phiconSmall, nIcons );
if (nIconIndex==-1) /* Number of icons requested */ if (nIconIndex==-1) /* Number of icons requested */
return PrivateExtractIconsA( lpszFile, -1, 0, 0, NULL, 0, 0, 0 ); return (HICON)PrivateExtractIconsA( lpszFile, -1, 0, 0, NULL, 0, 0, 0 );
if (phiconLarge) if (phiconLarge)
{ {
ret = PrivateExtractIconsA( lpszFile, nIconIndex, 32, 32, phiconLarge, 0, nIcons, 0 ); ret = (HICON)PrivateExtractIconsA( lpszFile, nIconIndex, 32, 32, phiconLarge, 0, nIcons, 0 );
if ( nIcons==1) if ( nIcons==1)
{ ret = phiconLarge[0]; { ret = phiconLarge[0];
} }
...@@ -431,7 +431,7 @@ HICON WINAPI ExtractIconExA ( LPCSTR lpszFile, INT nIconIndex, HICON * phiconLar ...@@ -431,7 +431,7 @@ HICON WINAPI ExtractIconExA ( LPCSTR lpszFile, INT nIconIndex, HICON * phiconLar
if (phiconSmall) if (phiconSmall)
{ {
ret = PrivateExtractIconsA( lpszFile, nIconIndex, 16, 16, phiconSmall, 0, nIcons, 0 ); ret = (HICON)PrivateExtractIconsA( lpszFile, nIconIndex, 16, 16, phiconSmall, 0, nIcons, 0 );
if ( nIcons==1 ) if ( nIcons==1 )
{ ret = phiconSmall[0]; { ret = phiconSmall[0];
} }
...@@ -444,7 +444,7 @@ HICON WINAPI ExtractIconExA ( LPCSTR lpszFile, INT nIconIndex, HICON * phiconLar ...@@ -444,7 +444,7 @@ HICON WINAPI ExtractIconExA ( LPCSTR lpszFile, INT nIconIndex, HICON * phiconLar
*/ */
HICON WINAPI ExtractIconExW ( LPCWSTR lpszFile, INT nIconIndex, HICON * phiconLarge, HICON * phiconSmall, UINT nIcons ) HICON WINAPI ExtractIconExW ( LPCWSTR lpszFile, INT nIconIndex, HICON * phiconLarge, HICON * phiconSmall, UINT nIcons )
{ LPSTR sFile; { LPSTR sFile;
DWORD ret; HICON ret;
TRACE("file=%s idx=%i %p %p num=%i\n", debugstr_w(lpszFile), nIconIndex, phiconLarge, phiconSmall, nIcons ); TRACE("file=%s idx=%i %p %p num=%i\n", debugstr_w(lpszFile), nIconIndex, phiconLarge, phiconSmall, nIcons );
...@@ -461,8 +461,40 @@ HICON WINAPI ExtractIconExW ( LPCWSTR lpszFile, INT nIconIndex, HICON * phiconLa ...@@ -461,8 +461,40 @@ HICON WINAPI ExtractIconExW ( LPCWSTR lpszFile, INT nIconIndex, HICON * phiconLa
* executable) and patch parameters if needed. * executable) and patch parameters if needed.
*/ */
HICON WINAPI ExtractAssociatedIconA(HINSTANCE hInst, LPSTR lpIconPath, LPWORD lpiIcon) HICON WINAPI ExtractAssociatedIconA(HINSTANCE hInst, LPSTR lpIconPath, LPWORD lpiIcon)
{ TRACE("\n"); {
return ExtractAssociatedIcon16(hInst,lpIconPath,lpiIcon); HICON hIcon;
WORD wDummyIcon = 0;
TRACE("\n");
if(lpiIcon == NULL)
lpiIcon = &wDummyIcon;
hIcon = ExtractIconA(hInst, lpIconPath, *lpiIcon);
if( hIcon < (HICON)2 )
{ if( hIcon == (HICON)1 ) /* no icons found in given file */
{ char tempPath[0x80];
UINT16 uRet = FindExecutable16(lpIconPath,NULL,tempPath);
if( uRet > 32 && tempPath[0] )
{ strcpy(lpIconPath,tempPath);
hIcon = ExtractIconA(hInst, lpIconPath, *lpiIcon);
if( hIcon > (HICON)2 )
return hIcon;
}
else hIcon = 0;
}
if( hIcon == (HICON)1 )
*lpiIcon = 2; /* MSDOS icon - we found .exe but no icons in it */
else
*lpiIcon = 6; /* generic icon - found nothing */
GetModuleFileName16(hInst, lpIconPath, 0x80);
hIcon = LoadIconA( hInst, MAKEINTRESOURCEA(*lpiIcon));
}
return hIcon;
} }
/************************************************************************* /*************************************************************************
......
...@@ -207,7 +207,7 @@ BOOL16 WINAPI AboutDlgProc16( HWND16 hWnd, UINT16 msg, WPARAM16 wParam, ...@@ -207,7 +207,7 @@ BOOL16 WINAPI AboutDlgProc16( HWND16 hWnd, UINT16 msg, WPARAM16 wParam,
*/ */
BOOL16 WINAPI ShellAbout16( HWND16 hWnd, LPCSTR szApp, LPCSTR szOtherStuff, BOOL16 WINAPI ShellAbout16( HWND16 hWnd, LPCSTR szApp, LPCSTR szOtherStuff,
HICON16 hIcon ) HICON16 hIcon )
{ return ShellAboutA( HWND_32(hWnd), szApp, szOtherStuff, hIcon ); { return ShellAboutA( HWND_32(hWnd), szApp, szOtherStuff, HICON_32(hIcon) );
} }
/************************************************************************* /*************************************************************************
...@@ -245,7 +245,7 @@ HGLOBAL16 WINAPI InternalExtractIcon16(HINSTANCE16 hInstance, ...@@ -245,7 +245,7 @@ HGLOBAL16 WINAPI InternalExtractIcon16(HINSTANCE16 hInstance,
int i; int i;
for (i=nIconIndex; i < nIconIndex + n; i++) for (i=nIconIndex; i < nIconIndex + n; i++)
RetPtr[i-nIconIndex] = RetPtr[i-nIconIndex] =
(HICON16)LoadIconA(hInst, (LPCSTR)(DWORD)i); HICON_16(LoadIconA(hInst, (LPCSTR)(DWORD)i));
FreeLibrary(hInst); FreeLibrary(hInst);
return hRet; return hRet;
} }
...@@ -269,7 +269,7 @@ HGLOBAL16 WINAPI InternalExtractIcon16(HINSTANCE16 hInstance, ...@@ -269,7 +269,7 @@ HGLOBAL16 WINAPI InternalExtractIcon16(HINSTANCE16 hInstance,
if (!res) if (!res)
{ {
int i; int i;
for (i = 0; i < n; i++) RetPtr[i] = (HICON16)icons[i]; for (i = 0; i < n; i++) RetPtr[i] = HICON_16(icons[i]);
} }
else else
{ {
...@@ -287,7 +287,7 @@ HGLOBAL16 WINAPI InternalExtractIcon16(HINSTANCE16 hInstance, ...@@ -287,7 +287,7 @@ HGLOBAL16 WINAPI InternalExtractIcon16(HINSTANCE16 hInstance,
HICON16 WINAPI ExtractIcon16( HINSTANCE16 hInstance, LPCSTR lpszExeFileName, HICON16 WINAPI ExtractIcon16( HINSTANCE16 hInstance, LPCSTR lpszExeFileName,
UINT16 nIconIndex ) UINT16 nIconIndex )
{ TRACE("\n"); { TRACE("\n");
return ExtractIconA( hInstance, lpszExeFileName, nIconIndex ); return HICON_16(ExtractIconA(HINSTANCE_32(hInstance), lpszExeFileName, nIconIndex));
} }
/************************************************************************* /*************************************************************************
...@@ -309,15 +309,15 @@ HICON16 WINAPI ExtractIconEx16( ...@@ -309,15 +309,15 @@ HICON16 WINAPI ExtractIconEx16(
ismall = (HICON*)HeapAlloc(GetProcessHeap(),0,nIcons*sizeof(HICON)); ismall = (HICON*)HeapAlloc(GetProcessHeap(),0,nIcons*sizeof(HICON));
else else
ismall = NULL; ismall = NULL;
ret = ExtractIconExA(lpszFile,nIconIndex,ilarge,ismall,nIcons); ret = HICON_16(ExtractIconExA(lpszFile,nIconIndex,ilarge,ismall,nIcons));
if (ilarge) { if (ilarge) {
for (i=0;i<nIcons;i++) for (i=0;i<nIcons;i++)
phiconLarge[i]=ilarge[i]; phiconLarge[i]=HICON_16(ilarge[i]);
HeapFree(GetProcessHeap(),0,ilarge); HeapFree(GetProcessHeap(),0,ilarge);
} }
if (ismall) { if (ismall) {
for (i=0;i<nIcons;i++) for (i=0;i<nIcons;i++)
phiconSmall[i]=ismall[i]; phiconSmall[i]=HICON_16(ismall[i]);
HeapFree(GetProcessHeap(),0,ismall); HeapFree(GetProcessHeap(),0,ismall);
} }
return ret; return ret;
...@@ -330,39 +330,9 @@ HICON16 WINAPI ExtractIconEx16( ...@@ -330,39 +330,9 @@ HICON16 WINAPI ExtractIconEx16(
* executable) and patch parameters if needed. * executable) and patch parameters if needed.
*/ */
HICON16 WINAPI ExtractAssociatedIcon16(HINSTANCE16 hInst, LPSTR lpIconPath, LPWORD lpiIcon) HICON16 WINAPI ExtractAssociatedIcon16(HINSTANCE16 hInst, LPSTR lpIconPath, LPWORD lpiIcon)
{ HICON16 hIcon; {
WORD wDummyIcon = 0; return HICON_16(ExtractAssociatedIconA(HINSTANCE_32(hInst), lpIconPath,
lpiIcon));
TRACE("\n");
if(lpiIcon == NULL)
lpiIcon = &wDummyIcon;
hIcon = ExtractIcon16(hInst, lpIconPath, *lpiIcon);
if( hIcon < 2 )
{ if( hIcon == 1 ) /* no icons found in given file */
{ char tempPath[0x80];
UINT16 uRet = FindExecutable16(lpIconPath,NULL,tempPath);
if( uRet > 32 && tempPath[0] )
{ strcpy(lpIconPath,tempPath);
hIcon = ExtractIcon16(hInst, lpIconPath, *lpiIcon);
if( hIcon > 2 )
return hIcon;
}
else hIcon = 0;
}
if( hIcon == 1 )
*lpiIcon = 2; /* MSDOS icon - we found .exe but no icons in it */
else
*lpiIcon = 6; /* generic icon - found nothing */
GetModuleFileName16(hInst, lpIconPath, 0x80);
hIcon = LoadIconA( hInst, MAKEINTRESOURCEA(*lpiIcon));
}
return hIcon;
} }
/************************************************************************* /*************************************************************************
......
...@@ -531,7 +531,7 @@ HICON WINAPI ExtractIconA( HINSTANCE hInstance, LPCSTR lpszExeFileName, ...@@ -531,7 +531,7 @@ HICON WINAPI ExtractIconA( HINSTANCE hInstance, LPCSTR lpszExeFileName,
HICON16 hIcon = *ptr; HICON16 hIcon = *ptr;
GlobalFree16(handle); GlobalFree16(handle);
return hIcon; return HICON_32(hIcon);
} }
return 0; return 0;
} }
...@@ -567,7 +567,7 @@ typedef struct ...@@ -567,7 +567,7 @@ typedef struct
#define DROP_FIELD_TOP (-15) #define DROP_FIELD_TOP (-15)
#define DROP_FIELD_HEIGHT 15 #define DROP_FIELD_HEIGHT 15
static HICON hIconTitleFont; static HFONT hIconTitleFont;
static BOOL __get_dropline( HWND hWnd, LPRECT lprect ) static BOOL __get_dropline( HWND hWnd, LPRECT lprect )
{ HWND hWndCtl = GetDlgItem(hWnd, IDC_WINE_TEXT); { HWND hWndCtl = GetDlgItem(hWnd, IDC_WINE_TEXT);
...@@ -674,7 +674,7 @@ BOOL WINAPI AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam, ...@@ -674,7 +674,7 @@ BOOL WINAPI AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam,
{ ABOUT_INFO *info = (ABOUT_INFO *)lParam; { ABOUT_INFO *info = (ABOUT_INFO *)lParam;
if (info) if (info)
{ const char* const *pstr = SHELL_People; { const char* const *pstr = SHELL_People;
SendDlgItemMessageA(hWnd, stc1, STM_SETICON,info->hIcon, 0); SendDlgItemMessageA(hWnd, stc1, STM_SETICON,(WPARAM)info->hIcon, 0);
GetWindowTextA( hWnd, Template, sizeof(Template) ); GetWindowTextA( hWnd, Template, sizeof(Template) );
sprintf( AppTitle, Template, info->szApp ); sprintf( AppTitle, Template, info->szApp );
SetWindowTextA( hWnd, AppTitle ); SetWindowTextA( hWnd, AppTitle );
......
...@@ -197,6 +197,9 @@ inline static void __SHCloneStrWtoA(char ** target, const WCHAR * source) ...@@ -197,6 +197,9 @@ inline static void __SHCloneStrWtoA(char ** target, const WCHAR * source)
} }
/* handle conversions */ /* handle conversions */
#define HICON_16(h32) (LOWORD(h32))
#define HICON_32(h16) ((HICON)(ULONG_PTR)(h16))
#define HINSTANCE_32(h16) ((HINSTANCE)(ULONG_PTR)(h16))
#define HWND_32(h16) ((HWND)(ULONG_PTR)(h16)) #define HWND_32(h16) ((HWND)(ULONG_PTR)(h16))
#endif #endif
...@@ -2206,7 +2206,7 @@ BOOL WINAPI SHLWAPI_335(LPSHELLEXECUTEINFOW lpExecInfo) ...@@ -2206,7 +2206,7 @@ BOOL WINAPI SHLWAPI_335(LPSHELLEXECUTEINFOW lpExecInfo)
* *
* Late bound call to shell32.SHFileOperationW. * Late bound call to shell32.SHFileOperationW.
*/ */
DWORD WINAPI SHLWAPI_336(LPSHFILEOPSTRUCTW lpFileOp) HICON WINAPI SHLWAPI_336(LPSHFILEOPSTRUCTW lpFileOp)
{ {
GET_FUNC(pSHFileOperationW, shell32, "SHFileOperationW", 0); GET_FUNC(pSHFileOperationW, shell32, "SHFileOperationW", 0);
return pSHFileOperationW(lpFileOp); return pSHFileOperationW(lpFileOp);
......
...@@ -340,17 +340,17 @@ static HRESULT ICO_ExtractIconExW( ...@@ -340,17 +340,17 @@ static HRESULT ICO_ExtractIconExW(
/* .ICO files have only one icon directory */ /* .ICO files have only one icon directory */
if( lpiID == NULL ) /* *.ico */ if( lpiID == NULL ) /* *.ico */
pCIDir = USER32_LoadResource( peimage, pIconDir + i, *(WORD*)pData, &uSize ); pCIDir = USER32_LoadResource( peimage, pIconDir + i, *(WORD*)pData, &uSize );
RetPtr[i-nIconIndex] = LookupIconIdFromDirectoryEx( pCIDir, TRUE, cxDesired, cyDesired, 0); RetPtr[i-nIconIndex] = (HICON)LookupIconIdFromDirectoryEx( pCIDir, TRUE, cxDesired, cyDesired, 0);
} }
for( icon = nIconIndex; icon < nIconIndex + nIcons; icon++ ) for( icon = nIconIndex; icon < nIconIndex + nIcons; icon++ )
{ {
pCIDir = NULL; pCIDir = NULL;
if( lpiID ) if( lpiID )
pCIDir = ICO_LoadIcon( peimage, lpiID->idEntries + RetPtr[icon-nIconIndex], &uSize); pCIDir = ICO_LoadIcon( peimage, lpiID->idEntries + (int)RetPtr[icon-nIconIndex], &uSize);
else else
for( i = 0; i < iconCount; i++ ) for( i = 0; i < iconCount; i++ )
if( pIconStorage[i].id == (RetPtr[icon-nIconIndex] | 0x8000) ) if( pIconStorage[i].id == ((int)RetPtr[icon-nIconIndex] | 0x8000) )
pCIDir = USER32_LoadResource( peimage, pIconStorage + i,*(WORD*)pData, &uSize ); pCIDir = USER32_LoadResource( peimage, pIconStorage + i,*(WORD*)pData, &uSize );
if( pCIDir ) if( pCIDir )
...@@ -508,7 +508,7 @@ static HRESULT ICO_ExtractIconExW( ...@@ -508,7 +508,7 @@ static HRESULT ICO_ExtractIconExW(
for (i=0; i<nIcons; i++) for (i=0; i<nIcons; i++)
{ {
const IMAGE_RESOURCE_DIRECTORY *xresdir; const IMAGE_RESOURCE_DIRECTORY *xresdir;
xresdir = find_entry_by_id(iconresdir,RetPtr[i],rootresdir); xresdir = find_entry_by_id(iconresdir,LOWORD(RetPtr[i]),rootresdir);
xresdir = find_entry_default(xresdir,rootresdir); xresdir = find_entry_default(xresdir,rootresdir);
idataent = (PIMAGE_RESOURCE_DATA_ENTRY)xresdir; idataent = (PIMAGE_RESOURCE_DATA_ENTRY)xresdir;
idata = NULL; idata = NULL;
......
...@@ -46,7 +46,7 @@ static LRESULT WINAPI desktop_winproc( HWND hwnd, UINT message, WPARAM wParam, L ...@@ -46,7 +46,7 @@ static LRESULT WINAPI desktop_winproc( HWND hwnd, UINT message, WPARAM wParam, L
break; break;
case WM_SETCURSOR: case WM_SETCURSOR:
return SetCursor( LoadCursorA( 0, IDC_ARROWA ) ); return (LRESULT)SetCursor( LoadCursorA( 0, IDC_ARROWA ) );
case WM_NCHITTEST: case WM_NCHITTEST:
return HTCLIENT; return HTCLIENT;
......
...@@ -236,7 +236,7 @@ inline static void destroy_icon_window( Display *display, WND *win ) ...@@ -236,7 +236,7 @@ inline static void destroy_icon_window( Display *display, WND *win )
static void set_icon_hints( Display *display, WND *wndPtr, XWMHints *hints ) static void set_icon_hints( Display *display, WND *wndPtr, XWMHints *hints )
{ {
X11DRV_WND_DATA *data = wndPtr->pDriverData; X11DRV_WND_DATA *data = wndPtr->pDriverData;
HICON hIcon = GetClassLongA( wndPtr->hwndSelf, GCL_HICON ); HICON hIcon = (HICON)GetClassLongA( wndPtr->hwndSelf, GCL_HICON );
if (data->hWMIconBitmap) DeleteObject( data->hWMIconBitmap ); if (data->hWMIconBitmap) DeleteObject( data->hWMIconBitmap );
if (data->hWMIconMask) DeleteObject( data->hWMIconMask); if (data->hWMIconMask) DeleteObject( data->hWMIconMask);
...@@ -1206,7 +1206,7 @@ HICON X11DRV_SetWindowIcon( HWND hwnd, HICON icon, BOOL small ) ...@@ -1206,7 +1206,7 @@ HICON X11DRV_SetWindowIcon( HWND hwnd, HICON icon, BOOL small )
{ {
WND *wndPtr; WND *wndPtr;
Display *display = thread_display(); Display *display = thread_display();
HICON old = SetClassLongW( hwnd, small ? GCL_HICONSM : GCL_HICON, icon ); HICON old = (HICON)SetClassLongW(hwnd, small ? GCL_HICONSM : GCL_HICON, (LONG)icon );
SetWindowPos( hwnd, 0, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOSIZE | SetWindowPos( hwnd, 0, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOSIZE |
SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOZORDER ); SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOZORDER );
......
...@@ -1840,7 +1840,7 @@ void X11DRV_SysCommandSizeMove( HWND hwnd, WPARAM wParam ) ...@@ -1840,7 +1840,7 @@ void X11DRV_SysCommandSizeMove( HWND hwnd, WPARAM wParam )
HDC hdc; HDC hdc;
HWND parent; HWND parent;
LONG hittest = (LONG)(wParam & 0x0f); LONG hittest = (LONG)(wParam & 0x0f);
HCURSOR16 hDragCursor = 0, hOldCursor = 0; HCURSOR hDragCursor = 0, hOldCursor = 0;
POINT minTrack, maxTrack; POINT minTrack, maxTrack;
POINT capturePoint, pt; POINT capturePoint, pt;
LONG style = GetWindowLongA( hwnd, GWL_STYLE ); LONG style = GetWindowLongA( hwnd, GWL_STYLE );
...@@ -1929,7 +1929,7 @@ void X11DRV_SysCommandSizeMove( HWND hwnd, WPARAM wParam ) ...@@ -1929,7 +1929,7 @@ void X11DRV_SysCommandSizeMove( HWND hwnd, WPARAM wParam )
if( iconic ) /* create a cursor for dragging */ if( iconic ) /* create a cursor for dragging */
{ {
hDragCursor = GetClassLongA( hwnd, GCL_HICON); hDragCursor = (HCURSOR)GetClassLongA( hwnd, GCL_HICON);
if( !hDragCursor ) hDragCursor = (HCURSOR)SendMessageA( hwnd, WM_QUERYDRAGICON, 0, 0L); if( !hDragCursor ) hDragCursor = (HCURSOR)SendMessageA( hwnd, WM_QUERYDRAGICON, 0, 0L);
if( !hDragCursor ) iconic = FALSE; if( !hDragCursor ) iconic = FALSE;
} }
......
...@@ -493,7 +493,7 @@ HBITMAP X11DRV_BITMAP_CreateBitmapFromPixmap(Pixmap pixmap, BOOL bDeletePixmap) ...@@ -493,7 +493,7 @@ HBITMAP X11DRV_BITMAP_CreateBitmapFromPixmap(Pixmap pixmap, BOOL bDeletePixmap)
width = pBmp->bitmap.bmWidth; width = pBmp->bitmap.bmWidth;
height = pBmp->bitmap.bmHeight; height = pBmp->bitmap.bmHeight;
hBmpCopy = CopyImage(hBmp, IMAGE_BITMAP, width, height, LR_CREATEDIBSECTION); hBmpCopy = (HBITMAP)CopyImage(hBmp, IMAGE_BITMAP, width, height, LR_CREATEDIBSECTION);
/* We can now get rid of the HBITMAP wrapper we created earlier. /* We can now get rid of the HBITMAP wrapper we created earlier.
* Note: Simply calling DeleteObject will free the embedded Pixmap as well. * Note: Simply calling DeleteObject will free the embedded Pixmap as well.
......
...@@ -84,13 +84,6 @@ typedef struct ...@@ -84,13 +84,6 @@ typedef struct
#define CID_WIN32 0x0004 #define CID_WIN32 0x0004
#define CID_NONSHARED 0x0008 #define CID_NONSHARED 0x0008
extern HGLOBAL CURSORICON_Load( HINSTANCE hInstance, LPCWSTR name,
int width, int height, int colors,
BOOL fCursor, UINT loadflags);
extern HGLOBAL CURSORICON_ExtCopy(HGLOBAL handle, UINT type,
INT desiredx, INT desiredy,
UINT flags);
extern void CURSORICON_FreeModuleIcons( HMODULE hModule ); extern void CURSORICON_FreeModuleIcons( HMODULE hModule );
#endif /* __WINE_CURSORICON_H */ #endif /* __WINE_CURSORICON_H */
...@@ -142,7 +142,14 @@ extern HPEN SYSCOLOR_GetPen( INT index ); ...@@ -142,7 +142,14 @@ extern HPEN SYSCOLOR_GetPen( INT index );
extern DWORD USER16_AlertableWait; extern DWORD USER16_AlertableWait;
/* HANDLE16 <-> HANDLE conversions */ /* HANDLE16 <-> HANDLE conversions */
#define HACCEL_32(h16) ((HACCEL)(ULONG_PTR)(h16))
#define HACCEL_16(h32) (LOWORD(h32)) #define HACCEL_16(h32) (LOWORD(h32))
#define HBRUSH_16(h32) (LOWORD(h32))
#define HCURSOR_16(h32) (LOWORD(h32))
#define HICON_16(h32) (LOWORD(h32))
#define HACCEL_32(h16) ((HACCEL)(ULONG_PTR)(h16))
#define HBRUSH_32(h16) ((HBRUSH)(ULONG_PTR)(h16))
#define HCURSOR_32(h16) ((HCURSOR)(ULONG_PTR)(h16))
#define HICON_32(h16) ((HICON)(ULONG_PTR)(h16))
#endif /* __WINE_USER_H */ #endif /* __WINE_USER_H */
...@@ -80,7 +80,7 @@ DECLARE_HANDLE(HDESK); ...@@ -80,7 +80,7 @@ DECLARE_HANDLE(HDESK);
DECLARE_HANDLE(HENHMETAFILE); DECLARE_HANDLE(HENHMETAFILE);
DECLARE_OLD_HANDLE(HFONT); DECLARE_OLD_HANDLE(HFONT);
DECLARE_HANDLE(HHOOK); DECLARE_HANDLE(HHOOK);
DECLARE_OLD_HANDLE(HICON); DECLARE_HANDLE(HICON);
DECLARE_OLD_HANDLE(HINSTANCE); DECLARE_OLD_HANDLE(HINSTANCE);
DECLARE_HANDLE(HKEY); DECLARE_HANDLE(HKEY);
DECLARE_HANDLE(HKL); DECLARE_HANDLE(HKL);
......
...@@ -102,7 +102,7 @@ FARPROC48 INT_GetPMHandler48( BYTE intnum ) ...@@ -102,7 +102,7 @@ FARPROC48 INT_GetPMHandler48( BYTE intnum )
*/ */
void INT_SetPMHandler48( BYTE intnum, FARPROC48 handler ) void INT_SetPMHandler48( BYTE intnum, FARPROC48 handler )
{ {
TRACE("Set 32-bit protected mode interrupt vector %02x <- %04x:%08x\n", TRACE("Set 32-bit protected mode interrupt vector %02x <- %04x:%08lx\n",
intnum, handler.selector, handler.offset ); intnum, handler.selector, handler.offset );
INT_Vectors48[intnum] = handler; INT_Vectors48[intnum] = handler;
} }
......
...@@ -553,12 +553,12 @@ ATOM WINAPI RegisterClass16( const WNDCLASS16 *wc ) ...@@ -553,12 +553,12 @@ ATOM WINAPI RegisterClass16( const WNDCLASS16 *wc )
iSmIconWidth = GetSystemMetrics(SM_CXSMICON); iSmIconWidth = GetSystemMetrics(SM_CXSMICON);
iSmIconHeight = GetSystemMetrics(SM_CYSMICON); iSmIconHeight = GetSystemMetrics(SM_CYSMICON);
classPtr->hIcon = wc->hIcon; classPtr->hIcon = HICON_32(wc->hIcon);
classPtr->hIconSm = CopyImage(wc->hIcon, IMAGE_ICON, classPtr->hIconSm = CopyImage(wc->hIcon, IMAGE_ICON,
iSmIconWidth, iSmIconHeight, iSmIconWidth, iSmIconHeight,
LR_COPYFROMRESOURCE); LR_COPYFROMRESOURCE);
classPtr->hCursor = wc->hCursor; classPtr->hCursor = HCURSOR_32(wc->hCursor);
classPtr->hbrBackground = wc->hbrBackground; classPtr->hbrBackground = HBRUSH_32(wc->hbrBackground);
WINPROC_SetProc( &classPtr->winprocA, (HWINDOWPROC)wc->lpfnWndProc, WINPROC_SetProc( &classPtr->winprocA, (HWINDOWPROC)wc->lpfnWndProc,
WIN_PROC_16, WIN_PROC_CLASS ); WIN_PROC_16, WIN_PROC_CLASS );
...@@ -602,8 +602,8 @@ ATOM WINAPI RegisterClassA( const WNDCLASSA* wc ) /* [in] Address of structure w ...@@ -602,8 +602,8 @@ ATOM WINAPI RegisterClassA( const WNDCLASSA* wc ) /* [in] Address of structure w
classPtr->hIconSm = CopyImage(wc->hIcon, IMAGE_ICON, classPtr->hIconSm = CopyImage(wc->hIcon, IMAGE_ICON,
iSmIconWidth, iSmIconHeight, iSmIconWidth, iSmIconHeight,
LR_COPYFROMRESOURCE); LR_COPYFROMRESOURCE);
classPtr->hCursor = (HCURSOR16)wc->hCursor; classPtr->hCursor = wc->hCursor;
classPtr->hbrBackground = (HBRUSH16)wc->hbrBackground; classPtr->hbrBackground = wc->hbrBackground;
WINPROC_SetProc( &classPtr->winprocA, (HWINDOWPROC)wc->lpfnWndProc, WINPROC_SetProc( &classPtr->winprocA, (HWINDOWPROC)wc->lpfnWndProc,
WIN_PROC_32A, WIN_PROC_CLASS ); WIN_PROC_32A, WIN_PROC_CLASS );
...@@ -642,8 +642,8 @@ ATOM WINAPI RegisterClassW( const WNDCLASSW* wc ) ...@@ -642,8 +642,8 @@ ATOM WINAPI RegisterClassW( const WNDCLASSW* wc )
classPtr->hIconSm = CopyImage(wc->hIcon, IMAGE_ICON, classPtr->hIconSm = CopyImage(wc->hIcon, IMAGE_ICON,
iSmIconWidth, iSmIconHeight, iSmIconWidth, iSmIconHeight,
LR_COPYFROMRESOURCE); LR_COPYFROMRESOURCE);
classPtr->hCursor = (HCURSOR16)wc->hCursor; classPtr->hCursor = wc->hCursor;
classPtr->hbrBackground = (HBRUSH16)wc->hbrBackground; classPtr->hbrBackground = wc->hbrBackground;
WINPROC_SetProc( &classPtr->winprocW, (HWINDOWPROC)wc->lpfnWndProc, WINPROC_SetProc( &classPtr->winprocW, (HWINDOWPROC)wc->lpfnWndProc,
WIN_PROC_32W, WIN_PROC_CLASS ); WIN_PROC_32W, WIN_PROC_CLASS );
...@@ -674,10 +674,10 @@ ATOM WINAPI RegisterClassEx16( const WNDCLASSEX16 *wc ) ...@@ -674,10 +674,10 @@ ATOM WINAPI RegisterClassEx16( const WNDCLASSEX16 *wc )
wc->hbrBackground, wc->style, wc->cbClsExtra, wc->hbrBackground, wc->style, wc->cbClsExtra,
wc->cbWndExtra, classPtr ); wc->cbWndExtra, classPtr );
classPtr->hIcon = wc->hIcon; classPtr->hIcon = HICON_32(wc->hIcon);
classPtr->hIconSm = wc->hIconSm; classPtr->hIconSm = HICON_32(wc->hIconSm);
classPtr->hCursor = wc->hCursor; classPtr->hCursor = HCURSOR_32(wc->hCursor);
classPtr->hbrBackground = wc->hbrBackground; classPtr->hbrBackground = HBRUSH_32(wc->hbrBackground);
WINPROC_SetProc( &classPtr->winprocA, (HWINDOWPROC)wc->lpfnWndProc, WINPROC_SetProc( &classPtr->winprocA, (HWINDOWPROC)wc->lpfnWndProc,
WIN_PROC_16, WIN_PROC_CLASS ); WIN_PROC_16, WIN_PROC_CLASS );
...@@ -708,10 +708,10 @@ ATOM WINAPI RegisterClassExA( const WNDCLASSEXA* wc ) ...@@ -708,10 +708,10 @@ ATOM WINAPI RegisterClassExA( const WNDCLASSEXA* wc )
wc->hbrBackground, wc->style, wc->cbClsExtra, wc->hbrBackground, wc->style, wc->cbClsExtra,
wc->cbWndExtra, classPtr ); wc->cbWndExtra, classPtr );
classPtr->hIcon = (HICON16)wc->hIcon; classPtr->hIcon = wc->hIcon;
classPtr->hIconSm = (HICON16)wc->hIconSm; classPtr->hIconSm = wc->hIconSm;
classPtr->hCursor = (HCURSOR16)wc->hCursor; classPtr->hCursor = wc->hCursor;
classPtr->hbrBackground = (HBRUSH16)wc->hbrBackground; classPtr->hbrBackground = wc->hbrBackground;
WINPROC_SetProc( &classPtr->winprocA, (HWINDOWPROC)wc->lpfnWndProc, WINPROC_SetProc( &classPtr->winprocA, (HWINDOWPROC)wc->lpfnWndProc,
WIN_PROC_32A, WIN_PROC_CLASS ); WIN_PROC_32A, WIN_PROC_CLASS );
CLASS_SetMenuNameA( classPtr, wc->lpszMenuName ); CLASS_SetMenuNameA( classPtr, wc->lpszMenuName );
...@@ -741,10 +741,10 @@ ATOM WINAPI RegisterClassExW( const WNDCLASSEXW* wc ) ...@@ -741,10 +741,10 @@ ATOM WINAPI RegisterClassExW( const WNDCLASSEXW* wc )
wc->hbrBackground, wc->style, wc->cbClsExtra, wc->hbrBackground, wc->style, wc->cbClsExtra,
wc->cbWndExtra, classPtr ); wc->cbWndExtra, classPtr );
classPtr->hIcon = (HICON16)wc->hIcon; classPtr->hIcon = wc->hIcon;
classPtr->hIconSm = (HICON16)wc->hIconSm; classPtr->hIconSm = wc->hIconSm;
classPtr->hCursor = (HCURSOR16)wc->hCursor; classPtr->hCursor = wc->hCursor;
classPtr->hbrBackground = (HBRUSH16)wc->hbrBackground; classPtr->hbrBackground = wc->hbrBackground;
WINPROC_SetProc( &classPtr->winprocW, (HWINDOWPROC)wc->lpfnWndProc, WINPROC_SetProc( &classPtr->winprocW, (HWINDOWPROC)wc->lpfnWndProc,
WIN_PROC_32W, WIN_PROC_CLASS ); WIN_PROC_32W, WIN_PROC_CLASS );
CLASS_SetMenuNameW( classPtr, wc->lpszMenuName ); CLASS_SetMenuNameW( classPtr, wc->lpszMenuName );
...@@ -1014,15 +1014,15 @@ LONG WINAPI SetClassLongA( HWND hwnd, INT offset, LONG newval ) ...@@ -1014,15 +1014,15 @@ LONG WINAPI SetClassLongA( HWND hwnd, INT offset, LONG newval )
break; break;
case GCL_HCURSOR: case GCL_HCURSOR:
retval = (LONG)class->hCursor; retval = (LONG)class->hCursor;
class->hCursor = newval; class->hCursor = (HCURSOR)newval;
break; break;
case GCL_HICON: case GCL_HICON:
retval = (LONG)class->hIcon; retval = (LONG)class->hIcon;
class->hIcon = newval; class->hIcon = (HICON)newval;
break; break;
case GCL_HICONSM: case GCL_HICONSM:
retval = (LONG)class->hIconSm; retval = (LONG)class->hIconSm;
class->hIconSm = newval; class->hIconSm = (HICON)newval;
break; break;
case GCL_STYLE: case GCL_STYLE:
retval = (LONG)class->style; retval = (LONG)class->style;
...@@ -1125,9 +1125,9 @@ BOOL16 WINAPI GetClassInfo16( HINSTANCE16 hInstance, SEGPTR name, WNDCLASS16 *wc ...@@ -1125,9 +1125,9 @@ BOOL16 WINAPI GetClassInfo16( HINSTANCE16 hInstance, SEGPTR name, WNDCLASS16 *wc
wc->cbClsExtra = (INT16)classPtr->cbClsExtra; wc->cbClsExtra = (INT16)classPtr->cbClsExtra;
wc->cbWndExtra = (INT16)classPtr->cbWndExtra; wc->cbWndExtra = (INT16)classPtr->cbWndExtra;
wc->hInstance = classPtr->style & CS_GLOBALCLASS ? GetModuleHandle16("USER") : (HINSTANCE16)classPtr->hInstance; wc->hInstance = classPtr->style & CS_GLOBALCLASS ? GetModuleHandle16("USER") : (HINSTANCE16)classPtr->hInstance;
wc->hIcon = classPtr->hIcon; wc->hIcon = HICON_16(classPtr->hIcon);
wc->hCursor = classPtr->hCursor; wc->hCursor = HCURSOR_16(classPtr->hCursor);
wc->hbrBackground = classPtr->hbrBackground; wc->hbrBackground = HBRUSH_16(classPtr->hbrBackground);
wc->lpszClassName = name; wc->lpszClassName = name;
wc->lpszMenuName = CLASS_GetMenuName16( classPtr ); wc->lpszMenuName = CLASS_GetMenuName16( classPtr );
return TRUE; return TRUE;
...@@ -1234,10 +1234,10 @@ BOOL16 WINAPI GetClassInfoEx16( HINSTANCE16 hInstance, SEGPTR name, WNDCLASSEX16 ...@@ -1234,10 +1234,10 @@ BOOL16 WINAPI GetClassInfoEx16( HINSTANCE16 hInstance, SEGPTR name, WNDCLASSEX16
wc->cbClsExtra = (INT16)classPtr->cbClsExtra; wc->cbClsExtra = (INT16)classPtr->cbClsExtra;
wc->cbWndExtra = (INT16)classPtr->cbWndExtra; wc->cbWndExtra = (INT16)classPtr->cbWndExtra;
wc->hInstance = (HINSTANCE16)classPtr->hInstance; wc->hInstance = (HINSTANCE16)classPtr->hInstance;
wc->hIcon = classPtr->hIcon; wc->hIcon = HICON_16(classPtr->hIcon);
wc->hIconSm = classPtr->hIconSm; wc->hIconSm = HICON_16(classPtr->hIconSm);
wc->hCursor = classPtr->hCursor; wc->hCursor = HCURSOR_16(classPtr->hCursor);
wc->hbrBackground = classPtr->hbrBackground; wc->hbrBackground = HBRUSH_16(classPtr->hbrBackground);
wc->lpszClassName = (SEGPTR)0; wc->lpszClassName = (SEGPTR)0;
wc->lpszMenuName = CLASS_GetMenuName16( classPtr ); wc->lpszMenuName = CLASS_GetMenuName16( classPtr );
wc->lpszClassName = name; wc->lpszClassName = name;
......
...@@ -431,7 +431,7 @@ static LRESULT DEFWND_DefWinProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa ...@@ -431,7 +431,7 @@ static LRESULT DEFWND_DefWinProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa
if( hdc ) if( hdc )
{ {
HICON hIcon; HICON hIcon;
if (IsIconic(hwnd) && ((hIcon = GetClassLongW( hwnd, GCL_HICON))) ) if (IsIconic(hwnd) && ((hIcon = (HICON)GetClassLongW( hwnd, GCL_HICON))) )
{ {
RECT rc; RECT rc;
int x, y; int x, y;
...@@ -621,9 +621,9 @@ static LRESULT DEFWND_DefWinProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa ...@@ -621,9 +621,9 @@ static LRESULT DEFWND_DefWinProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa
{ {
UINT len; UINT len;
HICON hIcon = GetClassLongW( hwnd, GCL_HICON ); HICON hIcon = (HICON)GetClassLongW( hwnd, GCL_HICON );
HINSTANCE instance = GetWindowLongW( hwnd, GWL_HINSTANCE ); HINSTANCE instance = GetWindowLongW( hwnd, GWL_HINSTANCE );
if (hIcon) return hIcon; if (hIcon) return (LRESULT)hIcon;
for(len=1; len<64; len++) for(len=1; len<64; len++)
if((hIcon = LoadIconW(instance, MAKEINTRESOURCEW(len)))) if((hIcon = LoadIconW(instance, MAKEINTRESOURCEW(len))))
return (LRESULT)hIcon; return (LRESULT)hIcon;
...@@ -649,14 +649,14 @@ static LRESULT DEFWND_DefWinProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa ...@@ -649,14 +649,14 @@ static LRESULT DEFWND_DefWinProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa
case WM_SETICON: case WM_SETICON:
if (USER_Driver.pSetWindowIcon) if (USER_Driver.pSetWindowIcon)
return USER_Driver.pSetWindowIcon( hwnd, lParam, (wParam != ICON_SMALL) ); return (LRESULT)USER_Driver.pSetWindowIcon( hwnd, (HICON)lParam, (wParam != ICON_SMALL) );
else else
{ {
HICON hOldIcon = SetClassLongW( hwnd, (wParam != ICON_SMALL) ? GCL_HICON : GCL_HICONSM, HICON hOldIcon = (HICON)SetClassLongW( hwnd, (wParam != ICON_SMALL) ? GCL_HICON : GCL_HICONSM,
lParam); lParam);
SetWindowPos(hwnd, 0, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOSIZE | SetWindowPos(hwnd, 0, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOSIZE |
SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOZORDER); SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOZORDER);
return hOldIcon; return (LRESULT)hOldIcon;
} }
case WM_GETICON: case WM_GETICON:
......
...@@ -1029,9 +1029,9 @@ static BOOL MDI_AugmentFrameMenu( HWND frame, HWND hChild ) ...@@ -1029,9 +1029,9 @@ static BOOL MDI_AugmentFrameMenu( HWND frame, HWND hChild )
if(TWEAK_WineLook > WIN31_LOOK) if(TWEAK_WineLook > WIN31_LOOK)
{ {
HICON hIcon = GetClassLongA(hChild, GCL_HICONSM); HICON hIcon = (HICON)GetClassLongA(hChild, GCL_HICONSM);
if (!hIcon) if (!hIcon)
hIcon = GetClassLongA(hChild, GCL_HICON); hIcon = (HICON)GetClassLongA(hChild, GCL_HICON);
if (hIcon) if (hIcon)
{ {
HDC hMemDC; HDC hMemDC;
......
...@@ -110,16 +110,20 @@ static HFONT MSGBOX_OnInit(HWND hwnd, LPMSGBOXPARAMSA lpmb) ...@@ -110,16 +110,20 @@ static HFONT MSGBOX_OnInit(HWND hwnd, LPMSGBOXPARAMSA lpmb)
/* Set the icon */ /* Set the icon */
switch(lpmb->dwStyle & MB_ICONMASK) { switch(lpmb->dwStyle & MB_ICONMASK) {
case MB_ICONEXCLAMATION: case MB_ICONEXCLAMATION:
SendDlgItemMessageA(hwnd, stc1, STM_SETICON, LoadIconA(0, IDI_EXCLAMATIONA), 0); SendDlgItemMessageA(hwnd, stc1, STM_SETICON,
(WPARAM)LoadIconA(0, IDI_EXCLAMATIONA), 0);
break; break;
case MB_ICONQUESTION: case MB_ICONQUESTION:
SendDlgItemMessageA(hwnd, stc1, STM_SETICON, LoadIconA(0, IDI_QUESTIONA), 0); SendDlgItemMessageA(hwnd, stc1, STM_SETICON,
(WPARAM)LoadIconA(0, IDI_QUESTIONA), 0);
break; break;
case MB_ICONASTERISK: case MB_ICONASTERISK:
SendDlgItemMessageA(hwnd, stc1, STM_SETICON, LoadIconA(0, IDI_ASTERISKA), 0); SendDlgItemMessageA(hwnd, stc1, STM_SETICON,
(WPARAM)LoadIconA(0, IDI_ASTERISKA), 0);
break; break;
case MB_ICONHAND: case MB_ICONHAND:
SendDlgItemMessageA(hwnd, stc1, STM_SETICON, LoadIconA(0, IDI_HANDA), 0); SendDlgItemMessageA(hwnd, stc1, STM_SETICON,
(WPARAM)LoadIconA(0, IDI_HANDA), 0);
break; break;
default: default:
/* By default, Windows 95/98/NT do not associate an icon to message boxes. /* By default, Windows 95/98/NT do not associate an icon to message boxes.
......
...@@ -1708,7 +1708,7 @@ LONG NC_HandleSetCursor( HWND hwnd, WPARAM wParam, LPARAM lParam ) ...@@ -1708,7 +1708,7 @@ LONG NC_HandleSetCursor( HWND hwnd, WPARAM wParam, LPARAM lParam )
case HTCLIENT: case HTCLIENT:
{ {
HCURSOR hCursor = GetClassLongA(hwnd, GCL_HCURSOR); HCURSOR hCursor = (HCURSOR)GetClassLongA(hwnd, GCL_HCURSOR);
if(hCursor) { if(hCursor) {
SetCursor(hCursor); SetCursor(hCursor);
return TRUE; return TRUE;
......
...@@ -3264,9 +3264,9 @@ DWORD WINAPI DragObject16( HWND16 hwndScope, HWND16 hWnd, UINT16 wObj, ...@@ -3264,9 +3264,9 @@ DWORD WINAPI DragObject16( HWND16 hwndScope, HWND16 hWnd, UINT16 wObj,
MSG msg; MSG msg;
LPDRAGINFO16 lpDragInfo; LPDRAGINFO16 lpDragInfo;
SEGPTR spDragInfo; SEGPTR spDragInfo;
HCURSOR16 hOldCursor=0, hBummer=0; HCURSOR hOldCursor=0, hBummer=0;
HGLOBAL16 hDragInfo = GlobalAlloc16( GMEM_SHARE | GMEM_ZEROINIT, 2*sizeof(DRAGINFO16)); HGLOBAL16 hDragInfo = GlobalAlloc16( GMEM_SHARE | GMEM_ZEROINIT, 2*sizeof(DRAGINFO16));
HCURSOR16 hCurrentCursor = 0; HCURSOR hCurrentCursor = 0;
HWND16 hCurrentWnd = 0; HWND16 hCurrentWnd = 0;
lpDragInfo = (LPDRAGINFO16) GlobalLock16(hDragInfo); lpDragInfo = (LPDRAGINFO16) GlobalLock16(hDragInfo);
...@@ -3280,7 +3280,7 @@ DWORD WINAPI DragObject16( HWND16 hwndScope, HWND16 hWnd, UINT16 wObj, ...@@ -3280,7 +3280,7 @@ DWORD WINAPI DragObject16( HWND16 hwndScope, HWND16 hWnd, UINT16 wObj,
return 0L; return 0L;
} }
if(hCursor) hOldCursor = SetCursor(hCursor); if(hCursor) hOldCursor = SetCursor(HCURSOR_32(hCursor));
lpDragInfo->hWnd = hWnd; lpDragInfo->hWnd = hWnd;
lpDragInfo->hScope = 0; lpDragInfo->hScope = 0;
...@@ -3305,7 +3305,7 @@ DWORD WINAPI DragObject16( HWND16 hwndScope, HWND16 hWnd, UINT16 wObj, ...@@ -3305,7 +3305,7 @@ DWORD WINAPI DragObject16( HWND16 hwndScope, HWND16 hWnd, UINT16 wObj,
TRACE_(msg)("lpDI->hScope = %04x\n",lpDragInfo->hScope); TRACE_(msg)("lpDI->hScope = %04x\n",lpDragInfo->hScope);
if( DRAG_QueryUpdate16(WIN_Handle32(hwndScope), spDragInfo) > 0 ) if( DRAG_QueryUpdate16(WIN_Handle32(hwndScope), spDragInfo) > 0 )
hCurrentCursor = hCursor; hCurrentCursor = HCURSOR_32(hCursor);
else else
{ {
hCurrentCursor = hBummer; hCurrentCursor = hBummer;
...@@ -3337,7 +3337,7 @@ DWORD WINAPI DragObject16( HWND16 hwndScope, HWND16 hWnd, UINT16 wObj, ...@@ -3337,7 +3337,7 @@ DWORD WINAPI DragObject16( HWND16 hwndScope, HWND16 hWnd, UINT16 wObj,
ReleaseCapture(); ReleaseCapture();
ShowCursor( FALSE ); ShowCursor( FALSE );
if( hCursor ) SetCursor( hOldCursor ); if( hCursor ) SetCursor(hOldCursor);
if( hCurrentCursor != hBummer ) if( hCurrentCursor != hBummer )
msg.lParam = SendMessage16( lpDragInfo->hScope, WM_DROPOBJECT, msg.lParam = SendMessage16( lpDragInfo->hScope, WM_DROPOBJECT,
......
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