Commit 95591a6e authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

Some fixes for the compilation of the user dll with -DSTRICT.

parent 37d0fe62
...@@ -124,12 +124,12 @@ inline static void set_button_state( HWND hwnd, LONG state ) ...@@ -124,12 +124,12 @@ inline static void set_button_state( HWND hwnd, LONG state )
inline static HFONT get_button_font( HWND hwnd ) 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 ) 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 ) inline static UINT get_button_type( LONG window_style )
...@@ -308,9 +308,11 @@ static LRESULT WINAPI ButtonWndProc_common(HWND hWnd, UINT uMsg, ...@@ -308,9 +308,11 @@ static LRESULT WINAPI ButtonWndProc_common(HWND hWnd, UINT uMsg,
HBRUSH hbrush; HBRUSH hbrush;
RECT client, rc; 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 ? */ 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); GetClientRect(hWnd, &client);
rc = client; rc = client;
...@@ -331,12 +333,12 @@ static LRESULT WINAPI ButtonWndProc_common(HWND hWnd, UINT uMsg, ...@@ -331,12 +333,12 @@ static LRESULT WINAPI ButtonWndProc_common(HWND hWnd, UINT uMsg,
} }
case WM_SETFONT: case WM_SETFONT:
set_button_font( hWnd, wParam ); set_button_font( hWnd, (HFONT)wParam );
if (lParam) paint_button( hWnd, btn_type, ODA_DRAWENTIRE ); if (lParam) paint_button( hWnd, btn_type, ODA_DRAWENTIRE );
break; break;
case WM_GETFONT: case WM_GETFONT:
return get_button_font( hWnd ); return (LRESULT)get_button_font( hWnd );
case WM_SETFOCUS: case WM_SETFOCUS:
if ((btn_type == BS_RADIOBUTTON || btn_type == BS_AUTORADIOBUTTON) && (GetCapture() != hWnd) && if ((btn_type == BS_RADIOBUTTON || btn_type == BS_AUTORADIOBUTTON) && (GetCapture() != hWnd) &&
...@@ -394,9 +396,9 @@ static LRESULT WINAPI ButtonWndProc_common(HWND hWnd, UINT uMsg, ...@@ -394,9 +396,9 @@ static LRESULT WINAPI ButtonWndProc_common(HWND hWnd, UINT uMsg,
default: default:
return 0; return 0;
} }
oldHbitmap = SetWindowLongA( hWnd, HIMAGE_GWL_OFFSET, lParam ); oldHbitmap = (HBITMAP)SetWindowLongA( hWnd, HIMAGE_GWL_OFFSET, lParam );
InvalidateRect( hWnd, NULL, FALSE ); InvalidateRect( hWnd, NULL, FALSE );
return oldHbitmap; return (LRESULT)oldHbitmap;
case BM_GETIMAGE: case BM_GETIMAGE:
return GetWindowLongA( hWnd, HIMAGE_GWL_OFFSET ); return GetWindowLongA( hWnd, HIMAGE_GWL_OFFSET );
...@@ -716,7 +718,7 @@ static void PB_Paint( HWND hwnd, HDC hDC, UINT action ) ...@@ -716,7 +718,7 @@ static void PB_Paint( HWND hwnd, HDC hDC, UINT action )
/* Send WM_CTLCOLOR to allow changing the font (the colors are fixed) */ /* Send WM_CTLCOLOR to allow changing the font (the colors are fixed) */
if ((hFont = get_button_font( hwnd ))) SelectObject( hDC, hFont ); 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)); hOldPen = (HPEN)SelectObject(hDC, SYSCOLOR_GetPen(COLOR_WINDOWFRAME));
hOldBrush =(HBRUSH)SelectObject(hDC,GetSysColorBrush(COLOR_BTNFACE)); hOldBrush =(HBRUSH)SelectObject(hDC,GetSysColorBrush(COLOR_BTNFACE));
oldBkMode = SetBkMode(hDC, TRANSPARENT); oldBkMode = SetBkMode(hDC, TRANSPARENT);
...@@ -841,9 +843,11 @@ static void CB_Paint( HWND hwnd, HDC hDC, UINT action ) ...@@ -841,9 +843,11 @@ static void CB_Paint( HWND hwnd, HDC hDC, UINT action )
if ((hFont = get_button_font( hwnd ))) SelectObject( hDC, hFont ); 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 ? */ 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) if (style & BS_LEFTTEXT)
{ {
...@@ -989,9 +993,10 @@ static void GB_Paint( HWND hwnd, HDC hDC, UINT action ) ...@@ -989,9 +993,10 @@ static void GB_Paint( HWND hwnd, HDC hDC, UINT action )
if ((hFont = get_button_font( hwnd ))) SelectObject( hDC, hFont ); if ((hFont = get_button_font( hwnd ))) SelectObject( hDC, hFont );
/* GroupBox acts like static control, so it sends CTLCOLORSTATIC */ /* 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 ? */ 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); GetClientRect( hwnd, &rc);
if (TWEAK_WineLook == WIN31_LOOK) { if (TWEAK_WineLook == WIN31_LOOK) {
...@@ -1049,9 +1054,10 @@ static void UB_Paint( HWND hwnd, HDC hDC, UINT action ) ...@@ -1049,9 +1054,10 @@ static void UB_Paint( HWND hwnd, HDC hDC, UINT action )
if ((hFont = get_button_font( hwnd ))) SelectObject( hDC, hFont ); 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 ? */ 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 ); FillRect( hDC, &rc, hBrush );
if ((action == ODA_FOCUS) || if ((action == ODA_FOCUS) ||
...@@ -1098,4 +1104,3 @@ static void OB_Paint( HWND hwnd, HDC hDC, UINT action ) ...@@ -1098,4 +1104,3 @@ static void OB_Paint( HWND hwnd, HDC hDC, UINT action )
SendMessageW( GetParent(hwnd), WM_DRAWITEM, id, (LPARAM)&dis ); SendMessageW( GetParent(hwnd), WM_DRAWITEM, id, (LPARAM)&dis );
SelectClipRgn(hDC, clipRegion); SelectClipRgn(hDC, clipRegion);
} }
...@@ -691,8 +691,8 @@ static void LISTBOX_RepaintItem( HWND hwnd, LB_DESCR *descr, INT index, ...@@ -691,8 +691,8 @@ static void LISTBOX_RepaintItem( HWND hwnd, LB_DESCR *descr, INT index,
if (LISTBOX_GetItemRect( descr, index, &rect ) != 1) return; if (LISTBOX_GetItemRect( descr, index, &rect ) != 1) return;
if (!(hdc = GetDCEx( hwnd, 0, DCX_CACHE ))) return; if (!(hdc = GetDCEx( hwnd, 0, DCX_CACHE ))) return;
if (descr->font) oldFont = SelectObject( hdc, descr->font ); if (descr->font) oldFont = SelectObject( hdc, descr->font );
hbrush = SendMessageW( descr->owner, WM_CTLCOLORLISTBOX, hbrush = (HBRUSH)SendMessageW( descr->owner, WM_CTLCOLORLISTBOX,
hdc, (LPARAM)hwnd ); (WPARAM)hdc, (LPARAM)hwnd );
if (hbrush) oldBrush = SelectObject( hdc, hbrush ); if (hbrush) oldBrush = SelectObject( hdc, hbrush );
if (!IsWindowEnabled(hwnd)) if (!IsWindowEnabled(hwnd))
SetTextColor( hdc, GetSysColor( COLOR_GRAYTEXT ) ); SetTextColor( hdc, GetSysColor( COLOR_GRAYTEXT ) );
...@@ -1012,8 +1012,8 @@ static LRESULT LISTBOX_Paint( HWND hwnd, LB_DESCR *descr, HDC hdc ) ...@@ -1012,8 +1012,8 @@ static LRESULT LISTBOX_Paint( HWND hwnd, LB_DESCR *descr, HDC hdc )
} }
if (descr->font) oldFont = SelectObject( hdc, descr->font ); if (descr->font) oldFont = SelectObject( hdc, descr->font );
hbrush = SendMessageW( descr->owner, WM_CTLCOLORLISTBOX, hbrush = (HBRUSH)SendMessageW( descr->owner, WM_CTLCOLORLISTBOX,
hdc, (LPARAM)hwnd ); (WPARAM)hdc, (LPARAM)hwnd );
if (hbrush) oldBrush = SelectObject( hdc, hbrush ); if (hbrush) oldBrush = SelectObject( hdc, hbrush );
if (!IsWindowEnabled(hwnd)) SetTextColor( hdc, GetSysColor( COLOR_GRAYTEXT ) ); if (!IsWindowEnabled(hwnd)) SetTextColor( hdc, GetSysColor( COLOR_GRAYTEXT ) );
...@@ -2245,7 +2245,7 @@ static LRESULT LISTBOX_HandleKeyDown( HWND hwnd, LB_DESCR *descr, WPARAM wParam ...@@ -2245,7 +2245,7 @@ static LRESULT LISTBOX_HandleKeyDown( HWND hwnd, LB_DESCR *descr, WPARAM wParam
{ {
caret = SendMessageW( descr->owner, WM_VKEYTOITEM, caret = SendMessageW( descr->owner, WM_VKEYTOITEM,
MAKEWPARAM(LOWORD(wParam), descr->focus_item), MAKEWPARAM(LOWORD(wParam), descr->focus_item),
hwnd ); (LPARAM)hwnd );
if (caret == -2) return 0; if (caret == -2) return 0;
} }
if (caret == -1) switch(wParam) if (caret == -1) switch(wParam)
...@@ -2926,7 +2926,7 @@ static LRESULT WINAPI ListBoxWndProc_common( HWND hwnd, UINT msg, ...@@ -2926,7 +2926,7 @@ static LRESULT WINAPI ListBoxWndProc_common( HWND hwnd, UINT msg,
LISTBOX_UpdateSize( hwnd, descr ); LISTBOX_UpdateSize( hwnd, descr );
return 0; return 0;
case WM_GETFONT: case WM_GETFONT:
return descr->font; return (LRESULT)descr->font;
case WM_SETFONT: case WM_SETFONT:
LISTBOX_SetFont( hwnd, descr, (HFONT)wParam ); LISTBOX_SetFont( hwnd, descr, (HFONT)wParam );
if (lParam) InvalidateRect( hwnd, 0, TRUE ); if (lParam) InvalidateRect( hwnd, 0, TRUE );
...@@ -2987,7 +2987,7 @@ static LRESULT WINAPI ListBoxWndProc_common( HWND hwnd, UINT msg, ...@@ -2987,7 +2987,7 @@ static LRESULT WINAPI ListBoxWndProc_common( HWND hwnd, UINT msg,
if ((IS_OWNERDRAW(descr)) && !(descr->style & LBS_DISPLAYCHANGED)) if ((IS_OWNERDRAW(descr)) && !(descr->style & LBS_DISPLAYCHANGED))
{ {
RECT rect; RECT rect;
HBRUSH hbrush = SendMessageW( descr->owner, WM_CTLCOLORLISTBOX, HBRUSH hbrush = (HBRUSH)SendMessageW( descr->owner, WM_CTLCOLORLISTBOX,
wParam, (LPARAM)hwnd ); wParam, (LPARAM)hwnd );
TRACE("hbrush = %04x\n", hbrush); TRACE("hbrush = %04x\n", hbrush);
if(!hbrush) if(!hbrush)
......
...@@ -250,7 +250,7 @@ static HRESULT ICO_ExtractIconExW( ...@@ -250,7 +250,7 @@ static HRESULT ICO_ExtractIconExW(
UINT cxDesired, UINT cxDesired,
UINT cyDesired ) UINT cyDesired )
{ {
HGLOBAL hRet = E_FAIL; HRESULT hRet = E_FAIL;
LPBYTE pData; LPBYTE pData;
DWORD sig; DWORD sig;
HANDLE hFile; HANDLE hFile;
......
...@@ -1061,7 +1061,7 @@ static LRESULT handle_internal_message( HWND hwnd, UINT msg, WPARAM wparam, LPAR ...@@ -1061,7 +1061,7 @@ static LRESULT handle_internal_message( HWND hwnd, UINT msg, WPARAM wparam, LPAR
case WM_WINE_ENABLEWINDOW: case WM_WINE_ENABLEWINDOW:
return EnableWindow( hwnd, wparam ); return EnableWindow( hwnd, wparam );
case WM_WINE_SETACTIVEWINDOW: case WM_WINE_SETACTIVEWINDOW:
return SetActiveWindow( (HWND)wparam ); return (LRESULT)SetActiveWindow( (HWND)wparam );
default: default:
FIXME( "unknown internal message %x\n", msg ); FIXME( "unknown internal message %x\n", msg );
return 0; return 0;
......
...@@ -24,8 +24,9 @@ ...@@ -24,8 +24,9 @@
#include "win.h" #include "win.h"
#include "stackframe.h" #include "stackframe.h"
/* handle --> handle16 conversions */ /* handle <--> handle16 conversions */
#define HANDLE_16(h32) (LOWORD(h32)) #define HANDLE_16(h32) (LOWORD(h32))
#define HANDLE_32(h16) ((HANDLE)(ULONG_PTR)(h16))
static HWND16 hwndSysModal; static HWND16 hwndSysModal;
...@@ -131,7 +132,7 @@ HANDLE16 WINAPI GetProp16( HWND16 hwnd, LPCSTR str ) ...@@ -131,7 +132,7 @@ HANDLE16 WINAPI GetProp16( HWND16 hwnd, LPCSTR str )
*/ */
BOOL16 WINAPI SetProp16( HWND16 hwnd, LPCSTR str, HANDLE16 handle ) 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 @@ HDC16 WINAPI BeginPaint16( HWND16 hwnd, LPPAINTSTRUCT16 lps ) ...@@ -257,7 +258,7 @@ HDC16 WINAPI BeginPaint16( HWND16 hwnd, LPPAINTSTRUCT16 lps )
PAINTSTRUCT ps; PAINTSTRUCT ps;
BeginPaint( WIN_Handle32(hwnd), &ps ); BeginPaint( WIN_Handle32(hwnd), &ps );
lps->hdc = ps.hdc; lps->hdc = HDC_16(ps.hdc);
lps->fErase = ps.fErase; lps->fErase = ps.fErase;
lps->rcPaint.top = ps.rcPaint.top; lps->rcPaint.top = ps.rcPaint.top;
lps->rcPaint.left = ps.rcPaint.left; lps->rcPaint.left = ps.rcPaint.left;
...@@ -276,7 +277,7 @@ BOOL16 WINAPI EndPaint16( HWND16 hwnd, const PAINTSTRUCT16* lps ) ...@@ -276,7 +277,7 @@ BOOL16 WINAPI EndPaint16( HWND16 hwnd, const PAINTSTRUCT16* lps )
{ {
PAINTSTRUCT ps; PAINTSTRUCT ps;
ps.hdc = lps->hdc; ps.hdc = HDC_32(lps->hdc);
return EndPaint( WIN_Handle32(hwnd), &ps ); return EndPaint( WIN_Handle32(hwnd), &ps );
} }
...@@ -1153,7 +1154,7 @@ HWND16 WINAPI GetOpenClipboardWindow16(void) ...@@ -1153,7 +1154,7 @@ HWND16 WINAPI GetOpenClipboardWindow16(void)
*/ */
HDWP16 WINAPI BeginDeferWindowPos16( INT16 count ) HDWP16 WINAPI BeginDeferWindowPos16( INT16 count )
{ {
return BeginDeferWindowPos( count ); return HDWP_16(BeginDeferWindowPos( count ));
} }
......
...@@ -168,8 +168,8 @@ static LRESULT DEFDLG_Proc( HWND hwnd, UINT msg, WPARAM wParam, ...@@ -168,8 +168,8 @@ static LRESULT DEFDLG_Proc( HWND hwnd, UINT msg, WPARAM wParam,
{ {
case WM_ERASEBKGND: case WM_ERASEBKGND:
{ {
HBRUSH brush = SendMessageW( hwnd, WM_CTLCOLORDLG, wParam, (LPARAM)hwnd ); HBRUSH brush = (HBRUSH)SendMessageW( hwnd, WM_CTLCOLORDLG, wParam, (LPARAM)hwnd );
if (!brush) brush = DefWindowProcW( hwnd, WM_CTLCOLORDLG, wParam, (LPARAM)hwnd ); if (!brush) brush = (HBRUSH)DefWindowProcW( hwnd, WM_CTLCOLORDLG, wParam, (LPARAM)hwnd );
if (brush) if (brush)
{ {
RECT rect; RECT rect;
...@@ -252,7 +252,7 @@ static LRESULT DEFDLG_Proc( HWND hwnd, UINT msg, WPARAM wParam, ...@@ -252,7 +252,7 @@ static LRESULT DEFDLG_Proc( HWND hwnd, UINT msg, WPARAM wParam,
return DefWindowProcA( hwnd, msg, wParam, lParam ); return DefWindowProcA( hwnd, msg, wParam, lParam );
case WM_GETFONT: case WM_GETFONT:
return dlgInfo ? dlgInfo->hUserFont : 0; return dlgInfo ? (LRESULT)dlgInfo->hUserFont : 0;
case WM_CLOSE: case WM_CLOSE:
PostMessageA( hwnd, WM_COMMAND, IDCANCEL, PostMessageA( hwnd, WM_COMMAND, IDCANCEL,
......
...@@ -186,7 +186,7 @@ const struct builtin_class_descr MDICLIENT_builtin_class = ...@@ -186,7 +186,7 @@ const struct builtin_class_descr MDICLIENT_builtin_class =
MDIClientWndProcW, /* procW */ MDIClientWndProcW, /* procW */
sizeof(MDICLIENTINFO), /* extra */ sizeof(MDICLIENTINFO), /* extra */
IDC_ARROWA, /* cursor */ IDC_ARROWA, /* cursor */
COLOR_APPWORKSPACE+1 /* brush */ (HBRUSH)(COLOR_APPWORKSPACE+1) /* brush */
}; };
...@@ -439,7 +439,7 @@ static LRESULT MDISetMenu( HWND hwnd, HMENU hmenuFrame, ...@@ -439,7 +439,7 @@ static LRESULT MDISetMenu( HWND hwnd, HMENU hmenuFrame,
{ {
if( ci->hwndChildMaximized ) if( ci->hwndChildMaximized )
MDI_AugmentFrameMenu( GetParent(hwnd), ci->hwndChildMaximized ); MDI_AugmentFrameMenu( GetParent(hwnd), ci->hwndChildMaximized );
return oldFrameMenu; return (LRESULT)oldFrameMenu;
} }
} }
else else
...@@ -477,7 +477,7 @@ static LRESULT MDIRefreshMenu( HWND hwnd, HMENU hmenuFrame, ...@@ -477,7 +477,7 @@ static LRESULT MDIRefreshMenu( HWND hwnd, HMENU hmenuFrame,
FIXME("partially function stub\n"); FIXME("partially function stub\n");
return oldFrameMenu; return (LRESULT)oldFrameMenu;
} }
......
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