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 =
static HICON STATIC_SetIcon( HWND hwnd, HICON hicon, DWORD style )
{
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 (hicon && !info) {
ERR("huh? hicon!=0, but info=0???\n");
return 0;
}
prevIcon = SetWindowLongA( hwnd, HICON_GWL_OFFSET, hicon );
prevIcon = (HICON)SetWindowLongA( hwnd, HICON_GWL_OFFSET, (LONG)hicon );
if (hicon)
{
SetWindowPos( hwnd, 0, 0, 0, info->nWidth, info->nHeight,
SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOZORDER );
GlobalUnlock16( hicon );
GlobalUnlock16(HICON_16(hicon));
}
return prevIcon;
}
......@@ -362,7 +362,7 @@ static LRESULT StaticWndProc_common( HWND hwnd, UINT uMsg, WPARAM wParam,
lResult = STATIC_SetBitmap( hwnd, (HBITMAP)lParam, style );
break;
case IMAGE_ICON:
lResult = STATIC_SetIcon( hwnd, (HICON)lParam, style );
lResult = (LRESULT)STATIC_SetIcon( hwnd, (HICON)lParam, style );
break;
default:
FIXME("STM_SETIMAGE: Unhandled type %x\n", wParam);
......@@ -373,7 +373,7 @@ static LRESULT StaticWndProc_common( HWND hwnd, UINT uMsg, WPARAM wParam,
case STM_SETICON16:
case STM_SETICON:
lResult = STATIC_SetIcon( hwnd, (HICON)wParam, style );
lResult = (LRESULT)STATIC_SetIcon( hwnd, (HICON)wParam, style );
InvalidateRect( hwnd, NULL, TRUE );
break;
......@@ -530,7 +530,7 @@ static void STATIC_PaintIconfn( HWND hwnd, HDC hdc, DWORD style )
GetClientRect( hwnd, &rc );
hbrush = SendMessageW( GetParent(hwnd), WM_CTLCOLORSTATIC, hdc, (LPARAM)hwnd );
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 );
}
......@@ -538,24 +538,23 @@ static void STATIC_PaintBitmapfn(HWND hwnd, HDC hdc, DWORD style )
{
RECT rc;
HBRUSH hbrush;
HICON hIcon;
HDC hMemDC;
HBITMAP oldbitmap;
HBITMAP hBitmap, oldbitmap;
GetClientRect( hwnd, &rc );
hbrush = SendMessageW( GetParent(hwnd), WM_CTLCOLORSTATIC, hdc, (LPARAM)hwnd );
FillRect( hdc, &rc, hbrush );
if ((hIcon = GetWindowLongA( hwnd, HICON_GWL_OFFSET )))
if ((hBitmap = (HBITMAP)GetWindowLongA( hwnd, HICON_GWL_OFFSET )))
{
BITMAP bm;
SIZE sz;
if(GetObjectType(hIcon) != OBJ_BITMAP) return;
if(GetObjectType(hBitmap) != OBJ_BITMAP) return;
if (!(hMemDC = CreateCompatibleDC( hdc ))) return;
GetObjectW(hIcon, sizeof(bm), &bm);
GetBitmapDimensionEx(hIcon, &sz);
oldbitmap = SelectObject(hMemDC, hIcon);
GetObjectW(hBitmap, sizeof(bm), &bm);
GetBitmapDimensionEx(hBitmap, &sz);
oldbitmap = SelectObject(hMemDC, hBitmap);
BitBlt(hdc, sz.cx, sz.cy, bm.bmWidth, bm.bmHeight, hMemDC, 0, 0,
SRCCOPY);
SelectObject(hMemDC, oldbitmap);
......
......@@ -8483,7 +8483,7 @@ LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return (LRESULT)infoPtr->hwndHeader;
case LVM_GETHOTCURSOR:
return infoPtr->hHotCursor;
return (LRESULT)infoPtr->hHotCursor;
case LVM_GETHOTITEM:
return infoPtr->nHotItem;
......@@ -8661,7 +8661,7 @@ LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
/* case LVN_SETGROUPMETRICS: */
case LVM_SETHOTCURSOR:
return LISTVIEW_SetHotCursor(infoPtr, (HCURSOR)lParam);
return (LRESULT)LISTVIEW_SetHotCursor(infoPtr, (HCURSOR)lParam);
case LVM_SETHOTITEM:
return LISTVIEW_SetHotItem(infoPtr, (INT)wParam);
......
......@@ -2566,11 +2566,11 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
else
hIcon = psInfo->ppshheader.u.hIcon;
SendMessageW(hwnd, WM_SETICON, 0, hIcon);
SendMessageW(hwnd, WM_SETICON, 0, (LPARAM)hIcon);
}
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;
......
......@@ -1112,7 +1112,7 @@ StatusWindowProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
return STATUSBAR_GetBorders ((INT *)lParam);
case SB_GETICON:
return STATUSBAR_GetIcon (infoPtr, nPart);
return (LRESULT)STATUSBAR_GetIcon (infoPtr, nPart);
case SB_GETPARTS:
return STATUSBAR_GetParts (infoPtr, (INT)wParam, (INT *)lParam);
......
......@@ -69,12 +69,12 @@ static const WCHAR FILE_star[] = {'*','.','*', 0};
static const WCHAR FILE_bslash[] = {'\\', 0};
static const WCHAR FILE_specc[] = {'%','c',':', 0};
static HICON16 hFolder = 0;
static HICON16 hFolder2 = 0;
static HICON16 hFloppy = 0;
static HICON16 hHDisk = 0;
static HICON16 hCDRom = 0;
static HICON16 hNet = 0;
static HICON hFolder = 0;
static HICON hFolder2 = 0;
static HICON hFloppy = 0;
static HICON hHDisk = 0;
static HICON hCDRom = 0;
static HICON hNet = 0;
static const int fldrHeight = 16;
static const int fldrWidth = 20;
......
......@@ -49,6 +49,10 @@ WINE_DEFAULT_DEBUG_CHANNEL(ole);
WINE_DECLARE_DEBUG_CHANNEL(accel);
#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
......@@ -2241,15 +2245,15 @@ HGLOBAL16 WINAPI OleMetaFilePictFromIconAndLabel16(
HINSTANCE16 hInstance = LoadLibrary16(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);
} else
return (HGLOBAL)NULL;
}
hdc = CreateMetaFile16(NULL);
DrawIcon(hdc, 0, 0, hIcon); /* FIXME */
TextOutA(hdc, 0, 0, lpszLabel, 1); /* FIXME */
DrawIcon(HDC_32(hdc), 0, 0, HICON_32(hIcon)); /* FIXME */
TextOutA(HDC_32(hdc), 0, 0, lpszLabel, 1); /* FIXME */
hmf = GlobalAlloc16(0, sizeof(METAFILEPICT16));
mf = (METAFILEPICT16 *)GlobalLock16(hmf);
mf->mm = MM_ANISOTROPIC;
......
......@@ -120,7 +120,7 @@ BOOL CALLBACK RunDlgProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
case WM_INITDIALOG :
prfdp = (RUNFILEDLGPARAMS *)lParam ;
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) ;
FillList (GetDlgItem (hwnd, 12298), NULL) ;
SetFocus (GetDlgItem (hwnd, 12298)) ;
......
......@@ -197,7 +197,7 @@ static HICON WINE_UNUSED SIC_GetIcon (LPCSTR sSourceFile, INT dwSourceIndex, BOO
if (INVALID_INDEX == index)
{
return INVALID_INDEX;
return (HICON)INVALID_INDEX;
}
if (bSmallIcon)
......@@ -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 );
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)
{
ret = PrivateExtractIconsA( lpszFile, nIconIndex, 32, 32, phiconLarge, 0, nIcons, 0 );
ret = (HICON)PrivateExtractIconsA( lpszFile, nIconIndex, 32, 32, phiconLarge, 0, nIcons, 0 );
if ( nIcons==1)
{ ret = phiconLarge[0];
}
......@@ -431,7 +431,7 @@ HICON WINAPI ExtractIconExA ( LPCSTR lpszFile, INT nIconIndex, HICON * phiconLar
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 )
{ ret = phiconSmall[0];
}
......@@ -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 )
{ LPSTR sFile;
DWORD ret;
HICON ret;
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
* executable) and patch parameters if needed.
*/
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,
*/
BOOL16 WINAPI ShellAbout16( HWND16 hWnd, LPCSTR szApp, LPCSTR szOtherStuff,
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,
int i;
for (i=nIconIndex; i < nIconIndex + n; i++)
RetPtr[i-nIconIndex] =
(HICON16)LoadIconA(hInst, (LPCSTR)(DWORD)i);
HICON_16(LoadIconA(hInst, (LPCSTR)(DWORD)i));
FreeLibrary(hInst);
return hRet;
}
......@@ -269,7 +269,7 @@ HGLOBAL16 WINAPI InternalExtractIcon16(HINSTANCE16 hInstance,
if (!res)
{
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
{
......@@ -287,7 +287,7 @@ HGLOBAL16 WINAPI InternalExtractIcon16(HINSTANCE16 hInstance,
HICON16 WINAPI ExtractIcon16( HINSTANCE16 hInstance, LPCSTR lpszExeFileName,
UINT16 nIconIndex )
{ TRACE("\n");
return ExtractIconA( hInstance, lpszExeFileName, nIconIndex );
return HICON_16(ExtractIconA(HINSTANCE_32(hInstance), lpszExeFileName, nIconIndex));
}
/*************************************************************************
......@@ -309,15 +309,15 @@ HICON16 WINAPI ExtractIconEx16(
ismall = (HICON*)HeapAlloc(GetProcessHeap(),0,nIcons*sizeof(HICON));
else
ismall = NULL;
ret = ExtractIconExA(lpszFile,nIconIndex,ilarge,ismall,nIcons);
ret = HICON_16(ExtractIconExA(lpszFile,nIconIndex,ilarge,ismall,nIcons));
if (ilarge) {
for (i=0;i<nIcons;i++)
phiconLarge[i]=ilarge[i];
phiconLarge[i]=HICON_16(ilarge[i]);
HeapFree(GetProcessHeap(),0,ilarge);
}
if (ismall) {
for (i=0;i<nIcons;i++)
phiconSmall[i]=ismall[i];
phiconSmall[i]=HICON_16(ismall[i]);
HeapFree(GetProcessHeap(),0,ismall);
}
return ret;
......@@ -330,39 +330,9 @@ HICON16 WINAPI ExtractIconEx16(
* executable) and patch parameters if needed.
*/
HICON16 WINAPI ExtractAssociatedIcon16(HINSTANCE16 hInst, LPSTR lpIconPath, LPWORD lpiIcon)
{ HICON16 hIcon;
WORD wDummyIcon = 0;
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;
{
return HICON_16(ExtractAssociatedIconA(HINSTANCE_32(hInst), lpIconPath,
lpiIcon));
}
/*************************************************************************
......
......@@ -531,7 +531,7 @@ HICON WINAPI ExtractIconA( HINSTANCE hInstance, LPCSTR lpszExeFileName,
HICON16 hIcon = *ptr;
GlobalFree16(handle);
return hIcon;
return HICON_32(hIcon);
}
return 0;
}
......@@ -567,7 +567,7 @@ typedef struct
#define DROP_FIELD_TOP (-15)
#define DROP_FIELD_HEIGHT 15
static HICON hIconTitleFont;
static HFONT hIconTitleFont;
static BOOL __get_dropline( HWND hWnd, LPRECT lprect )
{ HWND hWndCtl = GetDlgItem(hWnd, IDC_WINE_TEXT);
......@@ -674,7 +674,7 @@ BOOL WINAPI AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam,
{ ABOUT_INFO *info = (ABOUT_INFO *)lParam;
if (info)
{ 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) );
sprintf( AppTitle, Template, info->szApp );
SetWindowTextA( hWnd, AppTitle );
......
......@@ -197,6 +197,9 @@ inline static void __SHCloneStrWtoA(char ** target, const WCHAR * source)
}
/* 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))
#endif
......@@ -2206,7 +2206,7 @@ BOOL WINAPI SHLWAPI_335(LPSHELLEXECUTEINFOW lpExecInfo)
*
* Late bound call to shell32.SHFileOperationW.
*/
DWORD WINAPI SHLWAPI_336(LPSHFILEOPSTRUCTW lpFileOp)
HICON WINAPI SHLWAPI_336(LPSHFILEOPSTRUCTW lpFileOp)
{
GET_FUNC(pSHFileOperationW, shell32, "SHFileOperationW", 0);
return pSHFileOperationW(lpFileOp);
......
......@@ -340,17 +340,17 @@ static HRESULT ICO_ExtractIconExW(
/* .ICO files have only one icon directory */
if( lpiID == NULL ) /* *.ico */
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++ )
{
pCIDir = NULL;
if( lpiID )
pCIDir = ICO_LoadIcon( peimage, lpiID->idEntries + RetPtr[icon-nIconIndex], &uSize);
pCIDir = ICO_LoadIcon( peimage, lpiID->idEntries + (int)RetPtr[icon-nIconIndex], &uSize);
else
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 );
if( pCIDir )
......@@ -508,7 +508,7 @@ static HRESULT ICO_ExtractIconExW(
for (i=0; i<nIcons; i++)
{
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);
idataent = (PIMAGE_RESOURCE_DATA_ENTRY)xresdir;
idata = NULL;
......
......@@ -46,7 +46,7 @@ static LRESULT WINAPI desktop_winproc( HWND hwnd, UINT message, WPARAM wParam, L
break;
case WM_SETCURSOR:
return SetCursor( LoadCursorA( 0, IDC_ARROWA ) );
return (LRESULT)SetCursor( LoadCursorA( 0, IDC_ARROWA ) );
case WM_NCHITTEST:
return HTCLIENT;
......
......@@ -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 )
{
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->hWMIconMask) DeleteObject( data->hWMIconMask);
......@@ -1206,7 +1206,7 @@ HICON X11DRV_SetWindowIcon( HWND hwnd, HICON icon, BOOL small )
{
WND *wndPtr;
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 |
SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOZORDER );
......
......@@ -1840,7 +1840,7 @@ void X11DRV_SysCommandSizeMove( HWND hwnd, WPARAM wParam )
HDC hdc;
HWND parent;
LONG hittest = (LONG)(wParam & 0x0f);
HCURSOR16 hDragCursor = 0, hOldCursor = 0;
HCURSOR hDragCursor = 0, hOldCursor = 0;
POINT minTrack, maxTrack;
POINT capturePoint, pt;
LONG style = GetWindowLongA( hwnd, GWL_STYLE );
......@@ -1929,7 +1929,7 @@ void X11DRV_SysCommandSizeMove( HWND hwnd, WPARAM wParam )
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 ) iconic = FALSE;
}
......
......@@ -493,7 +493,7 @@ HBITMAP X11DRV_BITMAP_CreateBitmapFromPixmap(Pixmap pixmap, BOOL bDeletePixmap)
width = pBmp->bitmap.bmWidth;
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.
* Note: Simply calling DeleteObject will free the embedded Pixmap as well.
......
......@@ -84,13 +84,6 @@ typedef struct
#define CID_WIN32 0x0004
#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 );
#endif /* __WINE_CURSORICON_H */
......@@ -142,7 +142,14 @@ extern HPEN SYSCOLOR_GetPen( INT index );
extern DWORD USER16_AlertableWait;
/* HANDLE16 <-> HANDLE conversions */
#define HACCEL_32(h16) ((HACCEL)(ULONG_PTR)(h16))
#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 */
......@@ -80,7 +80,7 @@ DECLARE_HANDLE(HDESK);
DECLARE_HANDLE(HENHMETAFILE);
DECLARE_OLD_HANDLE(HFONT);
DECLARE_HANDLE(HHOOK);
DECLARE_OLD_HANDLE(HICON);
DECLARE_HANDLE(HICON);
DECLARE_OLD_HANDLE(HINSTANCE);
DECLARE_HANDLE(HKEY);
DECLARE_HANDLE(HKL);
......
......@@ -102,7 +102,7 @@ FARPROC48 INT_GetPMHandler48( BYTE intnum )
*/
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 );
INT_Vectors48[intnum] = handler;
}
......
......@@ -553,12 +553,12 @@ ATOM WINAPI RegisterClass16( const WNDCLASS16 *wc )
iSmIconWidth = GetSystemMetrics(SM_CXSMICON);
iSmIconHeight = GetSystemMetrics(SM_CYSMICON);
classPtr->hIcon = wc->hIcon;
classPtr->hIcon = HICON_32(wc->hIcon);
classPtr->hIconSm = CopyImage(wc->hIcon, IMAGE_ICON,
iSmIconWidth, iSmIconHeight,
LR_COPYFROMRESOURCE);
classPtr->hCursor = wc->hCursor;
classPtr->hbrBackground = wc->hbrBackground;
classPtr->hCursor = HCURSOR_32(wc->hCursor);
classPtr->hbrBackground = HBRUSH_32(wc->hbrBackground);
WINPROC_SetProc( &classPtr->winprocA, (HWINDOWPROC)wc->lpfnWndProc,
WIN_PROC_16, WIN_PROC_CLASS );
......@@ -602,8 +602,8 @@ ATOM WINAPI RegisterClassA( const WNDCLASSA* wc ) /* [in] Address of structure w
classPtr->hIconSm = CopyImage(wc->hIcon, IMAGE_ICON,
iSmIconWidth, iSmIconHeight,
LR_COPYFROMRESOURCE);
classPtr->hCursor = (HCURSOR16)wc->hCursor;
classPtr->hbrBackground = (HBRUSH16)wc->hbrBackground;
classPtr->hCursor = wc->hCursor;
classPtr->hbrBackground = wc->hbrBackground;
WINPROC_SetProc( &classPtr->winprocA, (HWINDOWPROC)wc->lpfnWndProc,
WIN_PROC_32A, WIN_PROC_CLASS );
......@@ -642,8 +642,8 @@ ATOM WINAPI RegisterClassW( const WNDCLASSW* wc )
classPtr->hIconSm = CopyImage(wc->hIcon, IMAGE_ICON,
iSmIconWidth, iSmIconHeight,
LR_COPYFROMRESOURCE);
classPtr->hCursor = (HCURSOR16)wc->hCursor;
classPtr->hbrBackground = (HBRUSH16)wc->hbrBackground;
classPtr->hCursor = wc->hCursor;
classPtr->hbrBackground = wc->hbrBackground;
WINPROC_SetProc( &classPtr->winprocW, (HWINDOWPROC)wc->lpfnWndProc,
WIN_PROC_32W, WIN_PROC_CLASS );
......@@ -674,10 +674,10 @@ ATOM WINAPI RegisterClassEx16( const WNDCLASSEX16 *wc )
wc->hbrBackground, wc->style, wc->cbClsExtra,
wc->cbWndExtra, classPtr );
classPtr->hIcon = wc->hIcon;
classPtr->hIconSm = wc->hIconSm;
classPtr->hCursor = wc->hCursor;
classPtr->hbrBackground = wc->hbrBackground;
classPtr->hIcon = HICON_32(wc->hIcon);
classPtr->hIconSm = HICON_32(wc->hIconSm);
classPtr->hCursor = HCURSOR_32(wc->hCursor);
classPtr->hbrBackground = HBRUSH_32(wc->hbrBackground);
WINPROC_SetProc( &classPtr->winprocA, (HWINDOWPROC)wc->lpfnWndProc,
WIN_PROC_16, WIN_PROC_CLASS );
......@@ -708,10 +708,10 @@ ATOM WINAPI RegisterClassExA( const WNDCLASSEXA* wc )
wc->hbrBackground, wc->style, wc->cbClsExtra,
wc->cbWndExtra, classPtr );
classPtr->hIcon = (HICON16)wc->hIcon;
classPtr->hIconSm = (HICON16)wc->hIconSm;
classPtr->hCursor = (HCURSOR16)wc->hCursor;
classPtr->hbrBackground = (HBRUSH16)wc->hbrBackground;
classPtr->hIcon = wc->hIcon;
classPtr->hIconSm = wc->hIconSm;
classPtr->hCursor = wc->hCursor;
classPtr->hbrBackground = wc->hbrBackground;
WINPROC_SetProc( &classPtr->winprocA, (HWINDOWPROC)wc->lpfnWndProc,
WIN_PROC_32A, WIN_PROC_CLASS );
CLASS_SetMenuNameA( classPtr, wc->lpszMenuName );
......@@ -741,10 +741,10 @@ ATOM WINAPI RegisterClassExW( const WNDCLASSEXW* wc )
wc->hbrBackground, wc->style, wc->cbClsExtra,
wc->cbWndExtra, classPtr );
classPtr->hIcon = (HICON16)wc->hIcon;
classPtr->hIconSm = (HICON16)wc->hIconSm;
classPtr->hCursor = (HCURSOR16)wc->hCursor;
classPtr->hbrBackground = (HBRUSH16)wc->hbrBackground;
classPtr->hIcon = wc->hIcon;
classPtr->hIconSm = wc->hIconSm;
classPtr->hCursor = wc->hCursor;
classPtr->hbrBackground = wc->hbrBackground;
WINPROC_SetProc( &classPtr->winprocW, (HWINDOWPROC)wc->lpfnWndProc,
WIN_PROC_32W, WIN_PROC_CLASS );
CLASS_SetMenuNameW( classPtr, wc->lpszMenuName );
......@@ -1014,15 +1014,15 @@ LONG WINAPI SetClassLongA( HWND hwnd, INT offset, LONG newval )
break;
case GCL_HCURSOR:
retval = (LONG)class->hCursor;
class->hCursor = newval;
class->hCursor = (HCURSOR)newval;
break;
case GCL_HICON:
retval = (LONG)class->hIcon;
class->hIcon = newval;
class->hIcon = (HICON)newval;
break;
case GCL_HICONSM:
retval = (LONG)class->hIconSm;
class->hIconSm = newval;
class->hIconSm = (HICON)newval;
break;
case GCL_STYLE:
retval = (LONG)class->style;
......@@ -1125,9 +1125,9 @@ BOOL16 WINAPI GetClassInfo16( HINSTANCE16 hInstance, SEGPTR name, WNDCLASS16 *wc
wc->cbClsExtra = (INT16)classPtr->cbClsExtra;
wc->cbWndExtra = (INT16)classPtr->cbWndExtra;
wc->hInstance = classPtr->style & CS_GLOBALCLASS ? GetModuleHandle16("USER") : (HINSTANCE16)classPtr->hInstance;
wc->hIcon = classPtr->hIcon;
wc->hCursor = classPtr->hCursor;
wc->hbrBackground = classPtr->hbrBackground;
wc->hIcon = HICON_16(classPtr->hIcon);
wc->hCursor = HCURSOR_16(classPtr->hCursor);
wc->hbrBackground = HBRUSH_16(classPtr->hbrBackground);
wc->lpszClassName = name;
wc->lpszMenuName = CLASS_GetMenuName16( classPtr );
return TRUE;
......@@ -1234,10 +1234,10 @@ BOOL16 WINAPI GetClassInfoEx16( HINSTANCE16 hInstance, SEGPTR name, WNDCLASSEX16
wc->cbClsExtra = (INT16)classPtr->cbClsExtra;
wc->cbWndExtra = (INT16)classPtr->cbWndExtra;
wc->hInstance = (HINSTANCE16)classPtr->hInstance;
wc->hIcon = classPtr->hIcon;
wc->hIconSm = classPtr->hIconSm;
wc->hCursor = classPtr->hCursor;
wc->hbrBackground = classPtr->hbrBackground;
wc->hIcon = HICON_16(classPtr->hIcon);
wc->hIconSm = HICON_16(classPtr->hIconSm);
wc->hCursor = HCURSOR_16(classPtr->hCursor);
wc->hbrBackground = HBRUSH_16(classPtr->hbrBackground);
wc->lpszClassName = (SEGPTR)0;
wc->lpszMenuName = CLASS_GetMenuName16( classPtr );
wc->lpszClassName = name;
......
......@@ -431,7 +431,7 @@ static LRESULT DEFWND_DefWinProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa
if( hdc )
{
HICON hIcon;
if (IsIconic(hwnd) && ((hIcon = GetClassLongW( hwnd, GCL_HICON))) )
if (IsIconic(hwnd) && ((hIcon = (HICON)GetClassLongW( hwnd, GCL_HICON))) )
{
RECT rc;
int x, y;
......@@ -621,9 +621,9 @@ static LRESULT DEFWND_DefWinProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa
{
UINT len;
HICON hIcon = GetClassLongW( hwnd, GCL_HICON );
HICON hIcon = (HICON)GetClassLongW( hwnd, GCL_HICON );
HINSTANCE instance = GetWindowLongW( hwnd, GWL_HINSTANCE );
if (hIcon) return hIcon;
if (hIcon) return (LRESULT)hIcon;
for(len=1; len<64; len++)
if((hIcon = LoadIconW(instance, MAKEINTRESOURCEW(len))))
return (LRESULT)hIcon;
......@@ -649,14 +649,14 @@ static LRESULT DEFWND_DefWinProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa
case WM_SETICON:
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
{
HICON hOldIcon = SetClassLongW( hwnd, (wParam != ICON_SMALL) ? GCL_HICON : GCL_HICONSM,
HICON hOldIcon = (HICON)SetClassLongW( hwnd, (wParam != ICON_SMALL) ? GCL_HICON : GCL_HICONSM,
lParam);
SetWindowPos(hwnd, 0, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOSIZE |
SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOZORDER);
return hOldIcon;
return (LRESULT)hOldIcon;
}
case WM_GETICON:
......
......@@ -1029,9 +1029,9 @@ static BOOL MDI_AugmentFrameMenu( HWND frame, HWND hChild )
if(TWEAK_WineLook > WIN31_LOOK)
{
HICON hIcon = GetClassLongA(hChild, GCL_HICONSM);
HICON hIcon = (HICON)GetClassLongA(hChild, GCL_HICONSM);
if (!hIcon)
hIcon = GetClassLongA(hChild, GCL_HICON);
hIcon = (HICON)GetClassLongA(hChild, GCL_HICON);
if (hIcon)
{
HDC hMemDC;
......
......@@ -110,16 +110,20 @@ static HFONT MSGBOX_OnInit(HWND hwnd, LPMSGBOXPARAMSA lpmb)
/* Set the icon */
switch(lpmb->dwStyle & MB_ICONMASK) {
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;
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;
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;
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;
default:
/* 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 )
case HTCLIENT:
{
HCURSOR hCursor = GetClassLongA(hwnd, GCL_HCURSOR);
HCURSOR hCursor = (HCURSOR)GetClassLongA(hwnd, GCL_HCURSOR);
if(hCursor) {
SetCursor(hCursor);
return TRUE;
......
......@@ -3264,9 +3264,9 @@ DWORD WINAPI DragObject16( HWND16 hwndScope, HWND16 hWnd, UINT16 wObj,
MSG msg;
LPDRAGINFO16 lpDragInfo;
SEGPTR spDragInfo;
HCURSOR16 hOldCursor=0, hBummer=0;
HCURSOR hOldCursor=0, hBummer=0;
HGLOBAL16 hDragInfo = GlobalAlloc16( GMEM_SHARE | GMEM_ZEROINIT, 2*sizeof(DRAGINFO16));
HCURSOR16 hCurrentCursor = 0;
HCURSOR hCurrentCursor = 0;
HWND16 hCurrentWnd = 0;
lpDragInfo = (LPDRAGINFO16) GlobalLock16(hDragInfo);
......@@ -3280,7 +3280,7 @@ DWORD WINAPI DragObject16( HWND16 hwndScope, HWND16 hWnd, UINT16 wObj,
return 0L;
}
if(hCursor) hOldCursor = SetCursor(hCursor);
if(hCursor) hOldCursor = SetCursor(HCURSOR_32(hCursor));
lpDragInfo->hWnd = hWnd;
lpDragInfo->hScope = 0;
......@@ -3305,7 +3305,7 @@ DWORD WINAPI DragObject16( HWND16 hwndScope, HWND16 hWnd, UINT16 wObj,
TRACE_(msg)("lpDI->hScope = %04x\n",lpDragInfo->hScope);
if( DRAG_QueryUpdate16(WIN_Handle32(hwndScope), spDragInfo) > 0 )
hCurrentCursor = hCursor;
hCurrentCursor = HCURSOR_32(hCursor);
else
{
hCurrentCursor = hBummer;
......@@ -3337,7 +3337,7 @@ DWORD WINAPI DragObject16( HWND16 hwndScope, HWND16 hWnd, UINT16 wObj,
ReleaseCapture();
ShowCursor( FALSE );
if( hCursor ) SetCursor( hOldCursor );
if( hCursor ) SetCursor(hOldCursor);
if( hCurrentCursor != hBummer )
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