- Rename WIN_Handle16 to HWDN_16 and make it a macro.
- Prepare user.dll for the change of HWND to a void*.
diff --git a/controls/listbox.c b/controls/listbox.c
index 4379645..3606508 100644
--- a/controls/listbox.c
+++ b/controls/listbox.c
@@ -32,6 +32,7 @@
#include "user.h"
#include "controls.h"
#include "wine/debug.h"
+#include "win.h"
WINE_DEFAULT_DEBUG_CHANNEL(listbox);
WINE_DECLARE_DEBUG_CHANNEL(combo);
@@ -106,7 +107,7 @@
#define SEND_NOTIFICATION(hwnd,descr,code) \
(SendMessageW( (descr)->owner, WM_COMMAND, \
- MAKEWPARAM( GetWindowLongA((hwnd),GWL_ID), (code)), (hwnd) ))
+ MAKEWPARAM( GetWindowLongA((hwnd),GWL_ID), (code)), (LPARAM)(hwnd) ))
#define ISWIN31 (LOWORD(GetVersion()) == 0x0a03)
@@ -2351,7 +2352,7 @@
{
caret = SendMessageW( descr->owner, WM_CHARTOITEM,
MAKEWPARAM(charW, descr->focus_item),
- hwnd );
+ (LPARAM)hwnd );
if (caret == -2) return 0;
}
if (caret == -1)
@@ -3012,7 +3013,7 @@
LPDRAGINFO16 dragInfo = MapSL( lParam );
dragInfo->l = LISTBOX_GetItemFromPoint( descr, dragInfo->pt.x,
dragInfo->pt.y );
- return SendMessage16( descr->owner, msg, wParam, lParam );
+ return SendMessage16( HWND_16(descr->owner), msg, wParam, lParam );
}
break;
diff --git a/controls/static.c b/controls/static.c
index cce770c..52251f4 100644
--- a/controls/static.c
+++ b/controls/static.c
@@ -417,7 +417,7 @@
dis.itemData = 0;
GetClientRect( hwnd, &dis.rcItem );
- SendMessageW( GetParent(hwnd), WM_CTLCOLORSTATIC, hdc, hwnd );
+ SendMessageW( GetParent(hwnd), WM_CTLCOLORSTATIC, hdc, (LPARAM)hwnd );
SendMessageW( GetParent(hwnd), WM_DRAWITEM, id, (LPARAM)&dis );
}
@@ -465,9 +465,11 @@
if ((style & SS_NOPREFIX) || ((style & SS_TYPEMASK) != SS_SIMPLE))
{
- hBrush = SendMessageW( GetParent(hwnd), WM_CTLCOLORSTATIC, hdc, hwnd );
+ hBrush = SendMessageW( GetParent(hwnd), WM_CTLCOLORSTATIC, hdc,
+ (LPARAM)hwnd );
if (!hBrush) /* did the app forget to call defwindowproc ? */
- hBrush = DefWindowProcW(GetParent(hwnd), WM_CTLCOLORSTATIC, hdc, hwnd);
+ hBrush = DefWindowProcW(GetParent(hwnd), WM_CTLCOLORSTATIC, hdc,
+ (LPARAM)hwnd);
FillRect( hdc, &rc, hBrush );
}
if (!IsWindowEnabled(hwnd)) SetTextColor(hdc, GetSysColor(COLOR_GRAYTEXT));
@@ -526,7 +528,7 @@
HICON hIcon;
GetClientRect( hwnd, &rc );
- hbrush = SendMessageW( GetParent(hwnd), WM_CTLCOLORSTATIC, hdc, hwnd );
+ hbrush = SendMessageW( GetParent(hwnd), WM_CTLCOLORSTATIC, hdc, (LPARAM)hwnd );
FillRect( hdc, &rc, hbrush );
if ((hIcon = GetWindowLongA( hwnd, HICON_GWL_OFFSET )))
DrawIcon( hdc, rc.left, rc.top, hIcon );
@@ -541,7 +543,7 @@
HBITMAP oldbitmap;
GetClientRect( hwnd, &rc );
- hbrush = SendMessageW( GetParent(hwnd), WM_CTLCOLORSTATIC, hdc, hwnd );
+ hbrush = SendMessageW( GetParent(hwnd), WM_CTLCOLORSTATIC, hdc, (LPARAM)hwnd );
FillRect( hdc, &rc, hbrush );
if ((hIcon = GetWindowLongA( hwnd, HICON_GWL_OFFSET )))
diff --git a/dlls/user/dde/client.c b/dlls/user/dde/client.c
index 26db172..adb3e07 100644
--- a/dlls/user/dde/client.c
+++ b/dlls/user/dde/client.c
@@ -355,7 +355,7 @@
UINT uiLo, uiHi;
HSZ hsz;
- if (msg->message != WM_DDE_ACK || WIN_GetFullHandle(msg->wParam) != pConv->hwndServer)
+ if (msg->message != WM_DDE_ACK || WIN_GetFullHandle((HWND)msg->wParam) != pConv->hwndServer)
{
return WDML_QS_PASS;
}
@@ -440,7 +440,7 @@
UINT uiLo, uiHi;
HSZ hsz;
- if (msg->message != WM_DDE_ACK || WIN_GetFullHandle(msg->wParam) != pConv->hwndServer)
+ if (msg->message != WM_DDE_ACK || WIN_GetFullHandle((HWND)msg->wParam) != pConv->hwndServer)
{
return WDML_QS_PASS;
}
@@ -512,7 +512,7 @@
UINT uiLo, uiHi;
HSZ hsz;
- if (WIN_GetFullHandle(msg->wParam) != pConv->hwndServer)
+ if (WIN_GetFullHandle((HWND)msg->wParam) != pConv->hwndServer)
return WDML_QS_PASS;
switch (msg->message)
@@ -674,7 +674,7 @@
DDEACK ddeAck;
UINT uiLo, uiHi;
- if (msg->message != WM_DDE_ACK || WIN_GetFullHandle(msg->wParam) != pConv->hwndServer)
+ if (msg->message != WM_DDE_ACK || WIN_GetFullHandle((HWND)msg->wParam) != pConv->hwndServer)
{
return WDML_QS_PASS;
}
@@ -751,7 +751,7 @@
UINT uiLo, uiHi;
HSZ hsz;
- if (msg->message != WM_DDE_ACK && WIN_GetFullHandle(msg->wParam) != pConv->hwndServer)
+ if (msg->message != WM_DDE_ACK && WIN_GetFullHandle((HWND)msg->wParam) != pConv->hwndServer)
{
return WDML_QS_PASS;
}
@@ -804,7 +804,7 @@
return WDML_QS_SWALLOWED;
}
- if (WIN_GetFullHandle(msg->wParam) != pConv->hwndServer)
+ if (WIN_GetFullHandle((HWND)msg->wParam) != pConv->hwndServer)
{
FIXME("hmmm shouldn't happen\n");
return WDML_QS_PASS;
@@ -891,7 +891,7 @@
*/
static WDML_QUEUE_STATE WDML_HandleIncomingTerminate(WDML_CONV* pConv, MSG* msg, HDDEDATA* hdd)
{
- if (pConv->hwndServer != WIN_GetFullHandle(msg->wParam))
+ if (pConv->hwndServer != WIN_GetFullHandle((HWND)msg->wParam))
return WDML_QS_PASS;
pConv->wStatus |= ST_TERMINATED;
diff --git a/dlls/user/msg16.c b/dlls/user/msg16.c
index 3827625..83bf72f 100644
--- a/dlls/user/msg16.c
+++ b/dlls/user/msg16.c
@@ -166,7 +166,7 @@
MsgWaitForMultipleObjectsEx( 0, NULL, 1, 0, MWMO_ALERTABLE );
if (!PeekMessageW( &msg, hwnd, first, last, flags )) return FALSE;
- msg16->msg.hwnd = WIN_Handle16( msg.hwnd );
+ msg16->msg.hwnd = HWND_16( msg.hwnd );
msg16->msg.lParam = msg.lParam;
msg16->msg.time = msg.time;
msg16->msg.pt.x = (INT16)msg.pt.x;
@@ -203,7 +203,7 @@
if(USER16_AlertableWait)
MsgWaitForMultipleObjectsEx( 0, NULL, INFINITE, 0, MWMO_ALERTABLE );
GetMessageW( &msg, hwnd, first, last );
- msg16->msg.hwnd = WIN_Handle16( msg.hwnd );
+ msg16->msg.hwnd = HWND_16( msg.hwnd );
msg16->msg.lParam = msg.lParam;
msg16->msg.time = msg.time;
msg16->msg.pt.x = (INT16)msg.pt.x;
@@ -281,14 +281,14 @@
}
}
- if (!(wndPtr = WIN_GetPtr( msg->hwnd )))
+ if (!(wndPtr = WIN_GetPtr( HWND_32(msg->hwnd) )))
{
if (msg->hwnd) SetLastError( ERROR_INVALID_WINDOW_HANDLE );
return 0;
}
if (wndPtr == WND_OTHER_PROCESS)
{
- if (IsWindow( msg->hwnd ))
+ if (IsWindow16( msg->hwnd ))
ERR( "cannot dispatch msg to other process window %x\n", msg->hwnd );
SetLastError( ERROR_INVALID_WINDOW_HANDLE );
return 0;
diff --git a/dlls/user/property.c b/dlls/user/property.c
index 62d3837..972066e 100644
--- a/dlls/user/property.c
+++ b/dlls/user/property.c
@@ -24,6 +24,7 @@
#include "wingdi.h"
#include "wine/winuser16.h"
#include "wine/server.h"
+#include "win.h"
/* size of buffer needed to store an atom string */
#define ATOM_BUFFER_SIZE 256
@@ -298,7 +299,7 @@
INT16 WINAPI EnumProps16( HWND16 hwnd, PROPENUMPROC16 func )
{
int ret = -1, i, count;
- property_data_t *list = get_properties( hwnd, &count );
+ property_data_t *list = get_properties( HWND_32(hwnd), &count );
if (list)
{
diff --git a/dlls/user/wnd16.c b/dlls/user/wnd16.c
index 08afa37..6636a70 100644
--- a/dlls/user/wnd16.c
+++ b/dlls/user/wnd16.c
@@ -40,7 +40,7 @@
static BOOL CALLBACK wnd_enum_callback( HWND hwnd, LPARAM param )
{
const struct wnd_enum_info *info = (struct wnd_enum_info *)param;
- return WIN_CallTo16_word_wl( info->proc, hwnd, info->param );
+ return WIN_CallTo16_word_wl( info->proc, HWND_16(hwnd), info->param );
}
/* convert insert after window handle to 32-bit */
@@ -74,7 +74,7 @@
*/
HWND16 WINAPI SetCapture16( HWND16 hwnd )
{
- return WIN_Handle16( SetCapture( WIN_Handle32(hwnd) ));
+ return HWND_16( SetCapture( WIN_Handle32(hwnd) ));
}
@@ -92,7 +92,7 @@
*/
HWND16 WINAPI SetFocus16( HWND16 hwnd )
{
- return WIN_Handle16( SetFocus( WIN_Handle32(hwnd) ));
+ return HWND_16( SetFocus( WIN_Handle32(hwnd) ));
}
@@ -101,7 +101,7 @@
*/
HWND16 WINAPI GetFocus16(void)
{
- return WIN_Handle16( GetFocus() );
+ return HWND_16( GetFocus() );
}
@@ -158,7 +158,7 @@
POINT pt32;
CONV_POINT16TO32( &pt, &pt32 );
- return WIN_Handle16( WindowFromPoint( pt32 ) );
+ return HWND_16( WindowFromPoint( pt32 ) );
}
@@ -319,7 +319,7 @@
*/
HWND16 WINAPI GetParent16( HWND16 hwnd )
{
- return WIN_Handle16( GetParent( WIN_Handle32(hwnd) ));
+ return HWND_16( GetParent( WIN_Handle32(hwnd) ));
}
@@ -357,7 +357,7 @@
*/
HWND16 WINAPI FindWindow16( LPCSTR className, LPCSTR title )
{
- return WIN_Handle16( FindWindowA( className, title ));
+ return HWND_16( FindWindowA( className, title ));
}
@@ -419,7 +419,7 @@
*/
HWND16 WINAPI SetActiveWindow16( HWND16 hwnd )
{
- return WIN_Handle16( SetActiveWindow( WIN_Handle32(hwnd) ));
+ return HWND_16( SetActiveWindow( WIN_Handle32(hwnd) ));
}
@@ -428,7 +428,7 @@
*/
HWND16 WINAPI GetActiveWindow16(void)
{
- return WIN_Handle16( GetActiveWindow() );
+ return HWND_16( GetActiveWindow() );
}
@@ -530,7 +530,7 @@
*/
HWND16 WINAPI GetDlgItem16( HWND16 hwndDlg, INT16 id )
{
- return WIN_Handle16( GetDlgItem( WIN_Handle32(hwndDlg), (UINT16) id ));
+ return HWND_16( GetDlgItem( WIN_Handle32(hwndDlg), (UINT16) id ));
}
@@ -679,7 +679,7 @@
*/
HWND16 WINAPI WindowFromDC16( HDC16 hDC )
{
- return WIN_Handle16( WindowFromDC( hDC ) );
+ return HWND_16( WindowFromDC( hDC ) );
}
@@ -778,7 +778,7 @@
*/
HWND16 WINAPI GetClipboardOwner16(void)
{
- return WIN_Handle16( GetClipboardOwner() );
+ return HWND_16( GetClipboardOwner() );
}
@@ -787,7 +787,7 @@
*/
HWND16 WINAPI SetClipboardViewer16( HWND16 hwnd )
{
- return WIN_Handle16( SetClipboardViewer( WIN_Handle32(hwnd) ));
+ return HWND_16( SetClipboardViewer( WIN_Handle32(hwnd) ));
}
@@ -796,7 +796,7 @@
*/
HWND16 WINAPI GetClipboardViewer16(void)
{
- return WIN_Handle16( GetClipboardViewer() );
+ return HWND_16( GetClipboardViewer() );
}
@@ -950,7 +950,7 @@
{
POINT pt32;
CONV_POINT16TO32( &pt, &pt32 );
- return WIN_Handle16( ChildWindowFromPoint( WIN_Handle32(hwndParent), pt32 ));
+ return HWND_16( ChildWindowFromPoint( WIN_Handle32(hwndParent), pt32 ));
}
@@ -994,7 +994,7 @@
HWND16 WINAPI GetNextDlgGroupItem16( HWND16 hwndDlg, HWND16 hwndCtrl,
BOOL16 fPrevious )
{
- return WIN_Handle16( GetNextDlgGroupItem( WIN_Handle32(hwndDlg),
+ return HWND_16( GetNextDlgGroupItem( WIN_Handle32(hwndDlg),
WIN_Handle32(hwndCtrl), fPrevious ));
}
@@ -1005,7 +1005,7 @@
HWND16 WINAPI GetNextDlgTabItem16( HWND16 hwndDlg, HWND16 hwndCtrl,
BOOL16 fPrevious )
{
- return WIN_Handle16( GetNextDlgTabItem( WIN_Handle32(hwndDlg),
+ return HWND_16( GetNextDlgTabItem( WIN_Handle32(hwndDlg),
WIN_Handle32(hwndCtrl), fPrevious ));
}
@@ -1015,7 +1015,7 @@
*/
HWND16 WINAPI GetTopWindow16( HWND16 hwnd )
{
- return WIN_Handle16( GetTopWindow( WIN_Handle32(hwnd) ));
+ return HWND_16( GetTopWindow( WIN_Handle32(hwnd) ));
}
@@ -1045,7 +1045,7 @@
*/
HWND16 WINAPI SetParent16( HWND16 hwndChild, HWND16 hwndNewParent )
{
- return WIN_Handle16( SetParent( WIN_Handle32(hwndChild), WIN_Handle32(hwndNewParent) ));
+ return HWND_16( SetParent( WIN_Handle32(hwndChild), WIN_Handle32(hwndNewParent) ));
}
@@ -1054,7 +1054,7 @@
*/
HWND16 WINAPI GetCapture16(void)
{
- return WIN_Handle16( GetCapture() );
+ return HWND_16( GetCapture() );
}
@@ -1081,7 +1081,7 @@
*/
HWND16 WINAPI GetOpenClipboardWindow16(void)
{
- return WIN_Handle16( GetOpenClipboardWindow() );
+ return HWND_16( GetOpenClipboardWindow() );
}
@@ -1120,7 +1120,7 @@
*/
HWND16 WINAPI GetWindow16( HWND16 hwnd, WORD rel )
{
- return WIN_Handle16( GetWindow( WIN_Handle32(hwnd), rel ) );
+ return HWND_16( GetWindow( WIN_Handle32(hwnd), rel ) );
}
@@ -1186,7 +1186,7 @@
*/
HWND16 WINAPI GetDesktopWindow16(void)
{
- return WIN_Handle16( GetDesktopWindow() );
+ return HWND_16( GetDesktopWindow() );
}
@@ -1195,7 +1195,7 @@
*/
HWND16 WINAPI GetLastActivePopup16( HWND16 hwnd )
{
- return WIN_Handle16( GetLastActivePopup( WIN_Handle32(hwnd) ));
+ return HWND_16( GetLastActivePopup( WIN_Handle32(hwnd) ));
}
@@ -1353,7 +1353,7 @@
{
POINT pt32;
CONV_POINT16TO32( &pt, &pt32 );
- return WIN_Handle16( ChildWindowFromPointEx( WIN_Handle32(hwndParent), pt32, uFlags ));
+ return HWND_16( ChildWindowFromPointEx( WIN_Handle32(hwndParent), pt32, uFlags ));
}
@@ -1407,7 +1407,7 @@
*/
HWND16 WINAPI FindWindowEx16( HWND16 parent, HWND16 child, LPCSTR className, LPCSTR title )
{
- return WIN_Handle16( FindWindowExA( WIN_Handle32(parent), WIN_Handle32(child),
+ return HWND_16( FindWindowExA( WIN_Handle32(parent), WIN_Handle32(child),
className, title ));
}
@@ -1517,7 +1517,7 @@
*/
HWND16 WINAPI GetShellWindow16(void)
{
- return WIN_Handle16( GetShellWindow() );
+ return HWND_16( GetShellWindow() );
}
@@ -1526,7 +1526,7 @@
*/
HWND16 WINAPI GetForegroundWindow16(void)
{
- return WIN_Handle16( GetForegroundWindow() );
+ return HWND_16( GetForegroundWindow() );
}
diff --git a/dlls/x11drv/dga2.c b/dlls/x11drv/dga2.c
index a51ee57..234c061 100644
--- a/dlls/x11drv/dga2.c
+++ b/dlls/x11drv/dga2.c
@@ -143,7 +143,7 @@
KeyPressMask|KeyReleaseMask|
ButtonPressMask|ButtonReleaseMask|
PointerMotionMask);
- X11DRV_EVENT_SetDGAStatus(ddlocal->hWnd, dga_event);
+ X11DRV_EVENT_SetDGAStatus((HWND)ddlocal->hWnd, dga_event);
X11DRV_EVENT_SetInputMethod(X11DRV_INPUT_RELATIVE);
}
dga_dev = new_dev;
diff --git a/dlls/x11drv/event.c b/dlls/x11drv/event.c
index ff173bd..5d5ea6b 100644
--- a/dlls/x11drv/event.c
+++ b/dlls/x11drv/event.c
@@ -1058,7 +1058,7 @@
&x, &y, (int *) &u.pt_aux.x, (int *) &u.pt_aux.y,
(unsigned int*)&aux_long);
- lpDragInfo->hScope = hWnd;
+ lpDragInfo->hScope = HWND_16(hWnd);
lpDragInfo->pt.x = (INT16)x; lpDragInfo->pt.y = (INT16)y;
/* find out drop point and drop window */
@@ -1110,7 +1110,7 @@
if( lpDrop )
{
- WND *pDropWnd = WIN_FindWndPtr( lpDragInfo->hScope );
+ WND *pDropWnd = WIN_FindWndPtr( HWND_32(lpDragInfo->hScope) );
lpDrop->pFiles = sizeof(DROPFILES);
lpDrop->pt.x = x;
lpDrop->pt.y = y;
diff --git a/include/win.h b/include/win.h
index d41f9d1..b283e61 100644
--- a/include/win.h
+++ b/include/win.h
@@ -121,10 +121,8 @@
return hwnd;
}
-inline static HWND16 WIN_Handle16( HWND hwnd )
-{
- return LOWORD(hwnd);
-}
+#define HWND_16(hwnd32) (LOWORD(hwnd32))
+#define HWND_32(hwnd16) ((HWND)(ULONG_PTR)(hwnd16))
inline static WND *WIN_FindWndPtr16( HWND16 hwnd )
{
diff --git a/windows/dialog.c b/windows/dialog.c
index 7bb413f..60afc54 100644
--- a/windows/dialog.c
+++ b/windows/dialog.c
@@ -452,7 +452,7 @@
MulDiv(info.y, dlgInfo->yBaseUnit, 8),
MulDiv(info.cx, dlgInfo->xBaseUnit, 4),
MulDiv(info.cy, dlgInfo->yBaseUnit, 8),
- WIN_Handle16(hwnd), (HMENU16)info.id,
+ HWND_16(hwnd), (HMENU16)info.id,
instance, (LPVOID)segptr ));
UnMapLS( segptr );
}
@@ -812,7 +812,7 @@
hwnd = WIN_Handle32( CreateWindowEx16(template.exStyle, template.className,
template.caption, template.style & ~WS_VISIBLE,
rect.left, rect.top, rect.right, rect.bottom,
- WIN_Handle16(owner), dlgInfo->hMenu, hInst, NULL ));
+ HWND_16(owner), dlgInfo->hMenu, hInst, NULL ));
else
hwnd = CreateWindowExW(template.exStyle, (LPCWSTR)template.className,
(LPCWSTR)template.caption,
@@ -836,7 +836,7 @@
SetWindowLongW( hwnd, DWL_WINE_DIALOGINFO, (LONG)dlgInfo );
switch(procType)
{
- case WIN_PROC_16: SetWindowLong16( WIN_Handle16(hwnd), DWL_DLGPROC, (LONG)dlgProc ); break;
+ case WIN_PROC_16: SetWindowLong16( HWND_16(hwnd), DWL_DLGPROC, (LONG)dlgProc ); break;
case WIN_PROC_32A: SetWindowLongA( hwnd, DWL_DLGPROC, (LONG)dlgProc ); break;
case WIN_PROC_32W: SetWindowLongW( hwnd, DWL_DLGPROC, (LONG)dlgProc ); break;
default: break;
@@ -973,7 +973,7 @@
HWND16 owner, DLGPROC16 dlgProc,
LPARAM param )
{
- return WIN_Handle16( DIALOG_CreateIndirect( hInst, dlgTemplate, WIN_Handle32(owner),
+ return HWND_16( DIALOG_CreateIndirect( hInst, dlgTemplate, WIN_Handle32(owner),
(DLGPROC)dlgProc, param, WIN_PROC_16, FALSE ));
}
diff --git a/windows/hook.c b/windows/hook.c
index add34d6..cbce648 100644
--- a/windows/hook.c
+++ b/windows/hook.c
@@ -189,7 +189,7 @@
cs32.lpszClass = MapSL( cs16->lpszClass );
ret = proc( code, wparam, (LPARAM)&cbtcw32 );
}
- cbtcw16->hwndInsertAfter = WIN_Handle16( cbtcw32.hwndInsertAfter );
+ cbtcw16->hwndInsertAfter = HWND_16( cbtcw32.hwndInsertAfter );
break;
}
case HCBT_ACTIVATE:
@@ -338,7 +338,7 @@
CWPSTRUCT16 cwp16;
MSGPARAM16 mp16;
- cwp16.hwnd = WIN_Handle16(cwp32->hwnd);
+ cwp16.hwnd = HWND_16(cwp32->hwnd);
cwp16.lParam = cwp32->lParam;
if (unicode)
@@ -375,7 +375,7 @@
STRUCT32_CREATESTRUCT32Ato16( cbtcw32->lpcs, &cs16 );
cbtcw16.lpcs = (CREATESTRUCT16 *)MapLS( &cs16 );
- cbtcw16.hwndInsertAfter = WIN_Handle16( cbtcw32->hwndInsertAfter );
+ cbtcw16.hwndInsertAfter = HWND_16( cbtcw32->hwndInsertAfter );
lparam = MapLS( &cbtcw16 );
if (unicode)
@@ -406,7 +406,7 @@
CBTACTIVATESTRUCT16 cas16;
cas16.fMouse = cas32->fMouse;
- cas16.hWndActive = WIN_Handle16( cas32->hWndActive );
+ cas16.hWndActive = HWND_16( cas32->hWndActive );
lparam = MapLS( &cas16 );
ret = call_hook_16( proc, id, code, wparam, lparam );
@@ -420,7 +420,7 @@
ms16.pt.x = ms32->pt.x;
ms16.pt.y = ms32->pt.y;
- ms16.hwnd = WIN_Handle16( ms32->hwnd );
+ ms16.hwnd = HWND_16( ms32->hwnd );
ms16.wHitTestCode = ms32->wHitTestCode;
ms16.dwExtraInfo = ms32->dwExtraInfo;
@@ -450,7 +450,7 @@
ms16.pt.x = ms32->pt.x;
ms16.pt.y = ms32->pt.y;
- ms16.hwnd = WIN_Handle16( ms32->hwnd );
+ ms16.hwnd = HWND_16( ms32->hwnd );
ms16.wHitTestCode = ms32->wHitTestCode;
ms16.dwExtraInfo = ms32->dwExtraInfo;
@@ -1099,7 +1099,7 @@
ret = (BOOL16)CallMsgFilterA(&msg32, (INT)code);
- lpmsg16_32->msg.hwnd = WIN_Handle16( msg32.hwnd );
+ lpmsg16_32->msg.hwnd = HWND_16( msg32.hwnd );
lpmsg16_32->msg.message = msg32.message;
lpmsg16_32->msg.wParam = LOWORD(msg32.wParam);
lpmsg16_32->msg.lParam = msg32.lParam;
diff --git a/windows/mdi.c b/windows/mdi.c
index bc0f87b..05d2f2d 100644
--- a/windows/mdi.c
+++ b/windows/mdi.c
@@ -566,7 +566,7 @@
seg_cs16 = MapLS( &cs16 );
hwnd = WIN_Handle32( CreateWindow16( cs->szClass, cs->szTitle, style,
cs16.x, cs16.y, cs16.cx, cs16.cy,
- WIN_Handle16(parent), (HMENU)wIDmenu,
+ HWND_16(parent), (HMENU)wIDmenu,
cs16.hOwner, (LPVOID)seg_cs16 ));
UnMapLS( seg_cs16 );
UnMapLS( title );
@@ -1447,7 +1447,7 @@
MDINEXTMENU next_menu;
DefFrameProcW( WIN_Handle32(hwnd), WIN_Handle32(hwndMDIClient),
message, wParam, (LPARAM)&next_menu );
- return MAKELONG( next_menu.hmenuNext, WIN_Handle16(next_menu.hwndNext) );
+ return MAKELONG( next_menu.hmenuNext, HWND_16(next_menu.hwndNext) );
}
default:
return DefWindowProc16(hwnd, message, wParam, lParam);
@@ -1614,7 +1614,7 @@
{
MDINEXTMENU next_menu;
DefMDIChildProcW( WIN_Handle32(hwnd), message, wParam, (LPARAM)&next_menu );
- return MAKELONG( next_menu.hmenuNext, WIN_Handle16(next_menu.hwndNext) );
+ return MAKELONG( next_menu.hmenuNext, HWND_16(next_menu.hwndNext) );
}
default:
return DefWindowProc16(hwnd, message, wParam, lParam);
diff --git a/windows/message.c b/windows/message.c
index bb3b0c6..bcf0228 100644
--- a/windows/message.c
+++ b/windows/message.c
@@ -499,7 +499,8 @@
if ((hittest == HTERROR) || (hittest == HTNOWHERE))
{
- SendMessageA( msg->hwnd, WM_SETCURSOR, msg->hwnd, MAKELONG( hittest, raw_message ));
+ SendMessageA( msg->hwnd, WM_SETCURSOR, (WPARAM)msg->hwnd,
+ MAKELONG( hittest, raw_message ));
return FALSE;
}
@@ -523,7 +524,7 @@
if (msg->hwnd != GetActiveWindow() && hwndTop != GetDesktopWindow())
{
- LONG ret = SendMessageA( msg->hwnd, WM_MOUSEACTIVATE, hwndTop,
+ LONG ret = SendMessageA( msg->hwnd, WM_MOUSEACTIVATE, (WPARAM)hwndTop,
MAKELONG( hittest, raw_message ) );
switch(ret)
@@ -555,7 +556,8 @@
/* Windows sends the normal mouse message as the message parameter
in the WM_SETCURSOR message even if it's non-client mouse message */
- SendMessageA( msg->hwnd, WM_SETCURSOR, msg->hwnd, MAKELONG( hittest, raw_message ));
+ SendMessageA( msg->hwnd, WM_SETCURSOR, (WPARAM)msg->hwnd,
+ MAKELONG( hittest, raw_message ));
return !eatMsg;
}
diff --git a/windows/spy.c b/windows/spy.c
index 1ad0873..79ec1fc 100644
--- a/windows/spy.c
+++ b/windows/spy.c
@@ -2256,7 +2256,7 @@
{
case SPY_DISPATCHMESSAGE16:
TRACE("%*s(%04x) %-16s message [%04x] %s dispatched wp=%04x lp=%08lx\n",
- indent, "", WIN_Handle16(hWnd),
+ indent, "", HWND_16(hWnd),
debugstr_w(sp_e.wnd_name), msg, sp_e.msg_name, wParam, lParam);
break;
@@ -2270,7 +2270,7 @@
case SPY_SENDMESSAGE:
{
char taskName[30];
- HTASK16 hTask = GetWindowTask16( WIN_Handle16(hWnd) );
+ HTASK16 hTask = GetWindowTask16( HWND_16(hWnd) );
if (hTask == GetCurrentTask()) strcpy( taskName, "self" );
else if (!hTask) strcpy( taskName, "Wine" );
@@ -2282,7 +2282,7 @@
if (iFlag == SPY_SENDMESSAGE16)
TRACE("%*s(%04x) %-16s message [%04x] %s sent from %s wp=%04x lp=%08lx\n",
- indent, "", WIN_Handle16(hWnd), debugstr_w(sp_e.wnd_name), msg,
+ indent, "", HWND_16(hWnd), debugstr_w(sp_e.wnd_name), msg,
sp_e.msg_name, taskName, wParam, lParam );
else
{ TRACE("%*s(%08x) %-16s message [%04x] %s sent from %s wp=%08x lp=%08lx\n",
@@ -2296,7 +2296,7 @@
case SPY_DEFWNDPROC16:
if( SPY_ExcludeDWP ) return;
TRACE("%*s(%04x) DefWindowProc16: %s [%04x] wp=%04x lp=%08lx\n",
- indent, "", WIN_Handle16(hWnd), sp_e.msg_name, msg, wParam, lParam );
+ indent, "", HWND_16(hWnd), sp_e.msg_name, msg, wParam, lParam );
break;
case SPY_DEFWNDPROC:
@@ -2340,7 +2340,7 @@
{
case SPY_RESULT_DEFWND16:
TRACE(" %*s(%04x) DefWindowProc16: %s [%04x] returned %08lx\n",
- indent, "", WIN_Handle16(hWnd), sp_e.msg_name, msg, lReturn );
+ indent, "", HWND_16(hWnd), sp_e.msg_name, msg, lReturn );
break;
case SPY_RESULT_DEFWND:
@@ -2350,7 +2350,7 @@
case SPY_RESULT_OK16:
TRACE(" %*s(%04x) %-16s message [%04x] %s returned %08lx\n",
- indent, "", WIN_Handle16(hWnd), debugstr_w(sp_e.wnd_name), msg,
+ indent, "", HWND_16(hWnd), debugstr_w(sp_e.wnd_name), msg,
sp_e.msg_name, lReturn );
break;
@@ -2363,7 +2363,7 @@
case SPY_RESULT_INVALIDHWND16:
WARN(" %*s(%04x) %-16s message [%04x] %s HAS INVALID HWND\n",
- indent, "", WIN_Handle16(hWnd), debugstr_w(sp_e.wnd_name), msg, sp_e.msg_name );
+ indent, "", HWND_16(hWnd), debugstr_w(sp_e.wnd_name), msg, sp_e.msg_name );
break;
case SPY_RESULT_INVALIDHWND:
diff --git a/windows/struct32.c b/windows/struct32.c
index c83c518..df3536f 100644
--- a/windows/struct32.c
+++ b/windows/struct32.c
@@ -35,7 +35,7 @@
void STRUCT32_MSG32to16(const MSG *msg32,MSG16 *msg16)
{
- msg16->hwnd = WIN_Handle16(msg32->hwnd);
+ msg16->hwnd = HWND_16(msg32->hwnd);
msg16->message=msg32->message;
msg16->wParam=msg32->wParam;
msg16->lParam=msg32->lParam;
@@ -64,8 +64,8 @@
void STRUCT32_WINDOWPOS32to16( const WINDOWPOS* from, WINDOWPOS16* to )
{
- to->hwnd = WIN_Handle16(from->hwnd);
- to->hwndInsertAfter = WIN_Handle16(from->hwndInsertAfter);
+ to->hwnd = HWND_16(from->hwnd);
+ to->hwndInsertAfter = HWND_16(from->hwndInsertAfter);
to->x = from->x;
to->y = from->y;
to->cx = from->cx;
@@ -92,7 +92,7 @@
to->lpCreateParams = from->lpCreateParams;
to->hInstance = (HINSTANCE16)from->hInstance;
to->hMenu = (HMENU16)from->hMenu;
- to->hwndParent = WIN_Handle16(from->hwndParent);
+ to->hwndParent = HWND_16(from->hwndParent);
to->cy = from->cy;
to->cx = from->cx;
to->y = from->y;
diff --git a/windows/win.c b/windows/win.c
index cb3cd22..f84b8df 100644
--- a/windows/win.c
+++ b/windows/win.c
@@ -1254,7 +1254,7 @@
cs.lpszClass = className;
cs.dwExStyle = exStyle;
- return WIN_Handle16( WIN_CreateWindowEx( &cs, classAtom, WIN_PROC_16 ));
+ return HWND_16( WIN_CreateWindowEx( &cs, classAtom, WIN_PROC_16 ));
}
@@ -2528,7 +2528,7 @@
}
if (!(full_handle = WIN_IsCurrentThread( hwnd )))
- return SendMessageW( hwnd, WM_WINE_SETPARENT, (WPARAM)parent, 0 );
+ return (HWND)SendMessageW( hwnd, WM_WINE_SETPARENT, (WPARAM)parent, 0 );
hwnd = full_handle;
@@ -3167,12 +3167,13 @@
}
else wParam = 1;
- ScreenToClient16(hQueryWnd,&ptrDragInfo->pt);
+ ScreenToClient16(HWND_16(hQueryWnd),&ptrDragInfo->pt);
- ptrDragInfo->hScope = hQueryWnd;
+ ptrDragInfo->hScope = HWND_16(hQueryWnd);
if (bNoSend) bResult = (GetWindowLongA( hQueryWnd, GWL_EXSTYLE ) & WS_EX_ACCEPTFILES) != 0;
- else bResult = SendMessage16( hQueryWnd, WM_QUERYDROPOBJECT, (WPARAM16)wParam, spDragInfo );
+ else bResult = SendMessage16( HWND_16(hQueryWnd), WM_QUERYDROPOBJECT,
+ (WPARAM16)wParam, spDragInfo );
if( !bResult ) CONV_POINT32TO16( &pt, &ptrDragInfo->pt );
@@ -3256,7 +3257,7 @@
lpDragInfo->hOfStruct = hOfStruct;
lpDragInfo->l = 0L;
- SetCapture(hWnd);
+ SetCapture(WIN_Handle32(hWnd));
ShowCursor( TRUE );
do
@@ -3271,7 +3272,7 @@
/* update DRAGINFO struct */
TRACE_(msg)("lpDI->hScope = %04x\n",lpDragInfo->hScope);
- if( DRAG_QueryUpdate(hwndScope, spDragInfo, FALSE) > 0 )
+ if( DRAG_QueryUpdate(WIN_Handle32(hwndScope), spDragInfo, FALSE) > 0 )
hCurrentCursor = hCursor;
else
{
diff --git a/windows/winhelp.c b/windows/winhelp.c
index 0c46dfb..42400fa 100644
--- a/windows/winhelp.c
+++ b/windows/winhelp.c
@@ -156,7 +156,7 @@
} else
lpwh->ofsData = 0;
GlobalUnlock16(hwh);
- return SendMessage16(hDest,WM_WINHELP,hWnd,hwh);
+ return SendMessage16(HWND_16(hDest),WM_WINHELP,HWND_16(hWnd),hwh);
}
diff --git a/windows/winproc.c b/windows/winproc.c
index 2df3ec8..76a0658 100644
--- a/windows/winproc.c
+++ b/windows/winproc.c
@@ -1364,7 +1364,7 @@
case WM_DDE_TERMINATE:
case WM_DDE_UNADVISE:
case WM_DDE_REQUEST:
- *pwparam32 = WIN_Handle32(wParam16);
+ *pwparam32 = (WPARAM)WIN_Handle32(wParam16);
return 0;
case WM_DDE_ADVISE:
case WM_DDE_DATA:
@@ -1374,7 +1374,7 @@
ATOM hi;
HANDLE lo32 = 0;
- *pwparam32 = WIN_Handle32(wParam16);
+ *pwparam32 = (WPARAM)WIN_Handle32(wParam16);
lo16 = LOWORD(*plparam);
hi = HIWORD(*plparam);
if (lo16 && !(lo32 = convert_handle_16_to_32(lo16, GMEM_DDESHARE)))
@@ -1388,7 +1388,7 @@
int flag = 0;
char buf[2];
- *pwparam32 = WIN_Handle32(wParam16);
+ *pwparam32 = (WPARAM)WIN_Handle32(wParam16);
lo = LOWORD(*plparam);
hi = HIWORD(*plparam);
@@ -1522,7 +1522,7 @@
case WM_NEXTMENU:
{
MDINEXTMENU *next = (MDINEXTMENU *)lParam;
- result = MAKELONG( next->hmenuNext, WIN_Handle16(next->hwndNext) );
+ result = MAKELONG( next->hmenuNext, HWND_16(next->hwndNext) );
HeapFree( GetProcessHeap(), 0, next );
}
break;
@@ -1923,7 +1923,7 @@
if (!cis) return -1;
cis->CtlType = (UINT16)cis32->CtlType;
cis->CtlID = (UINT16)cis32->CtlID;
- cis->hwndItem = WIN_Handle16( cis32->hwndItem );
+ cis->hwndItem = HWND_16( cis32->hwndItem );
cis->itemID1 = (UINT16)cis32->itemID1;
cis->itemData1 = cis32->itemData1;
cis->itemID2 = (UINT16)cis32->itemID2;
@@ -1940,7 +1940,7 @@
dis->CtlID = (UINT16)dis32->CtlID;
dis->itemID = (UINT16)dis32->itemID;
dis->hwndItem = (dis->CtlType == ODT_MENU) ? (HWND16)LOWORD(dis32->hwndItem)
- : WIN_Handle16( dis32->hwndItem );
+ : HWND_16( dis32->hwndItem );
dis->itemData = dis32->itemData;
*plparam = MapLS( dis );
}
@@ -1955,7 +1955,7 @@
dis->itemID = (UINT16)dis32->itemID;
dis->itemAction = (UINT16)dis32->itemAction;
dis->itemState = (UINT16)dis32->itemState;
- dis->hwndItem = WIN_Handle16( dis32->hwndItem );
+ dis->hwndItem = HWND_16( dis32->hwndItem );
dis->hDC = (HDC16)dis32->hDC;
dis->itemData = dis32->itemData;
CONV_RECT32TO16( &dis32->rcItem, &dis->rcItem );
@@ -2038,7 +2038,7 @@
}
else
{
- *pwparam16 = WIN_Handle16( (HWND)wParam32 );
+ *pwparam16 = HWND_16( (HWND)wParam32 );
*plparam = 0;
}
return 0;
@@ -2108,7 +2108,7 @@
LPMSG16 msg16 = HeapAlloc( GetProcessHeap(), 0, sizeof(MSG16) );
if (!msg16) return -1;
- msg16->hwnd = WIN_Handle16( msg32->hwnd );
+ msg16->hwnd = HWND_16( msg32->hwnd );
msg16->lParam = msg32->lParam;
msg16->time = msg32->time;
CONV_POINT32TO16(&msg32->pt,&msg16->pt);
@@ -2148,7 +2148,7 @@
case WM_DDE_TERMINATE:
case WM_DDE_UNADVISE:
case WM_DDE_REQUEST:
- *pwparam16 = WIN_Handle16(wParam32);
+ *pwparam16 = HWND_16((HWND)wParam32);
return 0;
case WM_DDE_ADVISE:
case WM_DDE_DATA:
@@ -2157,7 +2157,7 @@
unsigned lo32, hi;
HANDLE16 lo16 = 0;
- *pwparam16 = WIN_Handle16(wParam32);
+ *pwparam16 = HWND_16((HWND)wParam32);
UnpackDDElParam(msg32, *plparam, &lo32, &hi);
if (lo32 && !(lo16 = convert_handle_32_to_16(lo32, GMEM_DDESHARE)))
return -1;
@@ -2170,7 +2170,7 @@
int flag = 0;
char buf[2];
- *pwparam16 = WIN_Handle16(wParam32);
+ *pwparam16 = HWND_16((HWND)wParam32);
UnpackDDElParam(msg32, *plparam, &lo, &hi);
@@ -2672,7 +2672,7 @@
mp16.lParam = lParam;
if (WINPROC_MapMsg32ATo16( hwnd, msg, wParam, &msg16, &mp16.wParam, &mp16.lParam ) == -1)
return 0;
- mp16.lResult = WINPROC_CallWndProc16( func, WIN_Handle16(hwnd), msg16,
+ mp16.lResult = WINPROC_CallWndProc16( func, HWND_16(hwnd), msg16,
mp16.wParam, mp16.lParam );
WINPROC_UnmapMsg32ATo16( hwnd, msg, wParam, lParam, &mp16 );
return mp16.lResult;
@@ -2698,7 +2698,7 @@
if (WINPROC_MapMsg32WTo16( hwnd, msg, wParam, &msg16, &mp16.wParam,
&mp16.lParam ) == -1)
return 0;
- mp16.lResult = WINPROC_CallWndProc16( func, WIN_Handle16(hwnd), msg16,
+ mp16.lResult = WINPROC_CallWndProc16( func, HWND_16(hwnd), msg16,
mp16.wParam, mp16.lParam );
WINPROC_UnmapMsg32WTo16( hwnd, msg, wParam, lParam, &mp16 );
return mp16.lResult;