Removed the A/W constants for builtin cursors, icons and resource
types since they don't exist on Windows, and added typecasts
everywhere instead.
diff --git a/windows/class.c b/windows/class.c
index c4e7400..05f6ee4 100644
--- a/windows/class.c
+++ b/windows/class.c
@@ -475,7 +475,7 @@
return 0;
}
- classPtr->hCursor = LoadCursorA( 0, descr->cursor );
+ classPtr->hCursor = LoadCursorA( 0, (LPSTR)descr->cursor );
classPtr->hbrBackground = descr->brush;
if (descr->procA) WINPROC_SetProc( &classPtr->winprocA, descr->procA,
diff --git a/windows/cursoricon.c b/windows/cursoricon.c
index 488407d..fee1818 100644
--- a/windows/cursoricon.c
+++ b/windows/cursoricon.c
@@ -772,7 +772,7 @@
/* Get directory resource ID */
if (!(hRsrc = FindResourceW( hInstance, name,
- fCursor ? RT_GROUP_CURSORW : RT_GROUP_ICONW )))
+ (LPWSTR)(fCursor ? RT_GROUP_CURSOR : RT_GROUP_ICON) )))
return 0;
hGroupRsrc = hRsrc;
@@ -794,7 +794,7 @@
/* Load the resource */
if (!(hRsrc = FindResourceW(hInstance,MAKEINTRESOURCEW(wResId),
- fCursor ? RT_CURSORW : RT_ICONW ))) return 0;
+ (LPWSTR)(fCursor ? RT_CURSOR : RT_ICON) ))) return 0;
/* If shared icon, check whether it was already loaded */
if ( (loadflags & LR_SHARED)
@@ -953,7 +953,7 @@
/* Get the Best Fit
*/
if (!(hRsrc = FindResourceW(pIconCache->hModule ,
- MAKEINTRESOURCEW(wResId), bIsIcon ? RT_ICONW : RT_CURSORW)))
+ MAKEINTRESOURCEW(wResId), (LPWSTR)(bIsIcon ? RT_ICON : RT_CURSOR))))
{
return 0;
}
@@ -1478,10 +1478,10 @@
switch(resType)
{
- case RT_CURSOR16:
+ case RT_CURSOR:
return (WORD)LookupIconIdFromDirectoryEx16( lpDir, FALSE,
GetSystemMetrics(SM_CXCURSOR), GetSystemMetrics(SM_CYCURSOR), LR_MONOCHROME );
- case RT_ICON16:
+ case RT_ICON:
return (WORD)LookupIconIdFromDirectoryEx16( lpDir, TRUE,
GetSystemMetrics(SM_CXICON), GetSystemMetrics(SM_CYICON), 0 );
default:
@@ -1943,7 +1943,7 @@
if (HIWORD(name)) return 0;
if (!(instance = GetModuleHandleA("user32.dll"))) return 0;
}
- if (!(hRsrc = FindResourceW( instance, name, RT_BITMAPW ))) return 0;
+ if (!(hRsrc = FindResourceW( instance, name, (LPWSTR)RT_BITMAP ))) return 0;
if (!(handle = LoadResource( instance, hRsrc ))) return 0;
if ((info = (BITMAPINFO *)LockResource( handle )) == NULL) return 0;
diff --git a/windows/defwnd.c b/windows/defwnd.c
index be2864c..e5a98c1 100644
--- a/windows/defwnd.c
+++ b/windows/defwnd.c
@@ -627,7 +627,7 @@
for(len=1; len<64; len++)
if((hIcon = LoadIconW(instance, MAKEINTRESOURCEW(len))))
return (LRESULT)hIcon;
- return (LRESULT)LoadIconW(0, IDI_APPLICATIONW);
+ return (LRESULT)LoadIconW(0, (LPWSTR)IDI_APPLICATION);
}
break;
diff --git a/windows/dialog.c b/windows/dialog.c
index 3ce861e..5abdc8c 100644
--- a/windows/dialog.c
+++ b/windows/dialog.c
@@ -101,7 +101,7 @@
DefDlgProcA, /* procA */
DefDlgProcW, /* procW */
DLGWINDOWEXTRA, /* extra */
- IDC_ARROWA, /* cursor */
+ IDC_ARROW, /* cursor */
0 /* brush */
};
@@ -704,7 +704,7 @@
HRSRC hrsrc;
LPCDLGTEMPLATEA ptr;
- if (!(hrsrc = FindResourceA( hInst, name, RT_DIALOGA ))) return 0;
+ if (!(hrsrc = FindResourceA( hInst, name, (LPSTR)RT_DIALOG ))) return 0;
if (!(ptr = (LPCDLGTEMPLATEA)LoadResource(hInst, hrsrc))) return 0;
return CreateDialogIndirectParamA( hInst, ptr, owner, dlgProc, param );
}
@@ -719,7 +719,7 @@
HRSRC hrsrc;
LPCDLGTEMPLATEA ptr;
- if (!(hrsrc = FindResourceW( hInst, name, RT_DIALOGW ))) return 0;
+ if (!(hrsrc = FindResourceW( hInst, name, (LPWSTR)RT_DIALOG ))) return 0;
if (!(ptr = (LPCDLGTEMPLATEW)LoadResource(hInst, hrsrc))) return 0;
return CreateDialogIndirectParamW( hInst, ptr, owner, dlgProc, param );
}
@@ -808,7 +808,7 @@
HRSRC hrsrc;
LPCDLGTEMPLATEA ptr;
- if (!(hrsrc = FindResourceA( hInst, name, RT_DIALOGA ))) return 0;
+ if (!(hrsrc = FindResourceA( hInst, name, (LPSTR)RT_DIALOG ))) return 0;
if (!(ptr = (LPCDLGTEMPLATEA)LoadResource(hInst, hrsrc))) return 0;
hwnd = DIALOG_CreateIndirect( hInst, ptr, owner, dlgProc, param, FALSE, TRUE );
if (hwnd) return DIALOG_DoDialogBox( hwnd, owner );
@@ -826,7 +826,7 @@
HRSRC hrsrc;
LPCDLGTEMPLATEW ptr;
- if (!(hrsrc = FindResourceW( hInst, name, RT_DIALOGW ))) return 0;
+ if (!(hrsrc = FindResourceW( hInst, name, (LPWSTR)RT_DIALOG ))) return 0;
if (!(ptr = (LPCDLGTEMPLATEW)LoadResource(hInst, hrsrc))) return 0;
hwnd = DIALOG_CreateIndirect( hInst, ptr, owner, dlgProc, param, TRUE, TRUE );
if (hwnd) return DIALOG_DoDialogBox( hwnd, owner );
diff --git a/windows/mdi.c b/windows/mdi.c
index 7622db1..a30a558 100644
--- a/windows/mdi.c
+++ b/windows/mdi.c
@@ -186,7 +186,7 @@
MDIClientWndProcA, /* procA */
MDIClientWndProcW, /* procW */
sizeof(MDICLIENTINFO), /* extra */
- IDC_ARROWA, /* cursor */
+ IDC_ARROW, /* cursor */
(HBRUSH)(COLOR_APPWORKSPACE+1) /* brush */
};
@@ -2208,7 +2208,7 @@
HRSRC hRes;
HANDLE hDlgTmpl;
- hRes = FindResourceA(GetModuleHandleA("USER32"), "MDI_MOREWINDOWS", RT_DIALOGA);
+ hRes = FindResourceA(GetModuleHandleA("USER32"), "MDI_MOREWINDOWS", (LPSTR)RT_DIALOG);
if (hRes == 0)
return 0;
diff --git a/windows/msgbox.c b/windows/msgbox.c
index 54eb740..f0b17418d 100644
--- a/windows/msgbox.c
+++ b/windows/msgbox.c
@@ -124,19 +124,19 @@
switch(lpmb->dwStyle & MB_ICONMASK) {
case MB_ICONEXCLAMATION:
SendDlgItemMessageW(hwnd, stc1, STM_SETICON,
- (WPARAM)LoadIconW(0, IDI_EXCLAMATIONW), 0);
+ (WPARAM)LoadIconW(0, (LPWSTR)IDI_EXCLAMATION), 0);
break;
case MB_ICONQUESTION:
SendDlgItemMessageW(hwnd, stc1, STM_SETICON,
- (WPARAM)LoadIconW(0, IDI_QUESTIONW), 0);
+ (WPARAM)LoadIconW(0, (LPWSTR)IDI_QUESTION), 0);
break;
case MB_ICONASTERISK:
SendDlgItemMessageW(hwnd, stc1, STM_SETICON,
- (WPARAM)LoadIconW(0, IDI_ASTERISKW), 0);
+ (WPARAM)LoadIconW(0, (LPWSTR)IDI_ASTERISK), 0);
break;
case MB_ICONHAND:
SendDlgItemMessageW(hwnd, stc1, STM_SETICON,
- (WPARAM)LoadIconW(0, IDI_HANDW), 0);
+ (WPARAM)LoadIconW(0, (LPWSTR)IDI_HAND), 0);
break;
case MB_USERICON:
SendDlgItemMessageW(hwnd, stc1, STM_SETICON,
@@ -448,7 +448,7 @@
static const WCHAR msg_box_res_nameW[] = { 'M','S','G','B','O','X',0 };
hUser32 = GetModuleHandleW(user32_res_nameW);
- if (!(hRes = FindResourceExW(hUser32, RT_DIALOGW, msg_box_res_nameW, msgbox->dwLanguageId)))
+ if (!(hRes = FindResourceExW(hUser32, (LPWSTR)RT_DIALOG, msg_box_res_nameW, msgbox->dwLanguageId)))
return 0;
if (!(tmplate = (LPVOID)LoadResource(hUser32, hRes)))
return 0;
diff --git a/windows/nonclient.c b/windows/nonclient.c
index cc9ee27..8b45a7e 100644
--- a/windows/nonclient.c
+++ b/windows/nonclient.c
@@ -248,7 +248,7 @@
* get the default one.
*/
if (!hIcon && (GetWindowLongA( hwnd, GWL_STYLE ) & DS_MODALFRAME))
- hIcon = LoadImageA(0, IDI_WINLOGOA, IMAGE_ICON, 0, 0, LR_DEFAULTCOLOR);
+ hIcon = LoadImageA(0, (LPSTR)IDI_WINLOGO, IMAGE_ICON, 0, 0, LR_DEFAULTCOLOR);
return hIcon;
}
@@ -1739,23 +1739,23 @@
case HTLEFT:
case HTRIGHT:
- return (LONG)SetCursor( LoadCursorA( 0, IDC_SIZEWEA ) );
+ return (LONG)SetCursor( LoadCursorA( 0, (LPSTR)IDC_SIZEWE ) );
case HTTOP:
case HTBOTTOM:
- return (LONG)SetCursor( LoadCursorA( 0, IDC_SIZENSA ) );
+ return (LONG)SetCursor( LoadCursorA( 0, (LPSTR)IDC_SIZENS ) );
case HTTOPLEFT:
case HTBOTTOMRIGHT:
- return (LONG)SetCursor( LoadCursorA( 0, IDC_SIZENWSEA ) );
+ return (LONG)SetCursor( LoadCursorA( 0, (LPSTR)IDC_SIZENWSE ) );
case HTTOPRIGHT:
case HTBOTTOMLEFT:
- return (LONG)SetCursor( LoadCursorA( 0, IDC_SIZENESWA ) );
+ return (LONG)SetCursor( LoadCursorA( 0, (LPSTR)IDC_SIZENESW ) );
}
/* Default cursor: arrow */
- return (LONG)SetCursor( LoadCursorA( 0, IDC_ARROWA ) );
+ return (LONG)SetCursor( LoadCursorA( 0, (LPSTR)IDC_ARROW ) );
}
/***********************************************************************