Some fixes for the compilation of the user dll with -DSTRICT.
diff --git a/controls/button.c b/controls/button.c
index 5d87b80..c0e7790 100644
--- a/controls/button.c
+++ b/controls/button.c
@@ -124,12 +124,12 @@
inline static HFONT get_button_font( HWND hwnd )
{
- return GetWindowLongA( hwnd, HFONT_GWL_OFFSET );
+ return (HFONT)GetWindowLongA( hwnd, HFONT_GWL_OFFSET );
}
inline static void set_button_font( HWND hwnd, HFONT font )
{
- SetWindowLongA( hwnd, HFONT_GWL_OFFSET, font );
+ SetWindowLongA( hwnd, HFONT_GWL_OFFSET, (LONG)font );
}
inline static UINT get_button_type( LONG window_style )
@@ -308,9 +308,11 @@
HBRUSH hbrush;
RECT client, rc;
- hbrush = SendMessageW(GetParent(hWnd), WM_CTLCOLORSTATIC, hdc, (LPARAM)hWnd);
+ hbrush = (HBRUSH)SendMessageW(GetParent(hWnd), WM_CTLCOLORSTATIC,
+ (WPARAM)hdc, (LPARAM)hWnd);
if (!hbrush) /* did the app forget to call DefWindowProc ? */
- hbrush = DefWindowProcW(GetParent(hWnd), WM_CTLCOLORSTATIC, hdc, (LPARAM)hWnd);
+ hbrush = (HBRUSH)DefWindowProcW(GetParent(hWnd), WM_CTLCOLORSTATIC,
+ (WPARAM)hdc, (LPARAM)hWnd);
GetClientRect(hWnd, &client);
rc = client;
@@ -331,12 +333,12 @@
}
case WM_SETFONT:
- set_button_font( hWnd, wParam );
+ set_button_font( hWnd, (HFONT)wParam );
if (lParam) paint_button( hWnd, btn_type, ODA_DRAWENTIRE );
break;
case WM_GETFONT:
- return get_button_font( hWnd );
+ return (LRESULT)get_button_font( hWnd );
case WM_SETFOCUS:
if ((btn_type == BS_RADIOBUTTON || btn_type == BS_AUTORADIOBUTTON) && (GetCapture() != hWnd) &&
@@ -394,9 +396,9 @@
default:
return 0;
}
- oldHbitmap = SetWindowLongA( hWnd, HIMAGE_GWL_OFFSET, lParam );
+ oldHbitmap = (HBITMAP)SetWindowLongA( hWnd, HIMAGE_GWL_OFFSET, lParam );
InvalidateRect( hWnd, NULL, FALSE );
- return oldHbitmap;
+ return (LRESULT)oldHbitmap;
case BM_GETIMAGE:
return GetWindowLongA( hWnd, HIMAGE_GWL_OFFSET );
@@ -716,7 +718,7 @@
/* Send WM_CTLCOLOR to allow changing the font (the colors are fixed) */
if ((hFont = get_button_font( hwnd ))) SelectObject( hDC, hFont );
- SendMessageW( GetParent(hwnd), WM_CTLCOLORBTN, hDC, (LPARAM)hwnd );
+ SendMessageW( GetParent(hwnd), WM_CTLCOLORBTN, (WPARAM)hDC, (LPARAM)hwnd );
hOldPen = (HPEN)SelectObject(hDC, SYSCOLOR_GetPen(COLOR_WINDOWFRAME));
hOldBrush =(HBRUSH)SelectObject(hDC,GetSysColorBrush(COLOR_BTNFACE));
oldBkMode = SetBkMode(hDC, TRANSPARENT);
@@ -841,9 +843,11 @@
if ((hFont = get_button_font( hwnd ))) SelectObject( hDC, hFont );
- hBrush = SendMessageW( GetParent(hwnd), WM_CTLCOLORSTATIC, hDC, (LPARAM)hwnd );
+ hBrush = (HBRUSH)SendMessageW(GetParent(hwnd), WM_CTLCOLORSTATIC,
+ (WPARAM)hDC, (LPARAM)hwnd);
if (!hBrush) /* did the app forget to call defwindowproc ? */
- hBrush = DefWindowProcW( GetParent(hwnd), WM_CTLCOLORSTATIC, hDC, (LPARAM)hwnd );
+ hBrush = (HBRUSH)DefWindowProcW(GetParent(hwnd), WM_CTLCOLORSTATIC,
+ (WPARAM)hDC, (LPARAM)hwnd );
if (style & BS_LEFTTEXT)
{
@@ -989,9 +993,10 @@
if ((hFont = get_button_font( hwnd ))) SelectObject( hDC, hFont );
/* GroupBox acts like static control, so it sends CTLCOLORSTATIC */
- hbr = SendMessageW( GetParent(hwnd), WM_CTLCOLORSTATIC, hDC, (LPARAM)hwnd );
+ hbr = (HBRUSH)SendMessageW(GetParent(hwnd), WM_CTLCOLORSTATIC, (WPARAM)hDC, (LPARAM)hwnd);
if (!hbr) /* did the app forget to call defwindowproc ? */
- hbr = DefWindowProcW( GetParent(hwnd), WM_CTLCOLORSTATIC, hDC, (LPARAM)hwnd );
+ hbr = (HBRUSH)DefWindowProcW(GetParent(hwnd), WM_CTLCOLORSTATIC,
+ (WPARAM)hDC, (LPARAM)hwnd);
GetClientRect( hwnd, &rc);
if (TWEAK_WineLook == WIN31_LOOK) {
@@ -1049,9 +1054,10 @@
if ((hFont = get_button_font( hwnd ))) SelectObject( hDC, hFont );
- hBrush = SendMessageW( GetParent(hwnd), WM_CTLCOLORBTN, hDC, (LPARAM)hwnd );
+ hBrush = (HBRUSH)SendMessageW(GetParent(hwnd), WM_CTLCOLORBTN, (WPARAM)hDC, (LPARAM)hwnd);
if (!hBrush) /* did the app forget to call defwindowproc ? */
- hBrush = DefWindowProcW( GetParent(hwnd), WM_CTLCOLORBTN, hDC, (LPARAM)hwnd );
+ hBrush = (HBRUSH)DefWindowProcW(GetParent(hwnd), WM_CTLCOLORBTN,
+ (WPARAM)hDC, (LPARAM)hwnd);
FillRect( hDC, &rc, hBrush );
if ((action == ODA_FOCUS) ||
@@ -1098,4 +1104,3 @@
SendMessageW( GetParent(hwnd), WM_DRAWITEM, id, (LPARAM)&dis );
SelectClipRgn(hDC, clipRegion);
}
-
diff --git a/controls/listbox.c b/controls/listbox.c
index fd22195..23d70da 100644
--- a/controls/listbox.c
+++ b/controls/listbox.c
@@ -691,8 +691,8 @@
if (LISTBOX_GetItemRect( descr, index, &rect ) != 1) return;
if (!(hdc = GetDCEx( hwnd, 0, DCX_CACHE ))) return;
if (descr->font) oldFont = SelectObject( hdc, descr->font );
- hbrush = SendMessageW( descr->owner, WM_CTLCOLORLISTBOX,
- hdc, (LPARAM)hwnd );
+ hbrush = (HBRUSH)SendMessageW( descr->owner, WM_CTLCOLORLISTBOX,
+ (WPARAM)hdc, (LPARAM)hwnd );
if (hbrush) oldBrush = SelectObject( hdc, hbrush );
if (!IsWindowEnabled(hwnd))
SetTextColor( hdc, GetSysColor( COLOR_GRAYTEXT ) );
@@ -1012,8 +1012,8 @@
}
if (descr->font) oldFont = SelectObject( hdc, descr->font );
- hbrush = SendMessageW( descr->owner, WM_CTLCOLORLISTBOX,
- hdc, (LPARAM)hwnd );
+ hbrush = (HBRUSH)SendMessageW( descr->owner, WM_CTLCOLORLISTBOX,
+ (WPARAM)hdc, (LPARAM)hwnd );
if (hbrush) oldBrush = SelectObject( hdc, hbrush );
if (!IsWindowEnabled(hwnd)) SetTextColor( hdc, GetSysColor( COLOR_GRAYTEXT ) );
@@ -2245,7 +2245,7 @@
{
caret = SendMessageW( descr->owner, WM_VKEYTOITEM,
MAKEWPARAM(LOWORD(wParam), descr->focus_item),
- hwnd );
+ (LPARAM)hwnd );
if (caret == -2) return 0;
}
if (caret == -1) switch(wParam)
@@ -2926,7 +2926,7 @@
LISTBOX_UpdateSize( hwnd, descr );
return 0;
case WM_GETFONT:
- return descr->font;
+ return (LRESULT)descr->font;
case WM_SETFONT:
LISTBOX_SetFont( hwnd, descr, (HFONT)wParam );
if (lParam) InvalidateRect( hwnd, 0, TRUE );
@@ -2987,7 +2987,7 @@
if ((IS_OWNERDRAW(descr)) && !(descr->style & LBS_DISPLAYCHANGED))
{
RECT rect;
- HBRUSH hbrush = SendMessageW( descr->owner, WM_CTLCOLORLISTBOX,
+ HBRUSH hbrush = (HBRUSH)SendMessageW( descr->owner, WM_CTLCOLORLISTBOX,
wParam, (LPARAM)hwnd );
TRACE("hbrush = %04x\n", hbrush);
if(!hbrush)
diff --git a/dlls/user/exticon.c b/dlls/user/exticon.c
index 647729d..5564e28 100644
--- a/dlls/user/exticon.c
+++ b/dlls/user/exticon.c
@@ -250,7 +250,7 @@
UINT cxDesired,
UINT cyDesired )
{
- HGLOBAL hRet = E_FAIL;
+ HRESULT hRet = E_FAIL;
LPBYTE pData;
DWORD sig;
HANDLE hFile;
diff --git a/dlls/user/message.c b/dlls/user/message.c
index 1b43326..1bcaf07 100644
--- a/dlls/user/message.c
+++ b/dlls/user/message.c
@@ -1061,7 +1061,7 @@
case WM_WINE_ENABLEWINDOW:
return EnableWindow( hwnd, wparam );
case WM_WINE_SETACTIVEWINDOW:
- return SetActiveWindow( (HWND)wparam );
+ return (LRESULT)SetActiveWindow( (HWND)wparam );
default:
FIXME( "unknown internal message %x\n", msg );
return 0;
diff --git a/dlls/user/wnd16.c b/dlls/user/wnd16.c
index 7ff45a2..e065997 100644
--- a/dlls/user/wnd16.c
+++ b/dlls/user/wnd16.c
@@ -24,8 +24,9 @@
#include "win.h"
#include "stackframe.h"
-/* handle --> handle16 conversions */
+/* handle <--> handle16 conversions */
#define HANDLE_16(h32) (LOWORD(h32))
+#define HANDLE_32(h16) ((HANDLE)(ULONG_PTR)(h16))
static HWND16 hwndSysModal;
@@ -131,7 +132,7 @@
*/
BOOL16 WINAPI SetProp16( HWND16 hwnd, LPCSTR str, HANDLE16 handle )
{
- return SetPropA( WIN_Handle32(hwnd), str, handle );
+ return SetPropA( WIN_Handle32(hwnd), str, HANDLE_32(handle) );
}
@@ -257,7 +258,7 @@
PAINTSTRUCT ps;
BeginPaint( WIN_Handle32(hwnd), &ps );
- lps->hdc = ps.hdc;
+ lps->hdc = HDC_16(ps.hdc);
lps->fErase = ps.fErase;
lps->rcPaint.top = ps.rcPaint.top;
lps->rcPaint.left = ps.rcPaint.left;
@@ -276,7 +277,7 @@
{
PAINTSTRUCT ps;
- ps.hdc = lps->hdc;
+ ps.hdc = HDC_32(lps->hdc);
return EndPaint( WIN_Handle32(hwnd), &ps );
}
@@ -1153,7 +1154,7 @@
*/
HDWP16 WINAPI BeginDeferWindowPos16( INT16 count )
{
- return BeginDeferWindowPos( count );
+ return HDWP_16(BeginDeferWindowPos( count ));
}
diff --git a/windows/defdlg.c b/windows/defdlg.c
index a10f649..e1a7865 100644
--- a/windows/defdlg.c
+++ b/windows/defdlg.c
@@ -168,8 +168,8 @@
{
case WM_ERASEBKGND:
{
- HBRUSH brush = SendMessageW( hwnd, WM_CTLCOLORDLG, wParam, (LPARAM)hwnd );
- if (!brush) brush = DefWindowProcW( hwnd, WM_CTLCOLORDLG, wParam, (LPARAM)hwnd );
+ HBRUSH brush = (HBRUSH)SendMessageW( hwnd, WM_CTLCOLORDLG, wParam, (LPARAM)hwnd );
+ if (!brush) brush = (HBRUSH)DefWindowProcW( hwnd, WM_CTLCOLORDLG, wParam, (LPARAM)hwnd );
if (brush)
{
RECT rect;
@@ -252,7 +252,7 @@
return DefWindowProcA( hwnd, msg, wParam, lParam );
case WM_GETFONT:
- return dlgInfo ? dlgInfo->hUserFont : 0;
+ return dlgInfo ? (LRESULT)dlgInfo->hUserFont : 0;
case WM_CLOSE:
PostMessageA( hwnd, WM_COMMAND, IDCANCEL,
diff --git a/windows/mdi.c b/windows/mdi.c
index ad9d058..eb713af 100644
--- a/windows/mdi.c
+++ b/windows/mdi.c
@@ -186,7 +186,7 @@
MDIClientWndProcW, /* procW */
sizeof(MDICLIENTINFO), /* extra */
IDC_ARROWA, /* cursor */
- COLOR_APPWORKSPACE+1 /* brush */
+ (HBRUSH)(COLOR_APPWORKSPACE+1) /* brush */
};
@@ -439,7 +439,7 @@
{
if( ci->hwndChildMaximized )
MDI_AugmentFrameMenu( GetParent(hwnd), ci->hwndChildMaximized );
- return oldFrameMenu;
+ return (LRESULT)oldFrameMenu;
}
}
else
@@ -477,7 +477,7 @@
FIXME("partially function stub\n");
- return oldFrameMenu;
+ return (LRESULT)oldFrameMenu;
}