Commit d23a82bc authored by Alexandre Julliard's avatar Alexandre Julliard

Made all 16<->32 HWND conversions use explicit functions instead of

implicit type casts. Moved a lot of 16-bit functions to the new wnd16.c file. Changed DIALOGINFO structure handling to support 32-bit handles.
parent 629aab17
......@@ -218,7 +218,8 @@ static LRESULT WINAPI ButtonWndProc_common(HWND hWnd, UINT uMsg,
btn_type == BS_OWNERDRAW)
{
SendMessageW( GetParent(hWnd), WM_COMMAND,
MAKEWPARAM( GetWindowLongA(hWnd,GWL_ID), BN_DOUBLECLICKED ), hWnd);
MAKEWPARAM( GetWindowLongA(hWnd,GWL_ID), BN_DOUBLECLICKED ),
(LPARAM)hWnd);
break;
}
/* fall through */
......@@ -263,7 +264,7 @@ static LRESULT WINAPI ButtonWndProc_common(HWND hWnd, UINT uMsg,
break;
}
SendMessageW( GetParent(hWnd), WM_COMMAND,
MAKEWPARAM( GetWindowLongA(hWnd,GWL_ID), BN_CLICKED ), hWnd);
MAKEWPARAM( GetWindowLongA(hWnd,GWL_ID), BN_CLICKED ), (LPARAM)hWnd);
}
break;
......@@ -308,7 +309,7 @@ static LRESULT WINAPI ButtonWndProc_common(HWND hWnd, UINT uMsg,
if (btn_type == BS_AUTORADIOBUTTON)
SendMessageW( hWnd, BM_SETCHECK, BUTTON_CHECKED, 0 );
SendMessageW( GetParent(hWnd), WM_COMMAND,
MAKEWPARAM( GetWindowLongA(hWnd,GWL_ID), BN_CLICKED ), hWnd);
MAKEWPARAM( GetWindowLongA(hWnd,GWL_ID), BN_CLICKED ), (LPARAM)hWnd);
}
set_button_state( hWnd, get_button_state(hWnd) | BUTTON_HASFOCUS );
paint_button( hWnd, btn_type, ODA_FOCUS );
......@@ -677,7 +678,7 @@ static void PB_Paint( HWND hwnd, HDC hDC, UINT action )
/* 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, hwnd );
SendMessageW( GetParent(hwnd), WM_CTLCOLORBTN, hDC, (LPARAM)hwnd );
hOldPen = (HPEN)SelectObject(hDC, GetSysColorPen(COLOR_WINDOWFRAME));
hOldBrush =(HBRUSH)SelectObject(hDC,GetSysColorBrush(COLOR_BTNFACE));
oldBkMode = SetBkMode(hDC, TRANSPARENT);
......@@ -802,10 +803,9 @@ static void CB_Paint( HWND hwnd, HDC hDC, UINT action )
if ((hFont = get_button_font( hwnd ))) SelectObject( hDC, hFont );
/* GetControlBrush16 sends WM_CTLCOLORBTN, plus it returns default brush
* if parent didn't return valid one. So we kill two hares at once
*/
hBrush = GetControlBrush16( hwnd, hDC, CTLCOLOR_BTN );
hBrush = SendMessageW( GetParent(hwnd), WM_CTLCOLORBTN, hDC, (LPARAM)hwnd );
if (!hBrush) /* did the app forget to call defwindowproc ? */
hBrush = DefWindowProcW( GetParent(hwnd), WM_CTLCOLORBTN, hDC, (LPARAM)hwnd );
if (style & BS_LEFTTEXT)
{
......@@ -951,7 +951,9 @@ static void GB_Paint( HWND hwnd, HDC hDC, UINT action )
if ((hFont = get_button_font( hwnd ))) SelectObject( hDC, hFont );
/* GroupBox acts like static control, so it sends CTLCOLORSTATIC */
hbr = GetControlBrush16( hwnd, hDC, CTLCOLOR_STATIC );
hbr = SendMessageW( GetParent(hwnd), WM_CTLCOLORSTATIC, hDC, (LPARAM)hwnd );
if (!hbr) /* did the app forget to call defwindowproc ? */
hbr = DefWindowProcW( GetParent(hwnd), WM_CTLCOLORSTATIC, hDC, (LPARAM)hwnd );
GetClientRect( hwnd, &rc);
if (TWEAK_WineLook == WIN31_LOOK) {
......@@ -1008,7 +1010,10 @@ static void UB_Paint( HWND hwnd, HDC hDC, UINT action )
GetClientRect( hwnd, &rc);
if ((hFont = get_button_font( hwnd ))) SelectObject( hDC, hFont );
hBrush = GetControlBrush16( hwnd, hDC, CTLCOLOR_BTN );
hBrush = SendMessageW( GetParent(hwnd), WM_CTLCOLORBTN, hDC, (LPARAM)hwnd );
if (!hBrush) /* did the app forget to call defwindowproc ? */
hBrush = DefWindowProcW( GetParent(hwnd), WM_CTLCOLORBTN, hDC, (LPARAM)hwnd );
FillRect( hDC, &rc, hBrush );
if ((action == ODA_FOCUS) ||
......
......@@ -31,8 +31,8 @@ DEFAULT_DEBUG_CHANNEL(combo);
*/
#define CB_NOTIFY( lphc, code ) \
(SendMessageW((lphc)->owner, WM_COMMAND, \
MAKEWPARAM(GetWindowLongA((lphc)->self,GWL_ID), (code)), (lphc)->self))
(SendMessageW((lphc)->owner, WM_COMMAND, \
MAKEWPARAM(GetWindowLongA((lphc)->self,GWL_ID), (code)), (LPARAM)(lphc)->self))
#define CB_DISABLED( lphc ) (!IsWindowEnabled((lphc)->self))
#define CB_OWNERDRAWN( lphc ) ((lphc)->dwStyle & (CBS_OWNERDRAWFIXED | CBS_OWNERDRAWVARIABLE))
......@@ -626,7 +626,7 @@ static LRESULT COMBO_Create( HWND hwnd, LPHEADCOMBO lphc, HWND hwndParent, LONG
}
TRACE("init done\n");
return hwnd;
return 0;
}
ERR("edit control failure.\n");
} else ERR("listbox failure.\n");
......@@ -898,7 +898,7 @@ static HBRUSH COMBO_PrepareColors(
*/
if (CB_DISABLED(lphc))
{
hBkgBrush = SendMessageW(lphc->owner, WM_CTLCOLORSTATIC, hDC, lphc->self );
hBkgBrush = SendMessageW(lphc->owner, WM_CTLCOLORSTATIC, hDC, (LPARAM)lphc->self );
/*
* We have to change the text color since WM_CTLCOLORSTATIC will
......@@ -911,11 +911,11 @@ static HBRUSH COMBO_PrepareColors(
{
if (lphc->wState & CBF_EDIT)
{
hBkgBrush = SendMessageW(lphc->owner, WM_CTLCOLOREDIT, hDC, lphc->self );
hBkgBrush = SendMessageW(lphc->owner, WM_CTLCOLOREDIT, hDC, (LPARAM)lphc->self );
}
else
{
hBkgBrush = SendMessageW(lphc->owner, WM_CTLCOLORLISTBOX, hDC, lphc->self );
hBkgBrush = SendMessageW(lphc->owner, WM_CTLCOLORLISTBOX, hDC, (LPARAM)lphc->self );
}
}
......
......@@ -123,6 +123,7 @@ static BOOL ICONTITLE_SetTitlePos( HWND hwnd, HWND owner )
*/
static BOOL ICONTITLE_Paint( HWND hwnd, HWND owner, HDC hDC, BOOL bActive )
{
RECT rect;
HFONT hPrevFont;
HBRUSH hBrush = 0;
COLORREF textColor = 0;
......@@ -158,18 +159,16 @@ static BOOL ICONTITLE_Paint( HWND hwnd, HWND owner, HDC hDC, BOOL bActive )
}
}
FillWindow16( GetParent(hwnd), hwnd, hDC, hBrush );
GetClientRect( hwnd, &rect );
DPtoLP( hDC, (LPPOINT)&rect, 2 );
FillRect( hDC, &rect, hBrush );
hPrevFont = SelectObject( hDC, hIconTitleFont );
if( hPrevFont )
{
RECT rect;
INT length;
WCHAR buffer[80];
GetClientRect( hwnd, &rect );
length = GetWindowTextW( owner, buffer, 80 );
INT length = GetWindowTextW( owner, buffer, sizeof(buffer) );
SetTextColor( hDC, textColor );
SetBkMode( hDC, TRANSPARENT );
......@@ -178,7 +177,7 @@ static BOOL ICONTITLE_Paint( HWND hwnd, HWND owner, HDC hDC, BOOL bActive )
SelectObject( hDC, hPrevFont );
}
return ( hPrevFont ) ? TRUE : FALSE;
return (hPrevFont != 0);
}
/***********************************************************************
......@@ -187,12 +186,9 @@ static BOOL ICONTITLE_Paint( HWND hwnd, HWND owner, HDC hDC, BOOL bActive )
LRESULT WINAPI IconTitleWndProc( HWND hWnd, UINT msg,
WPARAM wParam, LPARAM lParam )
{
LRESULT retvalue;
HWND owner = GetWindow( hWnd, GW_OWNER );
WND *wnd = WIN_FindWndPtr( hWnd );
if( !wnd )
return 0;
if (!IsWindow(hWnd)) return 0;
switch( msg )
{
......@@ -204,44 +200,30 @@ LRESULT WINAPI IconTitleWndProc( HWND hWnd, UINT msg,
SystemParametersInfoA( SPI_GETICONTITLEWRAP, 0, &bMultiLineTitle, 0 );
hIconTitleFont = CreateFontIndirectA( &logFont );
}
retvalue = (hIconTitleFont) ? 0 : -1;
goto END;
return (hIconTitleFont ? 0 : -1);
case WM_NCHITTEST:
retvalue = HTCAPTION;
goto END;
return HTCAPTION;
case WM_NCMOUSEMOVE:
case WM_NCLBUTTONDBLCLK:
retvalue = SendMessageW( owner, msg, wParam, lParam );
goto END;
return SendMessageW( owner, msg, wParam, lParam );
case WM_ACTIVATE:
if( wParam ) SetActiveWindow( owner );
/* fall through */
return 0;
case WM_CLOSE:
retvalue = 0;
goto END;
return 0;
case WM_SHOWWINDOW:
if( wnd && wParam ) ICONTITLE_SetTitlePos( hWnd, owner );
retvalue = 0;
goto END;
if (wParam) ICONTITLE_SetTitlePos( hWnd, owner );
return 0;
case WM_ERASEBKGND:
if( wnd )
{
if( GetWindowLongA( owner, GWL_STYLE ) & WS_CHILD )
lParam = SendMessageA( owner, WM_ISACTIVEICON, 0, 0 );
else
lParam = (owner == GetActiveWindow());
if( ICONTITLE_Paint( hWnd, owner, (HDC)wParam, (BOOL)lParam ) )
ValidateRect( hWnd, NULL );
retvalue = 1;
goto END;
}
if( GetWindowLongA( owner, GWL_STYLE ) & WS_CHILD )
lParam = SendMessageA( owner, WM_ISACTIVEICON, 0, 0 );
else
lParam = (owner == GetActiveWindow());
if( ICONTITLE_Paint( hWnd, owner, (HDC)wParam, (BOOL)lParam ) )
ValidateRect( hWnd, NULL );
return 1;
}
retvalue = DefWindowProcW( hWnd, msg, wParam, lParam );
END:
WIN_ReleaseWndPtr(wnd);
return retvalue;
return DefWindowProcW( hWnd, msg, wParam, lParam );
}
......@@ -1068,7 +1068,7 @@ static void MENU_DrawMenuItem( HWND hwnd, HMENU hmenu, HWND hwndOwner, HDC hdc,
if (lpitem->fState & MF_GRAYED) dis.itemState |= ODS_GRAYED;
if (lpitem->fState & MF_HILITE) dis.itemState |= ODS_SELECTED;
dis.itemAction = odaction; /* ODA_DRAWENTIRE | ODA_SELECT | ODA_FOCUS; */
dis.hwndItem = hmenu;
dis.hwndItem = (HWND)hmenu;
dis.hDC = hdc;
dis.rcItem = lpitem->rect;
TRACE("Ownerdraw: owner=%04x itemID=%d, itemState=%d, itemAction=%d, "
......@@ -2901,7 +2901,7 @@ static BOOL MENU_InitTracking(HWND hWnd, HMENU hMenu, BOOL bPopup, UINT wFlags)
if (!(wFlags & TPM_NONOTIFY))
SendMessageA( hWnd, WM_ENTERMENULOOP, bPopup, 0 );
SendMessageA( hWnd, WM_SETCURSOR, hWnd, HTCAPTION );
SendMessageA( hWnd, WM_SETCURSOR, (WPARAM)hWnd, HTCAPTION );
if (!(wFlags & TPM_NONOTIFY))
{
......@@ -3007,20 +3007,6 @@ void MENU_TrackKbdMenuBar( HWND hwnd, UINT wParam, INT vkey)
/**********************************************************************
* TrackPopupMenu (USER.416)
*/
BOOL16 WINAPI TrackPopupMenu16( HMENU16 hMenu, UINT16 wFlags, INT16 x, INT16 y,
INT16 nReserved, HWND16 hWnd, const RECT16 *lpRect )
{
RECT r;
if (lpRect)
CONV_RECT16TO32( lpRect, &r );
return TrackPopupMenu( hMenu, wFlags, x, y, nReserved, hWnd,
lpRect ? &r : NULL );
}
/**********************************************************************
* TrackPopupMenu (USER32.@)
*
* Like the win32 API, the function return the command ID only if the
......@@ -3350,16 +3336,6 @@ INT WINAPI GetMenuStringW( HMENU hMenu, UINT wItemID,
/**********************************************************************
* HiliteMenuItem (USER.162)
*/
BOOL16 WINAPI HiliteMenuItem16( HWND16 hWnd, HMENU16 hMenu, UINT16 wItemID,
UINT16 wHilite )
{
return HiliteMenuItem( hWnd, hMenu, wItemID, wHilite );
}
/**********************************************************************
* HiliteMenuItem (USER32.@)
*/
BOOL WINAPI HiliteMenuItem( HWND hWnd, HMENU hMenu, UINT wItemID,
......@@ -3836,15 +3812,6 @@ BOOL WINAPI DestroyMenu( HMENU hMenu )
/**********************************************************************
* GetSystemMenu (USER.156)
*/
HMENU16 WINAPI GetSystemMenu16( HWND16 hWnd, BOOL16 bRevert )
{
return GetSystemMenu( hWnd, bRevert );
}
/**********************************************************************
* GetSystemMenu (USER32.@)
*/
HMENU WINAPI GetSystemMenu( HWND hWnd, BOOL bRevert )
......@@ -3899,15 +3866,6 @@ HMENU WINAPI GetSystemMenu( HWND hWnd, BOOL bRevert )
/*******************************************************************
* SetSystemMenu (USER.280)
*/
BOOL16 WINAPI SetSystemMenu16( HWND16 hwnd, HMENU16 hMenu )
{
return SetSystemMenu( hwnd, hMenu );
}
/*******************************************************************
* SetSystemMenu (USER32.@)
*/
BOOL WINAPI SetSystemMenu( HWND hwnd, HMENU hMenu )
......@@ -3926,15 +3884,6 @@ BOOL WINAPI SetSystemMenu( HWND hwnd, HMENU hMenu )
/**********************************************************************
* GetMenu (USER.157)
*/
HMENU16 WINAPI GetMenu16( HWND16 hWnd )
{
return (HMENU16)GetMenu(hWnd);
}
/**********************************************************************
* GetMenu (USER32.@)
*/
HMENU WINAPI GetMenu( HWND hWnd )
......@@ -3946,15 +3895,6 @@ HMENU WINAPI GetMenu( HWND hWnd )
/**********************************************************************
* SetMenu (USER.158)
*/
BOOL16 WINAPI SetMenu16( HWND16 hWnd, HMENU16 hMenu )
{
return SetMenu( hWnd, hMenu );
}
/**********************************************************************
* SetMenu (USER32.@)
*/
BOOL WINAPI SetMenu( HWND hWnd, HMENU hMenu )
......@@ -4013,15 +3953,6 @@ HMENU WINAPI GetSubMenu( HMENU hMenu, INT nPos )
/**********************************************************************
* DrawMenuBar (USER.160)
*/
void WINAPI DrawMenuBar16( HWND16 hWnd )
{
DrawMenuBar( hWnd );
}
/**********************************************************************
* DrawMenuBar (USER32.@)
*/
BOOL WINAPI DrawMenuBar( HWND hWnd )
......@@ -4702,21 +4633,6 @@ BOOL WINAPI GetMenuItemRect (HWND hwnd, HMENU hMenu, UINT uItem,
return TRUE;
}
/**********************************************************************
* GetMenuItemRect (USER.665)
*/
BOOL16 WINAPI GetMenuItemRect16 (HWND16 hwnd, HMENU16 hMenu, UINT16 uItem,
LPRECT16 rect)
{
RECT r32;
BOOL res;
if (!rect) return FALSE;
res = GetMenuItemRect (hwnd, hMenu, uItem, &r32);
CONV_RECT32TO16 (&r32, rect);
return res;
}
/**********************************************************************
* SetMenuInfo (USER32.@)
......@@ -5037,43 +4953,3 @@ INT WINAPI TranslateAccelerator( HWND hWnd, HACCEL hAccel, LPMSG msg )
WARN_(accel)("couldn't translate accelerator key\n");
return 0;
}
/**********************************************************************
* TranslateAccelerator (USER.178)
*/
INT16 WINAPI TranslateAccelerator16( HWND16 hWnd, HACCEL16 hAccel, LPMSG16 msg )
{
LPACCEL16 lpAccelTbl;
int i;
if (msg == NULL)
{
WARN_(accel)("msg null; should hang here to be win compatible\n");
return 0;
}
if (!hAccel || !(lpAccelTbl = (LPACCEL16) LockResource16(hAccel)))
{
WARN_(accel)("invalid accel handle=%x\n", hAccel);
return 0;
}
if ((msg->message != WM_KEYDOWN &&
msg->message != WM_KEYUP &&
msg->message != WM_SYSKEYDOWN &&
msg->message != WM_SYSKEYUP &&
msg->message != WM_CHAR)) return 0;
TRACE_(accel)("TranslateAccelerators hAccel=%04x, hWnd=%04x,"
"msg->hwnd=%04x, msg->message=%04x, wParam=%04x, lParam=%lx\n",
hAccel,hWnd,msg->hwnd,msg->message,msg->wParam,msg->lParam);
i = 0;
do
{
if (translate_accelerator( hWnd, msg->message, msg->wParam, msg->lParam,
lpAccelTbl[i].fVirt, lpAccelTbl[i].key, lpAccelTbl[i].cmd ))
return 1;
} while ((lpAccelTbl[i++].fVirt & 0x80) == 0);
WARN_(accel)("couldn't translate accelerator key\n");
return 0;
}
......@@ -883,7 +883,7 @@ static void SCROLL_HandleKbdEvent( HWND hwnd, WPARAM wParam )
}
SendMessageW( GetParent(hwnd),
(GetWindowLongA( hwnd, GWL_STYLE ) & SBS_VERT) ? WM_VSCROLL : WM_HSCROLL,
msg, hwnd );
msg, (LPARAM)hwnd );
}
......@@ -974,7 +974,7 @@ void SCROLL_HandleScrollEvent( HWND hwnd, INT nBar, UINT msg, POINT pt)
if ((msg == WM_LBUTTONDOWN) || (msg == WM_SYSTIMER))
{
SendMessageA( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
SB_LINEUP, hwndCtl );
SB_LINEUP, (LPARAM)hwndCtl );
}
SetSystemTimer( hwnd, SCROLL_TIMER, (msg == WM_LBUTTONDOWN) ?
......@@ -993,7 +993,7 @@ void SCROLL_HandleScrollEvent( HWND hwnd, INT nBar, UINT msg, POINT pt)
if ((msg == WM_LBUTTONDOWN) || (msg == WM_SYSTIMER))
{
SendMessageA( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
SB_PAGEUP, hwndCtl );
SB_PAGEUP, (LPARAM)hwndCtl );
}
SetSystemTimer( hwnd, SCROLL_TIMER, (msg == WM_LBUTTONDOWN) ?
SCROLL_FIRST_DELAY : SCROLL_REPEAT_DELAY,
......@@ -1042,7 +1042,7 @@ void SCROLL_HandleScrollEvent( HWND hwnd, INT nBar, UINT msg, POINT pt)
SCROLL_TrackingPos );
SendMessageA( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
MAKEWPARAM( SB_THUMBTRACK, SCROLL_TrackingVal),
hwndCtl );
(LPARAM)hwndCtl );
if (!SCROLL_MovingThumb)
SCROLL_DrawMovingThumb( hdc, &rect, vertical,
arrowSize, thumbSize );
......@@ -1059,7 +1059,7 @@ void SCROLL_HandleScrollEvent( HWND hwnd, INT nBar, UINT msg, POINT pt)
if ((msg == WM_LBUTTONDOWN) || (msg == WM_SYSTIMER))
{
SendMessageA( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
SB_PAGEDOWN, hwndCtl );
SB_PAGEDOWN, (LPARAM)hwndCtl );
}
SetSystemTimer( hwnd, SCROLL_TIMER, (msg == WM_LBUTTONDOWN) ?
SCROLL_FIRST_DELAY : SCROLL_REPEAT_DELAY,
......@@ -1076,7 +1076,7 @@ void SCROLL_HandleScrollEvent( HWND hwnd, INT nBar, UINT msg, POINT pt)
if ((msg == WM_LBUTTONDOWN) || (msg == WM_SYSTIMER))
{
SendMessageA( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
SB_LINEDOWN, hwndCtl );
SB_LINEDOWN, (LPARAM)hwndCtl );
}
SetSystemTimer( hwnd, SCROLL_TIMER, (msg == WM_LBUTTONDOWN) ?
......@@ -1097,11 +1097,11 @@ void SCROLL_HandleScrollEvent( HWND hwnd, INT nBar, UINT msg, POINT pt)
UINT val = SCROLL_GetThumbVal( infoPtr, &rect, vertical,
trackThumbPos + lastMousePos - lastClickPos );
SendMessageA( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
MAKEWPARAM( SB_THUMBPOSITION, val ), hwndCtl );
MAKEWPARAM( SB_THUMBPOSITION, val ), (LPARAM)hwndCtl );
}
else
SendMessageA( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
SB_ENDSCROLL, hwndCtl );
SB_ENDSCROLL, (LPARAM)hwndCtl );
}
ReleaseDC( hwnd, hdc );
......@@ -1302,16 +1302,6 @@ static LRESULT WINAPI ScrollBarWndProc( HWND hwnd, UINT message, WPARAM wParam,
/*************************************************************************
* SetScrollInfo (USER.475)
*/
INT16 WINAPI SetScrollInfo16( HWND16 hwnd, INT16 nBar, const SCROLLINFO *info,
BOOL16 bRedraw )
{
return (INT16)SetScrollInfo( hwnd, nBar, info, bRedraw );
}
/*************************************************************************
* SetScrollInfo (USER32.@)
* SetScrollInfo can be used to set the position, upper bound,
* lower bound, and page size of a scrollbar control.
......@@ -1487,15 +1477,6 @@ done:
/*************************************************************************
* GetScrollInfo (USER.476)
*/
BOOL16 WINAPI GetScrollInfo16( HWND16 hwnd, INT16 nBar, LPSCROLLINFO info )
{
return GetScrollInfo( hwnd, nBar, info );
}
/*************************************************************************
* GetScrollInfo (USER32.@)
* GetScrollInfo can be used to retrieve the position, upper bound,
* lower bound, and page size of a scrollbar control.
......@@ -1528,16 +1509,6 @@ BOOL WINAPI GetScrollInfo(
/*************************************************************************
* SetScrollPos (USER.62)
*/
INT16 WINAPI SetScrollPos16( HWND16 hwnd, INT16 nBar, INT16 nPos,
BOOL16 bRedraw )
{
return (INT16)SetScrollPos( hwnd, nBar, nPos, bRedraw );
}
/*************************************************************************
* SetScrollPos (USER32.@)
*
* RETURNS
......@@ -1569,15 +1540,6 @@ BOOL bRedraw /* [in] Should scrollbar be redrawn afterwards ? */ )
/*************************************************************************
* GetScrollPos (USER.63)
*/
INT16 WINAPI GetScrollPos16( HWND16 hwnd, INT16 nBar )
{
return (INT16)GetScrollPos( hwnd, nBar );
}
/*************************************************************************
* GetScrollPos (USER32.@)
*
* RETURNS
......@@ -1600,18 +1562,6 @@ INT nBar /* [in] One of SB_HORZ, SB_VERT, or SB_CTL */)
/*************************************************************************
* SetScrollRange (USER.64)
*/
void WINAPI SetScrollRange16( HWND16 hwnd, INT16 nBar,
INT16 MinVal, INT16 MaxVal, BOOL16 bRedraw )
{
/* Invalid range -> range is set to (0,0) */
if ((INT)MaxVal - (INT)MinVal > 0x7fff) MinVal = MaxVal = 0;
SetScrollRange( hwnd, nBar, MinVal, MaxVal, bRedraw );
}
/*************************************************************************
* SetScrollRange (USER32.@)
*
* RETURNS STD
......@@ -1672,20 +1622,6 @@ INT SCROLL_SetNCSbState(HWND hwnd, int vMin, int vMax, int vPos,
/*************************************************************************
* GetScrollRange (USER.65)
*/
BOOL16 WINAPI GetScrollRange16( HWND16 hwnd, INT16 nBar,
LPINT16 lpMin, LPINT16 lpMax)
{
INT min, max;
BOOL16 ret = GetScrollRange( hwnd, nBar, &min, &max );
if (lpMin) *lpMin = min;
if (lpMax) *lpMax = max;
return ret;
}
/*************************************************************************
* GetScrollRange (USER32.@)
*
* RETURNS STD
......@@ -1786,16 +1722,6 @@ END:
/*************************************************************************
* ShowScrollBar (USER.267)
*/
void WINAPI ShowScrollBar16( HWND16 hwnd, INT16 nBar, BOOL16 fShow )
{
SCROLL_ShowScrollBar( hwnd, nBar, (nBar == SB_VERT) ? 0 : fShow,
(nBar == SB_HORZ) ? 0 : fShow );
}
/*************************************************************************
* ShowScrollBar (USER32.@)
*
* RETURNS STD
......@@ -1812,15 +1738,6 @@ BOOL fShow /* [in] TRUE = show, FALSE = hide */)
/*************************************************************************
* EnableScrollBar (USER.482)
*/
BOOL16 WINAPI EnableScrollBar16( HWND16 hwnd, INT16 nBar, UINT16 flags )
{
return EnableScrollBar( hwnd, nBar, flags );
}
/*************************************************************************
* EnableScrollBar (USER32.@)
*/
BOOL WINAPI EnableScrollBar( HWND hwnd, INT nBar, UINT flags )
......
......@@ -27,6 +27,7 @@ C_SRCS = \
text.c \
thunk.c \
user_main.c \
wnd16.c \
wsprintf.c
RC_SRCS = \
......
......@@ -99,35 +99,30 @@ typedef struct
extern BOOL COMBO_FlipListbox( LPHEADCOMBO, BOOL, BOOL );
/* Dialog info structure.
* This structure is stored into the window extra bytes (cbWndExtra).
* sizeof(DIALOGINFO) must be <= DLGWINDOWEXTRA (=30).
*/
#include "pshpack1.h"
/* Dialog info structure */
typedef struct
{
INT msgResult; /* 00 Last message result */
HWINDOWPROC dlgProc; /* 04 Dialog procedure */
LONG userInfo; /* 08 User information (for DWL_USER) */
/* implementation-dependent part */
HWND16 hwndFocus; /* 0c Current control with focus */
HFONT16 hUserFont; /* 0e Dialog font */
HMENU16 hMenu; /* 10 Dialog menu */
WORD xBaseUnit; /* 12 Dialog units (depends on the font) */
WORD yBaseUnit; /* 14 */
INT idResult; /* 16 EndDialog() result / default pushbutton ID */
UINT16 flags; /* 1a EndDialog() called for this dialog */
HGLOBAL16 hDialogHeap; /* 1c */
HWND hwndFocus; /* Current control with focus */
HFONT hUserFont; /* Dialog font */
HMENU hMenu; /* Dialog menu */
UINT xBaseUnit; /* Dialog units (depends on the font) */
UINT yBaseUnit;
INT idResult; /* EndDialog() result / default pushbutton ID */
UINT flags; /* EndDialog() called for this dialog */
HGLOBAL16 hDialogHeap;
} DIALOGINFO;
#include "poppack.h"
#define DF_END 0x0001
#define DF_OWNERENABLED 0x0002
/* offset of DIALOGINFO ptr in dialog extra bytes */
#define DWL_WINE_DIALOGINFO (DWL_USER+sizeof(ULONG_PTR))
inline static DIALOGINFO *DIALOG_get_info( HWND hwnd )
{
return (DIALOGINFO *)GetWindowLongW( hwnd, DWL_WINE_DIALOGINFO );
}
extern BOOL DIALOG_Init(void);
#endif /* __WINE_CONTROLS_H */
......@@ -20,9 +20,10 @@ DEFAULT_DEBUG_CHANNEL(msg);
/***********************************************************************
* SendMessage (USER.111)
*/
LRESULT WINAPI SendMessage16( HWND16 hwnd, UINT16 msg, WPARAM16 wparam, LPARAM lparam )
LRESULT WINAPI SendMessage16( HWND16 hwnd16, UINT16 msg, WPARAM16 wparam, LPARAM lparam )
{
LRESULT result;
HWND hwnd = WIN_Handle32( hwnd16 );
if (hwnd != HWND_BROADCAST &&
GetWindowThreadProcessId( hwnd, NULL ) == GetCurrentThreadId())
......@@ -37,12 +38,16 @@ LRESULT WINAPI SendMessage16( HWND16 hwnd, UINT16 msg, WPARAM16 wparam, LPARAM l
if ((cwp = SEGPTR_NEW(CWPSTRUCT16)))
{
cwp->hwnd = hwnd;
cwp->hwnd = hwnd16;
cwp->message = msg;
cwp->wParam = wparam;
cwp->lParam = lparam;
HOOK_CallHooks16( WH_CALLWNDPROC, HC_ACTION, 1, SEGPTR_GET(cwp) );
hwnd = cwp->hwnd;
if (cwp->hwnd != hwnd16)
{
hwnd16 = cwp->hwnd;
hwnd = WIN_Handle32( hwnd16 );
}
msg = cwp->message;
wparam = cwp->wParam;
lparam = cwp->lParam;
......@@ -50,10 +55,10 @@ LRESULT WINAPI SendMessage16( HWND16 hwnd, UINT16 msg, WPARAM16 wparam, LPARAM l
}
}
if (!(winproc = (WNDPROC16)GetWindowLong16( hwnd, GWL_WNDPROC ))) return 0;
if (!(winproc = (WNDPROC16)GetWindowLong16( hwnd16, GWL_WNDPROC ))) return 0;
SPY_EnterMessage( SPY_SENDMESSAGE16, hwnd, msg, wparam, lparam );
result = CallWindowProc16( (WNDPROC16)winproc, hwnd, msg, wparam, lparam );
result = CallWindowProc16( (WNDPROC16)winproc, hwnd16, msg, wparam, lparam );
SPY_ExitMessage( SPY_RESULT_OK16, hwnd, msg, result, wparam, lparam );
}
else /* map to 32-bit unicode for inter-thread/process message */
......@@ -73,10 +78,11 @@ LRESULT WINAPI SendMessage16( HWND16 hwnd, UINT16 msg, WPARAM16 wparam, LPARAM l
/***********************************************************************
* PostMessage (USER.110)
*/
BOOL16 WINAPI PostMessage16( HWND16 hwnd, UINT16 msg, WPARAM16 wparam, LPARAM lparam )
BOOL16 WINAPI PostMessage16( HWND16 hwnd16, UINT16 msg, WPARAM16 wparam, LPARAM lparam )
{
WPARAM wparam32;
UINT msg32;
HWND hwnd = WIN_Handle32( hwnd16 );
switch (WINPROC_MapMsg16To32W( hwnd, msg, wparam, &msg32, &wparam32, &lparam ))
{
......@@ -136,15 +142,16 @@ void WINAPI ReplyMessage16( LRESULT result )
/***********************************************************************
* PeekMessage32 (USER.819)
*/
BOOL16 WINAPI PeekMessage32_16( MSG32_16 *msg16, HWND16 hwnd,
BOOL16 WINAPI PeekMessage32_16( MSG32_16 *msg16, HWND16 hwnd16,
UINT16 first, UINT16 last, UINT16 flags,
BOOL16 wHaveParamHigh )
{
MSG msg;
HWND hwnd = WIN_Handle32( hwnd16 );
if (!PeekMessageW( &msg, hwnd, first, last, flags )) return FALSE;
msg16->msg.hwnd = msg.hwnd;
msg16->msg.hwnd = WIN_Handle16( msg.hwnd );
msg16->msg.lParam = msg.lParam;
msg16->msg.time = msg.time;
msg16->msg.pt.x = (INT16)msg.pt.x;
......@@ -170,15 +177,16 @@ BOOL16 WINAPI PeekMessage16( MSG16 *msg, HWND16 hwnd,
/***********************************************************************
* GetMessage32 (USER.820)
*/
BOOL16 WINAPI GetMessage32_16( MSG32_16 *msg16, HWND16 hwnd, UINT16 first,
BOOL16 WINAPI GetMessage32_16( MSG32_16 *msg16, HWND16 hwnd16, UINT16 first,
UINT16 last, BOOL16 wHaveParamHigh )
{
MSG msg;
HWND hwnd = WIN_Handle32( hwnd16 );
do
{
GetMessageW( &msg, hwnd, first, last );
msg16->msg.hwnd = msg.hwnd;
msg16->msg.hwnd = WIN_Handle16( msg.hwnd );
msg16->msg.lParam = msg.lParam;
msg16->msg.time = msg.time;
msg16->msg.pt.x = (INT16)msg.pt.x;
......@@ -212,7 +220,7 @@ BOOL16 WINAPI TranslateMessage32_16( const MSG32_16 *msg, BOOL16 wHaveParamHigh
{
MSG msg32;
msg32.hwnd = msg->msg.hwnd;
msg32.hwnd = WIN_Handle32( msg->msg.hwnd );
msg32.message = msg->msg.message;
msg32.wParam = MAKEWPARAM( msg->msg.wParam, wHaveParamHigh ? msg->wParamHigh : 0 );
msg32.lParam = msg->msg.lParam;
......@@ -238,6 +246,7 @@ LONG WINAPI DispatchMessage16( const MSG16* msg )
WNDPROC16 winproc;
LONG retval;
int painting;
HWND hwnd = WIN_Handle32( msg->hwnd );
/* Process timer messages */
if ((msg->message == WM_TIMER) || (msg->message == WM_SYSTIMER))
......@@ -247,7 +256,7 @@ LONG WINAPI DispatchMessage16( const MSG16* msg )
/* before calling window proc, verify whether timer is still valid;
there's a slim chance that the application kills the timer
between GetMessage and DispatchMessage API calls */
if (!TIMER_IsTimerValid(msg->hwnd, (UINT) msg->wParam, (HWINDOWPROC) msg->lParam))
if (!TIMER_IsTimerValid(hwnd, (UINT) msg->wParam, (HWINDOWPROC) msg->lParam))
return 0; /* invalid winproc */
return CallWindowProc16( (WNDPROC16)msg->lParam, msg->hwnd,
......@@ -255,7 +264,7 @@ LONG WINAPI DispatchMessage16( const MSG16* msg )
}
}
if (!(wndPtr = WIN_FindWndPtr( msg->hwnd ))) return 0;
if (!(wndPtr = WIN_FindWndPtr( hwnd ))) return 0;
if (!wndPtr->winproc)
{
WIN_ReleaseWndPtr( wndPtr );
......@@ -266,23 +275,24 @@ LONG WINAPI DispatchMessage16( const MSG16* msg )
if (painting) wndPtr->flags |= WIN_NEEDS_BEGINPAINT;
WIN_ReleaseWndPtr( wndPtr );
SPY_EnterMessage( SPY_DISPATCHMESSAGE16, msg->hwnd, msg->message, msg->wParam, msg->lParam );
SPY_EnterMessage( SPY_DISPATCHMESSAGE16, hwnd, msg->message, msg->wParam, msg->lParam );
retval = CallWindowProc16( winproc, msg->hwnd, msg->message, msg->wParam, msg->lParam );
SPY_ExitMessage( SPY_RESULT_OK16, msg->hwnd, msg->message, retval, msg->wParam, msg->lParam );
SPY_ExitMessage( SPY_RESULT_OK16, hwnd, msg->message, retval, msg->wParam, msg->lParam );
if (!painting) return retval;
if ((wndPtr = WIN_FindWndPtr( msg->hwnd )))
if ((wndPtr = WIN_FindWndPtr( hwnd )))
{
if ((wndPtr->flags & WIN_NEEDS_BEGINPAINT) && wndPtr->hrgnUpdate)
{
ERR( "BeginPaint not called on WM_PAINT for hwnd %04x!\n", msg->hwnd );
wndPtr->flags &= ~WIN_NEEDS_BEGINPAINT;
WIN_ReleaseWndPtr( wndPtr );
/* Validate the update region to avoid infinite WM_PAINT loop */
RedrawWindow( wndPtr->hwndSelf, NULL, 0,
RedrawWindow( hwnd, NULL, 0,
RDW_NOFRAME | RDW_VALIDATE | RDW_NOCHILDREN | RDW_NOINTERNALPAINT );
}
WIN_ReleaseWndPtr( wndPtr );
else WIN_ReleaseWndPtr( wndPtr );
}
return retval;
}
......@@ -299,7 +309,7 @@ LONG WINAPI DispatchMessage32_16( const MSG32_16 *msg16, BOOL16 wHaveParamHigh )
{
MSG msg;
msg.hwnd = msg16->msg.hwnd;
msg.hwnd = WIN_Handle32( msg16->msg.hwnd );
msg.message = msg16->msg.message;
msg.wParam = MAKEWPARAM( msg16->msg.wParam, msg16->wParamHigh );
msg.lParam = msg16->msg.lParam;
......@@ -374,3 +384,38 @@ BOOL16 WINAPI GetInputState16(void)
{
return GetInputState();
}
/**********************************************************************
* TranslateAccelerator (USER.178)
*/
INT16 WINAPI TranslateAccelerator16( HWND16 hwnd, HACCEL16 hAccel, LPMSG16 msg )
{
MSG msg32;
if (!msg) return 0;
msg32.message = msg->message;
/* msg32.hwnd not used */
msg32.wParam = msg->wParam;
msg32.lParam = msg->lParam;
return TranslateAccelerator( WIN_Handle32(hwnd), hAccel, &msg32 );
}
/**********************************************************************
* TranslateMDISysAccel (USER.451)
*/
BOOL16 WINAPI TranslateMDISysAccel16( HWND16 hwndClient, LPMSG16 msg )
{
if (msg->message == WM_KEYDOWN || msg->message == WM_SYSKEYDOWN)
{
MSG msg32;
msg32.hwnd = WIN_Handle32(msg->hwnd);
msg32.message = msg->message;
msg32.wParam = msg->wParam;
msg32.lParam = msg->lParam;
/* MDICLIENTINFO is still the same for win32 and win16 ... */
return TranslateMDISysAccel( WIN_Handle32(hwndClient), &msg32 );
}
return 0;
}
......@@ -8,6 +8,7 @@
#include "windef.h"
#include "wingdi.h"
#include "wine/winuser16.h"
#include "win.h"
#include "callback.h"
/* ### start build ### */
......@@ -33,7 +34,7 @@ BOOL16 WINAPI EnumWindows16( WNDENUMPROC16 func, LPARAM lParam )
BOOL16 WINAPI EnumChildWindows16( HWND16 parent, WNDENUMPROC16 func, LPARAM lParam )
{
DECL_THUNK( thunk, func, THUNK_CallTo16_word_wl );
return EnumChildWindows( parent, (WNDENUMPROC)&thunk, lParam );
return EnumChildWindows( WIN_Handle32(parent), (WNDENUMPROC)&thunk, lParam );
}
......
......@@ -22,7 +22,7 @@ rsrc resources/version16.res
16 pascal16 ClipCursor(ptr) ClipCursor16
17 pascal16 GetCursorPos(ptr) GetCursorPos16
18 pascal16 SetCapture(word) SetCapture16
19 pascal16 ReleaseCapture() ReleaseCapture
19 pascal16 ReleaseCapture() ReleaseCapture16
20 pascal16 SetDoubleClickTime(word) SetDoubleClickTime16
21 pascal16 GetDoubleClickTime() GetDoubleClickTime16
22 pascal16 SetFocus(word) SetFocus16
......
......@@ -651,6 +651,10 @@ static BOOL fixup_flags( WINDOWPOS *winpos )
/* Check hwndInsertAfter */
/* fix sign extension */
if (winpos->hwndInsertAfter == (HWND)0xffff) winpos->hwndInsertAfter = HWND_TOPMOST;
else if (winpos->hwndInsertAfter == (HWND)0xfffe) winpos->hwndInsertAfter = HWND_NOTOPMOST;
/* FIXME: TOPMOST not supported yet */
if ((winpos->hwndInsertAfter == HWND_TOPMOST) ||
(winpos->hwndInsertAfter == HWND_NOTOPMOST)) winpos->hwndInsertAfter = HWND_TOP;
......@@ -928,7 +932,7 @@ UINT WINPOS_MinMaximize( HWND hwnd, UINT cmd, LPRECT rect )
size.x = wndPtr->rectWindow.left;
size.y = wndPtr->rectWindow.top;
if (!HOOK_CallHooksA(WH_CBT, HCBT_MINMAX, wndPtr->hwndSelf, cmd))
if (!HOOK_CallHooksA(WH_CBT, HCBT_MINMAX, (WPARAM)wndPtr->hwndSelf, cmd))
{
if( wndPtr->dwStyle & WS_MINIMIZE )
{
......@@ -1649,7 +1653,7 @@ static LONG start_size_move( HWND hwnd, WPARAM wParam, POINT *capturePoint, LONG
*capturePoint = pt;
}
SetCursorPos( pt.x, pt.y );
NC_HandleSetCursor( hwnd, hwnd, MAKELONG( hittest, WM_MOUSEMOVE ));
NC_HandleSetCursor( hwnd, (WPARAM)hwnd, MAKELONG( hittest, WM_MOUSEMOVE ));
return hittest;
}
......@@ -1901,7 +1905,7 @@ void X11DRV_SysCommandSizeMove( HWND hwnd, WPARAM wParam )
}
wine_tsx11_unlock();
if (HOOK_CallHooksA( WH_CBT, HCBT_MOVESIZE, hwnd, (LPARAM)&sizingRect )) moved = FALSE;
if (HOOK_CallHooksA( WH_CBT, HCBT_MOVESIZE, (WPARAM)hwnd, (LPARAM)&sizingRect )) moved = FALSE;
SendMessageA( hwnd, WM_EXITSIZEMOVE, 0, 0 );
SendMessageA( hwnd, WM_SETVISIBLE, !IsIconic(hwnd), 0L);
......
......@@ -62,7 +62,7 @@ typedef struct
RECT16 rectNormal;
POINT16 ptIconPos;
POINT16 ptMaxPos;
HWND16 hwndIconTitle;
HWND hwndIconTitle;
} INTERNALPOS, *LPINTERNALPOS;
/* WND flags values */
......@@ -107,6 +107,12 @@ inline static HWND16 WIN_Handle16( HWND hwnd )
return LOWORD(hwnd);
}
inline static WND *WIN_FindWndPtr16( HWND16 hwnd )
{
/* don't bother with full conversion */
return WIN_FindWndPtr( (HWND)(ULONG_PTR)hwnd );
}
extern HWND CARET_GetHwnd(void);
extern void CARET_GetRect(LPRECT lprc); /* windows/caret.c */
......
......@@ -52,10 +52,10 @@ extern INT WINPROC_MapMsg32ATo32W( HWND hwnd, UINT msg, WPARAM *pwparam,
LPARAM *plparam );
extern INT WINPROC_MapMsg32WTo32A( HWND hwnd, UINT msg, WPARAM *pwparam,
LPARAM *plparam );
extern INT WINPROC_MapMsg16To32A( UINT16 msg16, WPARAM16 wParam16,
extern INT WINPROC_MapMsg16To32A( HWND hwnd, UINT16 msg16, WPARAM16 wParam16,
UINT *pmsg32, WPARAM *pwparam32,
LPARAM *plparam );
extern INT WINPROC_MapMsg16To32W( HWND16, UINT16 msg16, WPARAM16 wParam16,
extern INT WINPROC_MapMsg16To32W( HWND hwnd, UINT16 msg16, WPARAM16 wParam16,
UINT *pmsg32, WPARAM *pwparam32,
LPARAM *plparam );
extern INT WINPROC_MapMsg32ATo16( HWND hwnd, UINT msg32,
......@@ -68,9 +68,9 @@ extern LRESULT WINPROC_UnmapMsg32ATo32W( HWND hwnd, UINT msg, WPARAM wParam,
LPARAM lParam, LRESULT result );
extern void WINPROC_UnmapMsg32WTo32A( HWND hwnd, UINT msg, WPARAM wParam,
LPARAM lParam );
extern LRESULT WINPROC_UnmapMsg16To32A( HWND16 hwnd, UINT msg, WPARAM wParam,
extern LRESULT WINPROC_UnmapMsg16To32A( HWND hwnd, UINT msg, WPARAM wParam,
LPARAM lParam, LRESULT result );
extern LRESULT WINPROC_UnmapMsg16To32W( HWND16 hwnd, UINT msg, WPARAM wParam,
extern LRESULT WINPROC_UnmapMsg16To32W( HWND hwnd, UINT msg, WPARAM wParam,
LPARAM lParam, LRESULT result );
extern void WINPROC_UnmapMsg32ATo16( HWND hwnd, UINT msg, WPARAM wParam,
LPARAM lParam, MSGPARAM16* pm16 );
......
......@@ -1070,12 +1070,9 @@ typedef struct {
#define GWL_USERDATA (-21)
#define GWL_EXSTYLE (-20)
#define GWL_STYLE (-16)
#define GWW_ID (-12)
#define GWL_ID GWW_ID
#define GWW_HWNDPARENT (-8)
#define GWL_HWNDPARENT GWW_HWNDPARENT
#define GWW_HINSTANCE (-6)
#define GWL_HINSTANCE GWW_HINSTANCE
#define GWL_ID (-12)
#define GWL_HWNDPARENT (-8)
#define GWL_HINSTANCE (-6)
#define GWL_WNDPROC (-4)
#define DWL_MSGRESULT 0
#define DWL_DLGPROC 4
......
......@@ -129,15 +129,6 @@ static void CARET_KillTimer(void)
/*****************************************************************
* CreateCaret (USER.163)
*/
void WINAPI CreateCaret16( HWND16 hwnd, HBITMAP16 bitmap,
INT16 width, INT16 height )
{
CreateCaret( hwnd, bitmap, width, height );
}
/*****************************************************************
* CreateCaret (USER32.@)
*/
BOOL WINAPI CreateCaret( HWND hwnd, HBITMAP bitmap,
......@@ -239,15 +230,6 @@ BOOL WINAPI SetCaretPos( INT x, INT y)
/*****************************************************************
* HideCaret (USER.166)
*/
void WINAPI HideCaret16( HWND16 hwnd )
{
HideCaret( hwnd );
}
/*****************************************************************
* HideCaret (USER32.@)
*/
BOOL WINAPI HideCaret( HWND hwnd )
......@@ -266,15 +248,6 @@ BOOL WINAPI HideCaret( HWND hwnd )
/*****************************************************************
* ShowCaret (USER.167)
*/
void WINAPI ShowCaret16( HWND16 hwnd )
{
ShowCaret( hwnd );
}
/*****************************************************************
* ShowCaret (USER32.@)
*/
BOOL WINAPI ShowCaret( HWND hwnd )
......
......@@ -697,14 +697,6 @@ BOOL WINAPI UnregisterClassW( LPCWSTR className, HINSTANCE hInstance )
return CLASS_FreeClass( classPtr );
}
/***********************************************************************
* GetClassWord (USER.129)
*/
WORD WINAPI GetClassWord16( HWND16 hwnd, INT16 offset )
{
return GetClassWord( hwnd, offset );
}
/***********************************************************************
* GetClassWord (USER32.@)
......@@ -762,15 +754,15 @@ LONG WINAPI GetClassLong16( HWND16 hwnd, INT16 offset )
switch( offset )
{
case GCL_WNDPROC:
if (!(wndPtr = WIN_FindWndPtr( hwnd ))) return 0;
if (!(wndPtr = WIN_FindWndPtr16( hwnd ))) return 0;
ret = (LONG)CLASS_GetProc( wndPtr->class, WIN_PROC_16 );
WIN_ReleaseWndPtr(wndPtr);
return ret;
case GCL_MENUNAME:
ret = GetClassLongA( hwnd, offset );
ret = GetClassLongA( WIN_Handle32(hwnd), offset );
return (LONG)SEGPTR_GET( (void *)ret );
default:
return GetClassLongA( hwnd, offset );
return GetClassLongA( WIN_Handle32(hwnd), offset );
}
}
......@@ -868,15 +860,6 @@ LONG WINAPI GetClassLongW( HWND hwnd, INT offset )
/***********************************************************************
* SetClassWord (USER.130)
*/
WORD WINAPI SetClassWord16( HWND16 hwnd, INT16 offset, WORD newval )
{
return SetClassWord( hwnd, offset, newval );
}
/***********************************************************************
* SetClassWord (USER32.@)
*/
WORD WINAPI SetClassWord( HWND hwnd, INT offset, WORD newval )
......@@ -939,14 +922,15 @@ LONG WINAPI SetClassLong16( HWND16 hwnd, INT16 offset, LONG newval )
switch(offset)
{
case GCL_WNDPROC:
if (!(wndPtr = WIN_FindWndPtr(hwnd))) return 0;
if (!(wndPtr = WIN_FindWndPtr16(hwnd))) return 0;
retval = (LONG)CLASS_SetProc( wndPtr->class, (WNDPROC)newval, WIN_PROC_16 );
WIN_ReleaseWndPtr(wndPtr);
return retval;
case GCL_MENUNAME:
return SetClassLongA( hwnd, offset, (LONG)MapSL(newval) );
newval = (LONG)MapSL( newval );
/* fall through */
default:
return SetClassLongA( hwnd, offset, newval );
return SetClassLongA( WIN_Handle32(hwnd), offset, newval );
}
}
......@@ -1052,15 +1036,6 @@ LONG WINAPI SetClassLongW( HWND hwnd, INT offset, LONG newval )
/***********************************************************************
* GetClassName (USER.58)
*/
INT16 WINAPI GetClassName16( HWND16 hwnd, LPSTR buffer, INT16 count )
{
return GetClassNameA( hwnd, buffer, count );
}
/***********************************************************************
* GetClassNameA (USER32.@)
*/
INT WINAPI GetClassNameA( HWND hwnd, LPSTR buffer, INT count )
......
......@@ -711,15 +711,6 @@ static UINT CLIPBOARD_EnumClipboardFormats( UINT wFormat )
**************************************************************************/
/**************************************************************************
* OpenClipboard (USER.137)
*/
BOOL16 WINAPI OpenClipboard16( HWND16 hWnd )
{
return OpenClipboard( hWnd );
}
/**************************************************************************
* OpenClipboard (USER32.@)
*
* Note: Netscape uses NULL hWnd to open the clipboard.
......@@ -817,17 +808,6 @@ BOOL WINAPI EmptyClipboard(void)
/**************************************************************************
* GetClipboardOwner (USER.140)
* FIXME: Can't return the owner if the clipbard is owned by an external app
*/
HWND16 WINAPI GetClipboardOwner16(void)
{
TRACE("()\n");
return hWndClipOwner;
}
/**************************************************************************
* GetClipboardOwner (USER32.@)
* FIXME: Can't return the owner if the clipbard is owned by an external app
*/
......@@ -1300,16 +1280,6 @@ INT WINAPI GetClipboardFormatNameW( UINT wFormat, LPWSTR retStr, INT maxlen )
/**************************************************************************
* SetClipboardViewer (USER.147)
*/
HWND16 WINAPI SetClipboardViewer16( HWND16 hWnd )
{
TRACE("(%04x)\n", hWnd);
return SetClipboardViewer( hWnd );
}
/**************************************************************************
* SetClipboardViewer (USER32.@)
*/
HWND WINAPI SetClipboardViewer( HWND hWnd )
......@@ -1324,16 +1294,6 @@ HWND WINAPI SetClipboardViewer( HWND hWnd )
/**************************************************************************
* GetClipboardViewer (USER.148)
*/
HWND16 WINAPI GetClipboardViewer16(void)
{
TRACE("()\n");
return hWndViewer;
}
/**************************************************************************
* GetClipboardViewer (USER32.@)
*/
HWND WINAPI GetClipboardViewer(void)
......@@ -1344,15 +1304,6 @@ HWND WINAPI GetClipboardViewer(void)
/**************************************************************************
* ChangeClipboardChain (USER.149)
*/
BOOL16 WINAPI ChangeClipboardChain16(HWND16 hWnd, HWND16 hWndNext)
{
return ChangeClipboardChain(hWnd, hWndNext);
}
/**************************************************************************
* ChangeClipboardChain (USER32.@)
*/
BOOL WINAPI ChangeClipboardChain(HWND hWnd, HWND hWndNext)
......@@ -1404,17 +1355,6 @@ BOOL WINAPI IsClipboardFormatAvailable( UINT wFormat )
/**************************************************************************
* GetOpenClipboardWindow (USER.248)
* FIXME: This wont work if an external app owns the selection
*/
HWND16 WINAPI GetOpenClipboardWindow16(void)
{
TRACE("()\n");
return hWndClipWindow;
}
/**************************************************************************
* GetOpenClipboardWindow (USER32.@)
* FIXME: This wont work if an external app owns the selection
*/
......@@ -1426,34 +1366,17 @@ HWND WINAPI GetOpenClipboardWindow(void)
/**************************************************************************
* GetPriorityClipboardFormat (USER.402)
*/
INT16 WINAPI GetPriorityClipboardFormat16( UINT16 *lpPriorityList, INT16 nCount)
{
FIXME("(%p,%d): stub\n", lpPriorityList, nCount );
return 0;
}
/**************************************************************************
* GetPriorityClipboardFormat (USER32.@)
*/
INT WINAPI GetPriorityClipboardFormat( UINT *lpPriorityList, INT nCount )
INT WINAPI GetPriorityClipboardFormat( UINT *list, INT nCount )
{
int Counter;
int i;
TRACE("()\n");
if(CountClipboardFormats() == 0)
{
return 0;
}
for(Counter = 0; Counter <= nCount; Counter++)
{
if(IsClipboardFormatAvailable(*(lpPriorityList+sizeof(INT)*Counter)))
return *(lpPriorityList+sizeof(INT)*Counter);
}
if(CountClipboardFormats() == 0) return 0;
for (i = 0; i < nCount; i++)
if (IsClipboardFormatAvailable( list[i] )) return list[i];
return -1;
}
......
......@@ -368,15 +368,6 @@ INT DCE_ExcludeRgn( HDC hDC, HWND hwnd, HRGN hRgn )
/***********************************************************************
* GetDCEx (USER.359)
*/
HDC16 WINAPI GetDCEx16( HWND16 hwnd, HRGN16 hrgnClip, DWORD flags )
{
return (HDC16)GetDCEx( hwnd, hrgnClip, flags );
}
/***********************************************************************
* GetDCEx (USER32.@)
*
* Unimplemented flags: DCX_LOCKWINDOWUPDATE
......@@ -532,15 +523,6 @@ END:
/***********************************************************************
* GetDC (USER.66)
*/
HDC16 WINAPI GetDC16( HWND16 hwnd )
{
return (HDC16)GetDC( hwnd );
}
/***********************************************************************
* GetDC (USER32.@)
* RETURNS
* :Handle to DC
......@@ -556,15 +538,6 @@ HDC WINAPI GetDC(
/***********************************************************************
* GetWindowDC (USER.67)
*/
HDC16 WINAPI GetWindowDC16( HWND16 hwnd )
{
return GetDCEx16( hwnd, 0, DCX_USESTYLE | DCX_WINDOW );
}
/***********************************************************************
* GetWindowDC (USER32.@)
*/
HDC WINAPI GetWindowDC( HWND hwnd )
......@@ -574,15 +547,6 @@ HDC WINAPI GetWindowDC( HWND hwnd )
/***********************************************************************
* ReleaseDC (USER.68)
*/
INT16 WINAPI ReleaseDC16( HWND16 hwnd, HDC16 hdc )
{
return (INT16)ReleaseDC( hwnd, hdc );
}
/***********************************************************************
* ReleaseDC (USER32.@)
*
* RETURNS
......@@ -671,15 +635,6 @@ BOOL16 WINAPI DCHook16( HDC16 hDC, WORD code, DWORD data, LPARAM lParam )
/**********************************************************************
* WindowFromDC (USER.117)
*/
HWND16 WINAPI WindowFromDC16( HDC16 hDC )
{
return (HWND16)WindowFromDC( hDC );
}
/**********************************************************************
* WindowFromDC (USER32.@)
*/
HWND WINAPI WindowFromDC( HDC hDC )
......@@ -700,14 +655,6 @@ HWND WINAPI WindowFromDC( HDC hDC )
/***********************************************************************
* LockWindowUpdate (USER.294)
*/
BOOL16 WINAPI LockWindowUpdate16( HWND16 hwnd )
{
return LockWindowUpdate( hwnd );
}
/***********************************************************************
* LockWindowUpdate (USER32.@)
*/
BOOL WINAPI LockWindowUpdate( HWND hwnd )
......
......@@ -15,6 +15,21 @@
/***********************************************************************
* DEFDLG_GetDlgProc
*/
static WNDPROC DEFDLG_GetDlgProc( HWND hwnd )
{
WNDPROC ret = 0;
WND * wndPtr = WIN_FindWndPtr( hwnd );
if (wndPtr)
{
ret = *(WNDPROC *)((char *)wndPtr->wExtra + DWL_DLGPROC);
WIN_ReleaseWndPtr(wndPtr);
}
return ret;
}
/***********************************************************************
* DEFDLG_SetFocus
*
* Set the focus to a control of the dialog, selecting the text if
......@@ -41,14 +56,11 @@ static void DEFDLG_SetFocus( HWND hwndDlg, HWND hwndCtrl )
static void DEFDLG_SaveFocus( HWND hwnd )
{
DIALOGINFO *infoPtr;
WND *wndPtr;
HWND hwndFocus = GetFocus();
if (!hwndFocus || !IsChild( hwnd, hwndFocus )) return;
if (!(wndPtr = WIN_FindWndPtr( hwnd ))) return;
infoPtr = (DIALOGINFO *)&wndPtr->wExtra;
if (!(infoPtr = DIALOG_get_info( hwnd ))) return;
infoPtr->hwndFocus = hwndFocus;
WIN_ReleaseWndPtr( wndPtr );
/* Remove default button */
}
......@@ -59,24 +71,18 @@ static void DEFDLG_SaveFocus( HWND hwnd )
static void DEFDLG_RestoreFocus( HWND hwnd )
{
DIALOGINFO *infoPtr;
WND *wndPtr;
if (IsIconic( hwnd )) return;
if (!(wndPtr = WIN_FindWndPtr( hwnd ))) return;
infoPtr = (DIALOGINFO *)&wndPtr->wExtra;
if (IsWindow( infoPtr->hwndFocus ))
if (!(infoPtr = DIALOG_get_info( hwnd ))) return;
if (!IsWindow( infoPtr->hwndFocus )) return;
/* Don't set the focus back to controls if EndDialog is already called.*/
if (!(infoPtr->flags & DF_END))
{
/* Don't set the focus back to controls if EndDialog is already called.*/
if (!(infoPtr->flags & DF_END))
{
WIN_ReleaseWndPtr( wndPtr );
DEFDLG_SetFocus( hwnd, infoPtr->hwndFocus );
return;
}
/* This used to set infoPtr->hwndFocus to NULL for no apparent reason,
sometimes losing focus when receiving WM_SETFOCUS messages. */
DEFDLG_SetFocus( hwnd, infoPtr->hwndFocus );
return;
}
WIN_ReleaseWndPtr( wndPtr );
/* This used to set infoPtr->hwndFocus to NULL for no apparent reason,
sometimes losing focus when receiving WM_SETFOCUS messages. */
}
......@@ -138,38 +144,33 @@ static LRESULT DEFDLG_Proc( HWND hwnd, UINT msg, WPARAM wParam,
switch(msg)
{
case WM_ERASEBKGND:
FillWindow16( hwnd, hwnd, (HDC16)wParam, (HBRUSH16)CTLCOLOR_DLG );
return 1;
{
HBRUSH brush = SendMessageW( hwnd, WM_CTLCOLORDLG, wParam, (LPARAM)hwnd );
if (!brush) brush = DefWindowProcW( hwnd, WM_CTLCOLORDLG, wParam, (LPARAM)hwnd );
if (brush)
{
RECT rect;
HDC hdc = (HDC)wParam;
GetClientRect( hwnd, &rect );
DPtoLP( hdc, (LPPOINT)&rect, 2 );
FillRect( hdc, &rect, brush );
}
return 1;
}
case WM_NCDESTROY:
/* Free dialog heap (if created) */
if (dlgInfo->hDialogHeap)
{
GlobalUnlock16(dlgInfo->hDialogHeap);
GlobalFree16(dlgInfo->hDialogHeap);
dlgInfo->hDialogHeap = 0;
}
/* Delete font */
if (dlgInfo->hUserFont)
{
DeleteObject( dlgInfo->hUserFont );
dlgInfo->hUserFont = 0;
}
/* Delete menu */
if (dlgInfo->hMenu)
{
DestroyMenu( dlgInfo->hMenu );
dlgInfo->hMenu = 0;
}
/* Delete window procedure */
WINPROC_FreeProc( dlgInfo->dlgProc, WIN_PROC_WINDOW );
dlgInfo->dlgProc = (HWINDOWPROC)0;
dlgInfo->flags |= DF_END; /* just in case */
if ((dlgInfo = (DIALOGINFO *)SetWindowLongW( hwnd, DWL_WINE_DIALOGINFO, 0 )))
{
/* Free dialog heap (if created) */
if (dlgInfo->hDialogHeap)
{
GlobalUnlock16(dlgInfo->hDialogHeap);
GlobalFree16(dlgInfo->hDialogHeap);
}
if (dlgInfo->hUserFont) DeleteObject( dlgInfo->hUserFont );
if (dlgInfo->hMenu) DestroyMenu( dlgInfo->hMenu );
WINPROC_FreeProc( DEFDLG_GetDlgProc( hwnd ), WIN_PROC_WINDOW );
HeapFree( GetProcessHeap(), 0, dlgInfo );
}
/* Window clean-up */
return DefWindowProcA( hwnd, msg, wParam, lParam );
......@@ -263,18 +264,13 @@ static LRESULT DEFDLG_Epilog(HWND hwnd, UINT msg, BOOL fResult)
LRESULT WINAPI DefDlgProc16( HWND16 hwnd, UINT16 msg, WPARAM16 wParam,
LPARAM lParam )
{
DIALOGINFO * dlgInfo;
WNDPROC16 dlgproc;
HWND hwnd32 = WIN_Handle32( hwnd );
BOOL result = FALSE;
WND * wndPtr = WIN_FindWndPtr( hwnd );
if (!wndPtr) return 0;
dlgInfo = (DIALOGINFO *)&wndPtr->wExtra;
dlgInfo->msgResult = 0;
dlgproc = (WNDPROC16)dlgInfo->dlgProc;
WIN_ReleaseWndPtr(wndPtr);
SetWindowLongW( hwnd32, DWL_MSGRESULT, 0 );
if (dlgproc)
if ((dlgproc = (WNDPROC16)DEFDLG_GetDlgProc( hwnd32 )))
{
/* Call dialog procedure */
result = CallWindowProc16( dlgproc, hwnd, msg, wParam, lParam );
......@@ -283,7 +279,7 @@ LRESULT WINAPI DefDlgProc16( HWND16 hwnd, UINT16 msg, WPARAM16 wParam,
result = LOWORD(result);
}
if (!result && IsWindow(hwnd))
if (!result && IsWindow(hwnd32))
{
/* callback didn't process this message */
......@@ -302,8 +298,7 @@ LRESULT WINAPI DefDlgProc16( HWND16 hwnd, UINT16 msg, WPARAM16 wParam,
case WM_ENTERMENULOOP:
case WM_LBUTTONDOWN:
case WM_NCLBUTTONDOWN:
return DEFDLG_Proc( (HWND)hwnd, msg,
(WPARAM)wParam, lParam, dlgInfo );
return DEFDLG_Proc( hwnd32, msg, (WPARAM)wParam, lParam, DIALOG_get_info(hwnd32) );
case WM_INITDIALOG:
case WM_VKEYTOITEM:
case WM_COMPAREITEM:
......@@ -314,28 +309,21 @@ LRESULT WINAPI DefDlgProc16( HWND16 hwnd, UINT16 msg, WPARAM16 wParam,
return DefWindowProc16( hwnd, msg, wParam, lParam );
}
}
return DEFDLG_Epilog(hwnd, msg, result);
return DEFDLG_Epilog( hwnd32, msg, result);
}
/***********************************************************************
* DefDlgProcA (USER32.@)
*/
LRESULT WINAPI DefDlgProcA( HWND hwnd, UINT msg,
WPARAM wParam, LPARAM lParam )
LRESULT WINAPI DefDlgProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
{
DIALOGINFO * dlgInfo;
WNDPROC dlgproc;
BOOL result = FALSE;
WND * wndPtr = WIN_FindWndPtr( hwnd );
if (!wndPtr) return 0;
dlgInfo = (DIALOGINFO *)&wndPtr->wExtra;
dlgInfo->msgResult = 0;
dlgproc = dlgInfo->dlgProc;
WIN_ReleaseWndPtr(wndPtr);
SetWindowLongW( hwnd, DWL_MSGRESULT, 0 );
if (dlgproc)
if ((dlgproc = DEFDLG_GetDlgProc( hwnd )))
{
/* Call dialog procedure */
result = CallWindowProcA( dlgproc, hwnd, msg, wParam, lParam );
......@@ -363,7 +351,7 @@ LRESULT WINAPI DefDlgProcA( HWND hwnd, UINT msg,
case WM_ENTERMENULOOP:
case WM_LBUTTONDOWN:
case WM_NCLBUTTONDOWN:
return DEFDLG_Proc( hwnd, msg, wParam, lParam, dlgInfo );
return DEFDLG_Proc( hwnd, msg, wParam, lParam, DIALOG_get_info(hwnd) );
case WM_INITDIALOG:
case WM_VKEYTOITEM:
case WM_COMPAREITEM:
......@@ -381,21 +369,14 @@ LRESULT WINAPI DefDlgProcA( HWND hwnd, UINT msg,
/***********************************************************************
* DefDlgProcW (USER32.@)
*/
LRESULT WINAPI DefDlgProcW( HWND hwnd, UINT msg, WPARAM wParam,
LPARAM lParam )
LRESULT WINAPI DefDlgProcW( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
{
DIALOGINFO * dlgInfo;
BOOL result = FALSE;
WNDPROC dlgproc;
WND * wndPtr = WIN_FindWndPtr( hwnd );
if (!wndPtr) return 0;
dlgInfo = (DIALOGINFO *)&wndPtr->wExtra;
dlgInfo->msgResult = 0;
dlgproc = dlgInfo->dlgProc;
WIN_ReleaseWndPtr(wndPtr);
SetWindowLongW( hwnd, DWL_MSGRESULT, 0 );
if (dlgproc)
if ((dlgproc = DEFDLG_GetDlgProc( hwnd )))
{
/* Call dialog procedure */
result = CallWindowProcW( dlgproc, hwnd, msg, wParam, lParam );
......@@ -423,7 +404,7 @@ LRESULT WINAPI DefDlgProcW( HWND hwnd, UINT msg, WPARAM wParam,
case WM_ENTERMENULOOP:
case WM_LBUTTONDOWN:
case WM_NCLBUTTONDOWN:
return DEFDLG_Proc( hwnd, msg, wParam, lParam, dlgInfo );
return DEFDLG_Proc( hwnd, msg, wParam, lParam, DIALOG_get_info(hwnd) );
case WM_INITDIALOG:
case WM_VKEYTOITEM:
case WM_COMPAREITEM:
......
......@@ -333,7 +333,7 @@ static LRESULT DEFWND_DefWinProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa
pt.x = SLOWORD(lParam);
pt.y = SHIWORD(lParam);
ClientToScreen(hwnd, &pt);
SendMessageW( hwnd, WM_CONTEXTMENU, hwnd, MAKELPARAM(pt.x, pt.y) );
SendMessageW( hwnd, WM_CONTEXTMENU, (WPARAM)hwnd, MAKELPARAM(pt.x, pt.y) );
}
break;
......@@ -651,10 +651,11 @@ static LRESULT DEFWND_DefWinProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa
/***********************************************************************
* DefWindowProc (USER.107)
*/
LRESULT WINAPI DefWindowProc16( HWND16 hwnd, UINT16 msg, WPARAM16 wParam,
LRESULT WINAPI DefWindowProc16( HWND16 hwnd16, UINT16 msg, WPARAM16 wParam,
LPARAM lParam )
{
LRESULT result = 0;
HWND hwnd = WIN_Handle32( hwnd16 );
if (!IsWindow( hwnd )) return 0;
SPY_EnterMessage( SPY_DEFWNDPROC16, hwnd, msg, wParam, lParam );
......
......@@ -29,7 +29,7 @@ void FOCUS_SwitchFocus( MESSAGEQUEUE *pMsgQ, HWND hFocusFrom, HWND hFocusTo )
{
PERQDATA_SetFocusWnd( pMsgQ->pQData, hFocusTo );
if (hFocusFrom) SendMessageA( hFocusFrom, WM_KILLFOCUS, hFocusTo, 0 );
if (hFocusFrom) SendMessageA( hFocusFrom, WM_KILLFOCUS, (WPARAM)hFocusTo, 0 );
if( !hFocusTo || hFocusTo != PERQDATA_GetFocusWnd( pMsgQ->pQData ) )
{
......@@ -40,16 +40,7 @@ void FOCUS_SwitchFocus( MESSAGEQUEUE *pMsgQ, HWND hFocusFrom, HWND hFocusTo )
has received the keyboard focus. */
if (USER_Driver.pSetFocus) USER_Driver.pSetFocus(hFocusTo);
SendMessageA( hFocusTo, WM_SETFOCUS, hFocusFrom, 0 );
}
/*****************************************************************
* SetFocus (USER.22)
*/
HWND16 WINAPI SetFocus16( HWND16 hwnd )
{
return (HWND16)SetFocus( hwnd );
SendMessageA( hFocusTo, WM_SETFOCUS, (WPARAM)hFocusFrom, 0 );
}
......@@ -157,15 +148,6 @@ CLEANUP:
/*****************************************************************
* GetFocus (USER.23)
*/
HWND16 WINAPI GetFocus16(void)
{
return (HWND16)GetFocus();
}
/*****************************************************************
* GetFocus (USER32.@)
*/
HWND WINAPI GetFocus(void)
......
......@@ -99,13 +99,13 @@ static void HOOK_Map16To32Common(INT id, INT code, WPARAM *pwParam,
LPCWPSTRUCT16 lpcwp16 = MapSL(*plParam);
LPCWPSTRUCT lpcwp32 = HeapAlloc( GetProcessHeap(), 0, sizeof(*lpcwp32) );
lpcwp32->hwnd = lpcwp16->hwnd;
lpcwp32->hwnd = WIN_Handle32(lpcwp16->hwnd);
lpcwp32->lParam = lpcwp16->lParam;
if (bA) WINPROC_MapMsg16To32A( lpcwp16->message, lpcwp16->wParam,
if (bA) WINPROC_MapMsg16To32A( lpcwp32->hwnd, lpcwp16->message, lpcwp16->wParam,
&lpcwp32->message, &lpcwp32->wParam,
&lpcwp32->lParam );
else WINPROC_MapMsg16To32W( lpcwp16->hwnd,lpcwp16->message, lpcwp16->wParam,
else WINPROC_MapMsg16To32W( lpcwp32->hwnd,lpcwp16->message, lpcwp16->wParam,
&lpcwp32->message, &lpcwp32->wParam,
&lpcwp32->lParam );
*plParam = (LPARAM)lpcwp32;
......@@ -143,7 +143,7 @@ static void HOOK_Map16To32Common(INT id, INT code, WPARAM *pwParam,
else
lpcbtcw32->lpcs->lpszClass = (LPCSTR)lpcs16->lpszClass;
lpcbtcw32->hwndInsertAfter = lpcbtcw16->hwndInsertAfter;
lpcbtcw32->hwndInsertAfter = WIN_Handle32( lpcbtcw16->hwndInsertAfter );
*plParam = (LPARAM)lpcbtcw32;
break;
......@@ -154,7 +154,7 @@ static void HOOK_Map16To32Common(INT id, INT code, WPARAM *pwParam,
LPCBTACTIVATESTRUCT lpcas32 = HeapAlloc( GetProcessHeap(), 0,
sizeof(*lpcas32) );
lpcas32->fMouse = lpcas16->fMouse;
lpcas32->hWndActive = lpcas16->hWndActive;
lpcas32->hWndActive = WIN_Handle32(lpcas16->hWndActive);
*plParam = (LPARAM)lpcas32;
break;
}
......@@ -171,7 +171,7 @@ static void HOOK_Map16To32Common(INT id, INT code, WPARAM *pwParam,
lpms32->wHitTestCode = (INT)((INT16)lpms16->wHitTestCode);
lpms32->dwExtraInfo = lpms16->dwExtraInfo;
lpms32->hwnd = lpms16->hwnd;
lpms32->hwnd = WIN_Handle32( lpms16->hwnd );
*plParam = (LPARAM)lpms32;
break;
}
......@@ -200,7 +200,7 @@ static void HOOK_Map16To32Common(INT id, INT code, WPARAM *pwParam,
correct sign extension. Yay. :| */
lpms32->wHitTestCode = (INT)((INT16)lpms16->wHitTestCode);
lpms32->dwExtraInfo = lpms16->dwExtraInfo;
lpms32->hwnd = lpms16->hwnd;
lpms32->hwnd = WIN_Handle32(lpms16->hwnd);
*plParam = (LPARAM)lpms32;
break;
}
......@@ -314,7 +314,7 @@ static void HOOK_UnMap16To32Common(INT id, INT code, WPARAM wParamOrig,
HeapFree( GetProcessHeap(), 0, (LPWSTR)lpcbtcw32->lpcs->lpszClass );
}
lpcbtcw16->hwndInsertAfter = lpcbtcw32->hwndInsertAfter;
lpcbtcw16->hwndInsertAfter = WIN_Handle16( lpcbtcw32->hwndInsertAfter );
HeapFree( GetProcessHeap(), 0, lpcbtcw32->lpcs );
} /* fall through */
......@@ -406,7 +406,7 @@ static void HOOK_Map32To16Common(INT id, INT code, WPARAM *pwParam,
LPCWPSTRUCT lpcwp32 = (LPCWPSTRUCT)*plParam;
LPCWPSTRUCT16 lpcwp16 = SEGPTR_NEW( CWPSTRUCT16 );
lpcwp16->hwnd = lpcwp32->hwnd;
lpcwp16->hwnd = WIN_Handle16(lpcwp32->hwnd);
lpcwp16->lParam = lpcwp32->lParam;
if (bA) WINPROC_MapMsg32ATo16( lpcwp32->hwnd, lpcwp32->message,
......@@ -428,7 +428,7 @@ static void HOOK_Map32To16Common(INT id, INT code, WPARAM *pwParam,
LPCBTACTIVATESTRUCT16 lpcas16 =SEGPTR_NEW( CBTACTIVATESTRUCT16 );
lpcas16->fMouse = lpcas32->fMouse;
lpcas16->hWndActive = lpcas32->hWndActive;
lpcas16->hWndActive = WIN_Handle16( lpcas32->hWndActive );
*plParam = (LPARAM)SEGPTR_GET( lpcas16 );
break;
......@@ -441,7 +441,7 @@ static void HOOK_Map32To16Common(INT id, INT code, WPARAM *pwParam,
CONV_POINT32TO16( &lpms32->pt, &lpms16->pt );
lpms16->hwnd = lpms32->hwnd;
lpms16->hwnd = WIN_Handle16( lpms32->hwnd );
lpms16->wHitTestCode = lpms32->wHitTestCode;
lpms16->dwExtraInfo = lpms32->dwExtraInfo;
......@@ -469,7 +469,7 @@ static void HOOK_Map32To16Common(INT id, INT code, WPARAM *pwParam,
CONV_POINT32TO16( &lpms32->pt, &lpms16->pt );
lpms16->hwnd = lpms32->hwnd;
lpms16->hwnd = WIN_Handle16( lpms32->hwnd );
lpms16->wHitTestCode = lpms32->wHitTestCode;
lpms16->dwExtraInfo = lpms32->dwExtraInfo;
......@@ -531,7 +531,7 @@ static void HOOK_Map32ATo16(INT id, INT code, WPARAM *pwParam,
else
lpcs16->lpszClass = (SEGPTR)lpcbtcw32->lpcs->lpszClass;
lpcbtcw16->hwndInsertAfter = lpcbtcw32->hwndInsertAfter;
lpcbtcw16->hwndInsertAfter = WIN_Handle16( lpcbtcw32->hwndInsertAfter );
*plParam = (LPARAM)SEGPTR_GET( lpcbtcw16 );
}
......@@ -560,7 +560,7 @@ static void HOOK_Map32WTo16(INT id, INT code, WPARAM *pwParam,
cls = SEGPTR_STRDUP_WtoA( lpcbtcw32->lpcs->lpszClass );
lpcs16->lpszName = SEGPTR_GET( name );
lpcs16->lpszClass = SEGPTR_GET( cls );
lpcbtcw16->hwndInsertAfter = lpcbtcw32->hwndInsertAfter;
lpcbtcw16->hwndInsertAfter = WIN_Handle16( lpcbtcw32->hwndInsertAfter );
*plParam = (LPARAM)SEGPTR_GET( lpcbtcw16 );
}
......@@ -628,7 +628,7 @@ static void HOOK_UnMap32To16Common(INT id, INT code, WPARAM wParamOrig,
if (HIWORD(lpcs16->lpszClass))
SEGPTR_FREE( MapSL(lpcs16->lpszClass) );
lpcbtcw32->hwndInsertAfter = lpcbtcw16->hwndInsertAfter;
lpcbtcw32->hwndInsertAfter = WIN_Handle32( lpcbtcw16->hwndInsertAfter );
SEGPTR_FREE( lpcs16 );
} /* fall through */
......@@ -1372,24 +1372,23 @@ BOOL16 WINAPI CallMsgFilter32_16( SEGPTR msg16_32, INT16 code, BOOL16 wHaveParam
MSG msg32;
BOOL16 ret;
msg32.hwnd = lpmsg16_32->msg.hwnd;
msg32.message = lpmsg16_32->msg.message;
msg32.wParam =
MAKELONG(lpmsg16_32->msg.wParam, lpmsg16_32->wParamHigh);
msg32.lParam = lpmsg16_32->msg.lParam;
msg32.time = lpmsg16_32->msg.time;
msg32.pt.x = (INT)lpmsg16_32->msg.pt.x;
msg32.pt.y = (INT)lpmsg16_32->msg.pt.y;
msg32.hwnd = WIN_Handle32( lpmsg16_32->msg.hwnd );
msg32.message = lpmsg16_32->msg.message;
msg32.wParam = MAKELONG(lpmsg16_32->msg.wParam, lpmsg16_32->wParamHigh);
msg32.lParam = lpmsg16_32->msg.lParam;
msg32.time = lpmsg16_32->msg.time;
msg32.pt.x = lpmsg16_32->msg.pt.x;
msg32.pt.y = lpmsg16_32->msg.pt.y;
ret = (BOOL16)CallMsgFilterA(&msg32, (INT)code);
lpmsg16_32->msg.hwnd = msg32.hwnd;
lpmsg16_32->msg.hwnd = WIN_Handle16( msg32.hwnd );
lpmsg16_32->msg.message = msg32.message;
lpmsg16_32->msg.wParam = LOWORD(msg32.wParam);
lpmsg16_32->msg.lParam = msg32.lParam;
lpmsg16_32->msg.time = msg32.time;
lpmsg16_32->msg.pt.x = (INT16)msg32.pt.x;
lpmsg16_32->msg.pt.y = (INT16)msg32.pt.y;
lpmsg16_32->msg.pt.x = msg32.pt.x;
lpmsg16_32->msg.pt.y = msg32.pt.y;
lpmsg16_32->wParamHigh = HIWORD(msg32.wParam);
return ret;
......
......@@ -351,7 +351,7 @@ void WINAPI mouse_event( DWORD dwFlags, DWORD dx, DWORD dy,
InputKeyStateTable[VK_CONTROL] = (keyState & MK_CONTROL ? 0x80 : 0);
}
input.u.mi.time = wme->time;
input.u.mi.dwExtraInfo = wme->hWnd;
input.u.mi.dwExtraInfo = (ULONG_PTR)wme->hWnd;
queue_mouse_event( &input.u.mi, keyState );
}
else
......@@ -526,7 +526,7 @@ HWND EVENT_Capture(HWND hwnd, INT16 ht)
}
PERQDATA_SetCaptureWnd( captureWnd, captureHT );
if (capturePrev) SendMessageA( capturePrev, WM_CAPTURECHANGED, 0, hwnd );
if (capturePrev) SendMessageA( capturePrev, WM_CAPTURECHANGED, 0, (LPARAM)hwnd );
}
CLEANUP:
......@@ -540,15 +540,6 @@ CLEANUP:
/**********************************************************************
* SetCapture (USER.18)
*/
HWND16 WINAPI SetCapture16( HWND16 hwnd )
{
return (HWND16)EVENT_Capture( hwnd, HTCLIENT );
}
/**********************************************************************
* SetCapture (USER32.@)
*/
HWND WINAPI SetCapture( HWND hwnd )
......@@ -558,7 +549,6 @@ HWND WINAPI SetCapture( HWND hwnd )
/**********************************************************************
* ReleaseCapture (USER.19)
* ReleaseCapture (USER32.@)
*/
BOOL WINAPI ReleaseCapture(void)
......@@ -568,14 +558,6 @@ BOOL WINAPI ReleaseCapture(void)
/**********************************************************************
* GetCapture (USER.236)
*/
HWND16 WINAPI GetCapture16(void)
{
return (HWND16)GetCapture();
}
/**********************************************************************
* GetCapture (USER32.@)
*/
HWND WINAPI GetCapture(void)
......
......@@ -550,10 +550,10 @@ static HWND MDICreateChild( HWND parent, MDICLIENTINFO *ci,
cs16->szTitle = SEGPTR_GET(title);
cs16->szClass = SEGPTR_GET(cls);
hwnd = CreateWindow16( cs->szClass, cs->szTitle, style,
cs16->x, cs16->y, cs16->cx, cs16->cy, parent,
(HMENU)wIDmenu, cs16->hOwner,
(LPVOID)SEGPTR_GET(cs16) );
hwnd = WIN_Handle32( CreateWindow16( cs->szClass, cs->szTitle, style,
cs16->x, cs16->y, cs16->cx, cs16->cy,
WIN_Handle16(parent), (HMENU)wIDmenu,
cs16->hOwner, (LPVOID)SEGPTR_GET(cs16) ));
SEGPTR_FREE( title );
SEGPTR_FREE( cls );
SEGPTR_FREE( cs16 );
......@@ -1287,16 +1287,16 @@ static LRESULT MDIClientWndProc_common( HWND hwnd, UINT message,
return MDICascade(hwnd, ci);
case WM_MDICREATE:
if (lParam) return MDICreateChild( hwnd, ci,
(MDICREATESTRUCTA *)lParam, unicode );
else return 0;
if (lParam)
return (LRESULT)MDICreateChild( hwnd, ci, (MDICREATESTRUCTA *)lParam, unicode );
return 0;
case WM_MDIDESTROY:
return MDIDestroyChild( hwnd, ci, WIN_GetFullHandle( (HWND)wParam ), TRUE );
case WM_MDIGETACTIVE:
if (lParam) *(BOOL *)lParam = (ci->hwndChildMaximized != 0);
return ci->hwndActiveChild;
return (LRESULT)ci->hwndActiveChild;
case WM_MDIICONARRANGE:
ci->mdiFlags |= MDIF_NEEDUPDATE;
......@@ -1423,19 +1423,21 @@ LRESULT WINAPI DefFrameProc16( HWND16 hwnd, HWND16 hwndMDIClient,
switch (message)
{
case WM_SETTEXT:
return DefFrameProcA( hwnd, hwndMDIClient, message, wParam, (LPARAM)MapSL(lParam) );
lParam = (LPARAM)MapSL(lParam);
/* fall through */
case WM_COMMAND:
case WM_NCACTIVATE:
case WM_SETFOCUS:
case WM_SIZE:
return DefFrameProcW( hwnd, hwndMDIClient, message, wParam, lParam );
return DefFrameProcA( WIN_Handle32(hwnd), WIN_Handle32(hwndMDIClient),
message, wParam, lParam );
case WM_NEXTMENU:
{
MDINEXTMENU next_menu;
DefFrameProcW( hwnd, hwndMDIClient, message, wParam, (LPARAM)&next_menu );
return MAKELONG( next_menu.hmenuNext, next_menu.hwndNext );
DefFrameProcW( WIN_Handle32(hwnd), WIN_Handle32(hwndMDIClient),
message, wParam, (LPARAM)&next_menu );
return MAKELONG( next_menu.hmenuNext, WIN_Handle16(next_menu.hwndNext) );
}
default:
return DefWindowProc16(hwnd, message, wParam, lParam);
......@@ -1600,7 +1602,7 @@ LRESULT WINAPI DefMDIChildProc16( HWND16 hwnd, UINT16 message,
{
MDINEXTMENU next_menu;
DefMDIChildProcW( WIN_Handle32(hwnd), message, wParam, (LPARAM)&next_menu );
return MAKELONG( next_menu.hmenuNext, next_menu.hwndNext );
return MAKELONG( next_menu.hmenuNext, WIN_Handle16(next_menu.hwndNext) );
}
default:
return DefWindowProc16(hwnd, message, wParam, lParam);
......@@ -1875,24 +1877,6 @@ HWND WINAPI CreateMDIWindowW(
}
/**********************************************************************
* TranslateMDISysAccel (USER.451)
*/
BOOL16 WINAPI TranslateMDISysAccel16( HWND16 hwndClient, LPMSG16 msg )
{
if (msg->message == WM_KEYDOWN || msg->message == WM_SYSKEYDOWN)
{
MSG msg32;
msg32.hwnd = msg->hwnd;
msg32.message = msg->message;
msg32.wParam = msg->wParam;
msg32.lParam = msg->lParam;
/* MDICLIENTINFO is still the same for win32 and win16 ... */
return TranslateMDISysAccel(hwndClient, &msg32);
}
return 0;
}
/**********************************************************************
* TranslateMDISysAccel (USER32.@)
*/
BOOL WINAPI TranslateMDISysAccel( HWND hwndClient, LPMSG msg )
......@@ -1930,14 +1914,6 @@ BOOL WINAPI TranslateMDISysAccel( HWND hwndClient, LPMSG msg )
}
/***********************************************************************
* CalcChildScroll (USER.462)
*/
void WINAPI CalcChildScroll16( HWND16 hwnd, WORD scroll )
{
return CalcChildScroll( hwnd, scroll );
}
/***********************************************************************
* CalcChildScroll (USER32.@)
*/
void WINAPI CalcChildScroll( HWND hwnd, INT scroll )
......@@ -1998,15 +1974,6 @@ void WINAPI CalcChildScroll( HWND hwnd, INT scroll )
/***********************************************************************
* ScrollChildren (USER.463)
*/
void WINAPI ScrollChildren16(HWND16 hWnd, UINT16 uMsg, WPARAM16 wParam, LPARAM lParam)
{
ScrollChildren( hWnd, uMsg, wParam, lParam );
}
/***********************************************************************
* ScrollChildren (USER32.@)
*/
void WINAPI ScrollChildren(HWND hWnd, UINT uMsg, WPARAM wParam,
......@@ -2196,9 +2163,8 @@ static BOOL WINAPI MDI_MoreWindowsDlgProc (HWND hDlg, UINT iMsg, WPARAM wParam,
*/
HWND hListBox = GetDlgItem(hDlg, MDI_IDC_LISTBOX);
UINT index = SendMessageW(hListBox, LB_GETCURSEL, 0, 0);
HWND hwnd = SendMessageW(hListBox, LB_GETITEMDATA, index, 0);
EndDialog(hDlg, hwnd);
LRESULT res = SendMessageW(hListBox, LB_GETITEMDATA, index, 0);
EndDialog(hDlg, res);
return TRUE;
}
case IDCANCEL:
......
......@@ -265,16 +265,6 @@ static LRESULT CALLBACK MSGBOX_DlgProc( HWND hwnd, UINT message,
/**************************************************************************
* MessageBox (USER.1)
*/
INT16 WINAPI MessageBox16( HWND16 hwnd, LPCSTR text, LPCSTR title, UINT16 type)
{
WARN("Messagebox\n");
return MessageBoxA( hwnd, text, title, type );
}
/**************************************************************************
* MessageBoxA (USER32.@)
*
* NOTES
......@@ -347,38 +337,6 @@ INT WINAPI MessageBoxExW( HWND hWnd, LPCWSTR text, LPCWSTR title,
}
/**************************************************************************
* MessageBoxIndirect (USER.827)
*/
INT16 WINAPI MessageBoxIndirect16( LPMSGBOXPARAMS16 msgbox )
{
LPVOID template;
HRSRC hRes;
MSGBOXPARAMSA msgbox32;
WARN("Messagebox\n");
if(!(hRes = FindResourceA(GetModuleHandleA("USER32"), "MSGBOX", RT_DIALOGA)))
return 0;
if(!(template = (LPVOID)LoadResource(GetModuleHandleA("USER32"), hRes)))
return 0;
msgbox32.cbSize = msgbox->cbSize;
msgbox32.hwndOwner = msgbox->hwndOwner;
msgbox32.hInstance = msgbox->hInstance;
msgbox32.lpszText = MapSL(msgbox->lpszText);
msgbox32.lpszCaption = MapSL(msgbox->lpszCaption);
msgbox32.dwStyle = msgbox->dwStyle;
msgbox32.lpszIcon = MapSL(msgbox->lpszIcon);
msgbox32.dwContextHelpId = msgbox->dwContextHelpId;
msgbox32.lpfnMsgBoxCallback = msgbox->lpfnMsgBoxCallback;
msgbox32.dwLanguageId = msgbox->dwLanguageId;
return DialogBoxIndirectParamA( msgbox32.hInstance, template,
msgbox32.hwndOwner, (DLGPROC)MSGBOX_DlgProc,
(LPARAM)&msgbox32 );
}
/**************************************************************************
* MessageBoxIndirectA (USER32.@)
*/
INT WINAPI MessageBoxIndirectA( LPMSGBOXPARAMSA msgbox )
......
......@@ -237,33 +237,6 @@ static HICON NC_IconForWindow( HWND hwnd )
}
/***********************************************************************
* DrawCaption (USER.660) Draws a caption bar
*
* PARAMS
* hwnd [I]
* hdc [I]
* lpRect [I]
* uFlags [I]
*
* RETURNS
* Success:
* Failure:
*/
BOOL16 WINAPI
DrawCaption16 (HWND16 hwnd, HDC16 hdc, const RECT16 *rect, UINT16 uFlags)
{
RECT rect32;
if (rect)
CONV_RECT16TO32 (rect, &rect32);
return (BOOL16)DrawCaptionTempA (hwnd, hdc, rect ? &rect32 : NULL,
0, 0, NULL, uFlags & 0x1F);
}
/***********************************************************************
* DrawCaption (USER32.@) Draws a caption bar
*
* PARAMS
......@@ -285,30 +258,6 @@ DrawCaption (HWND hwnd, HDC hdc, const RECT *lpRect, UINT uFlags)
/***********************************************************************
* DrawCaptionTemp (USER.657)
*
* PARAMS
*
* RETURNS
* Success:
* Failure:
*/
BOOL16 WINAPI
DrawCaptionTemp16 (HWND16 hwnd, HDC16 hdc, const RECT16 *rect, HFONT16 hFont,
HICON16 hIcon, LPCSTR str, UINT16 uFlags)
{
RECT rect32;
if (rect)
CONV_RECT16TO32(rect,&rect32);
return (BOOL16)DrawCaptionTempA (hwnd, hdc, rect?&rect32:NULL, hFont,
hIcon, str, uFlags & 0x1F);
}
/***********************************************************************
* DrawCaptionTempA (USER32.@)
*
* PARAMS
......
......@@ -42,9 +42,6 @@ DECLARE_DEBUG_CHANNEL(nonclient);
/* Last COLOR id */
#define COLOR_MAX COLOR_GRADIENTINACTIVECAPTION
/* Last CTLCOLOR id */
#define CTLCOLOR_MAX CTLCOLOR_STATIC
/***********************************************************************
* add_paint_count
......@@ -284,11 +281,11 @@ copyrgn:
/***********************************************************************
* BeginPaint (USER.39)
*/
HDC16 WINAPI BeginPaint16( HWND16 hwnd, LPPAINTSTRUCT16 lps )
HDC16 WINAPI BeginPaint16( HWND16 hwnd, LPPAINTSTRUCT16 lps )
{
PAINTSTRUCT ps;
BeginPaint( hwnd, &ps );
BeginPaint( WIN_Handle32(hwnd), &ps );
lps->hdc = ps.hdc;
lps->fErase = ps.fErase;
lps->rcPaint.top = ps.rcPaint.top;
......@@ -401,7 +398,7 @@ HDC WINAPI BeginPaint( HWND hwnd, PAINTSTRUCT *lps )
BOOL16 WINAPI EndPaint16( HWND16 hwnd, const PAINTSTRUCT16* lps )
{
ReleaseDC16( hwnd, lps->hdc );
ShowCaret( hwnd );
ShowCaret16( hwnd );
return TRUE;
}
......@@ -418,66 +415,6 @@ BOOL WINAPI EndPaint( HWND hwnd, const PAINTSTRUCT *lps )
/***********************************************************************
* FillWindow (USER.324)
*/
void WINAPI FillWindow16( HWND16 hwndParent, HWND16 hwnd, HDC16 hdc, HBRUSH16 hbrush )
{
RECT rect;
RECT16 rc16;
GetClientRect( hwnd, &rect );
DPtoLP( hdc, (LPPOINT)&rect, 2 );
CONV_RECT32TO16( &rect, &rc16 );
PaintRect16( hwndParent, hwnd, hdc, hbrush, &rc16 );
}
/***********************************************************************
* PAINT_GetControlBrush
*/
static HBRUSH16 PAINT_GetControlBrush( HWND hParent, HWND hWnd, HDC16 hDC, UINT16 ctlType )
{
HBRUSH16 bkgBrush = (HBRUSH16)SendMessageA( hParent, WM_CTLCOLORMSGBOX + ctlType,
(WPARAM)hDC, (LPARAM)hWnd );
if( !IsGDIObject16(bkgBrush) )
bkgBrush = DEFWND_ControlColor( hDC, ctlType );
return bkgBrush;
}
/***********************************************************************
* PaintRect (USER.325)
*/
void WINAPI PaintRect16( HWND16 hwndParent, HWND16 hwnd, HDC16 hdc,
HBRUSH16 hbrush, const RECT16 *rect)
{
if( hbrush <= CTLCOLOR_MAX )
{
if( hwndParent )
hbrush = PAINT_GetControlBrush( hwndParent, hwnd, hdc, (UINT16)hbrush );
else
return;
}
if( hbrush )
FillRect16( hdc, rect, hbrush );
}
/***********************************************************************
* GetControlBrush (USER.326)
*/
HBRUSH16 WINAPI GetControlBrush16( HWND16 hwnd, HDC16 hdc, UINT16 ctlType )
{
if (ctlType <= CTLCOLOR_MAX)
{
HWND16 parent = GetParent16( hwnd );
if (!parent) parent = hwnd;
return PAINT_GetControlBrush( parent, hwnd, hdc, ctlType );
}
return 0;
}
/***********************************************************************
* RDW_ValidateParent [RDW_UpdateRgns() helper]
*
* Validate the portions of parents that are covered by a validated child
......@@ -975,30 +912,6 @@ END:
/***********************************************************************
* RedrawWindow (USER.290)
*/
BOOL16 WINAPI RedrawWindow16( HWND16 hwnd, const RECT16 *rectUpdate,
HRGN16 hrgnUpdate, UINT16 flags )
{
if (rectUpdate)
{
RECT r;
CONV_RECT16TO32( rectUpdate, &r );
return (BOOL16)RedrawWindow( (HWND)hwnd, &r, hrgnUpdate, flags );
}
return RedrawWindow( hwnd, NULL, hrgnUpdate, flags );
}
/***********************************************************************
* UpdateWindow (USER.124)
*/
void WINAPI UpdateWindow16( HWND16 hwnd )
{
RedrawWindow( hwnd, NULL, 0, RDW_UPDATENOW | RDW_ALLCHILDREN );
}
/***********************************************************************
* UpdateWindow (USER32.@)
*/
void WINAPI UpdateWindow( HWND hwnd )
......@@ -1006,14 +919,6 @@ void WINAPI UpdateWindow( HWND hwnd )
RedrawWindow( hwnd, NULL, 0, RDW_UPDATENOW | RDW_ALLCHILDREN );
}
/***********************************************************************
* InvalidateRgn (USER.126)
*/
void WINAPI InvalidateRgn16( HWND16 hwnd, HRGN16 hrgn, BOOL16 erase )
{
RedrawWindow((HWND)hwnd, NULL, (HRGN)hrgn, RDW_INVALIDATE | (erase ? RDW_ERASE : 0) );
}
/***********************************************************************
* InvalidateRgn (USER32.@)
......@@ -1025,15 +930,6 @@ BOOL WINAPI InvalidateRgn( HWND hwnd, HRGN hrgn, BOOL erase )
/***********************************************************************
* InvalidateRect (USER.125)
*/
void WINAPI InvalidateRect16( HWND16 hwnd, const RECT16 *rect, BOOL16 erase )
{
RedrawWindow16( hwnd, rect, 0, RDW_INVALIDATE | (erase ? RDW_ERASE : 0) );
}
/***********************************************************************
* InvalidateRect (USER32.@)
*/
BOOL WINAPI InvalidateRect( HWND hwnd, const RECT *rect, BOOL erase )
......@@ -1043,15 +939,6 @@ BOOL WINAPI InvalidateRect( HWND hwnd, const RECT *rect, BOOL erase )
/***********************************************************************
* ValidateRgn (USER.128)
*/
void WINAPI ValidateRgn16( HWND16 hwnd, HRGN16 hrgn )
{
RedrawWindow( (HWND)hwnd, NULL, (HRGN)hrgn, RDW_VALIDATE | RDW_NOCHILDREN );
}
/***********************************************************************
* ValidateRgn (USER32.@)
*/
void WINAPI ValidateRgn( HWND hwnd, HRGN hrgn )
......@@ -1061,15 +948,6 @@ void WINAPI ValidateRgn( HWND hwnd, HRGN hrgn )
/***********************************************************************
* ValidateRect (USER.127)
*/
void WINAPI ValidateRect16( HWND16 hwnd, const RECT16 *rect )
{
RedrawWindow16( hwnd, rect, 0, RDW_VALIDATE | RDW_NOCHILDREN );
}
/***********************************************************************
* ValidateRect (USER32.@)
*/
void WINAPI ValidateRect( HWND hwnd, const RECT *rect )
......@@ -1079,21 +957,6 @@ void WINAPI ValidateRect( HWND hwnd, const RECT *rect )
/***********************************************************************
* GetUpdateRect (USER.190)
*/
BOOL16 WINAPI GetUpdateRect16( HWND16 hwnd, LPRECT16 rect, BOOL16 erase )
{
RECT r;
BOOL16 ret;
if (!rect) return GetUpdateRect( hwnd, NULL, erase );
ret = GetUpdateRect( hwnd, &r, erase );
CONV_RECT32TO16( &r, rect );
return ret;
}
/***********************************************************************
* GetUpdateRect (USER32.@)
*/
BOOL WINAPI GetUpdateRect( HWND hwnd, LPRECT rect, BOOL erase )
......@@ -1139,15 +1002,6 @@ END:
/***********************************************************************
* GetUpdateRgn (USER.237)
*/
INT16 WINAPI GetUpdateRgn16( HWND16 hwnd, HRGN16 hrgn, BOOL16 erase )
{
return GetUpdateRgn( hwnd, hrgn, erase );
}
/***********************************************************************
* GetUpdateRgn (USER32.@)
*/
INT WINAPI GetUpdateRgn( HWND hwnd, HRGN hrgn, BOOL erase )
......@@ -1183,15 +1037,6 @@ END:
/***********************************************************************
* ExcludeUpdateRgn (USER.238)
*/
INT16 WINAPI ExcludeUpdateRgn16( HDC16 hdc, HWND16 hwnd )
{
return ExcludeUpdateRgn( hdc, hwnd );
}
/***********************************************************************
* ExcludeUpdateRgn (USER32.@)
*/
INT WINAPI ExcludeUpdateRgn( HDC hdc, HWND hwnd )
......@@ -1366,28 +1211,6 @@ BOOL WINAPI DrawFocusRect( HDC hdc, const RECT* rc )
return TRUE;
}
/**********************************************************************
* DrawAnimatedRects (USER.448)
*/
BOOL16 WINAPI DrawAnimatedRects16( HWND16 hwnd, INT16 idAni,
const RECT16* lprcFrom,
const RECT16* lprcTo )
{
RECT rcFrom32, rcTo32;
rcFrom32.left = (INT)lprcFrom->left;
rcFrom32.top = (INT)lprcFrom->top;
rcFrom32.right = (INT)lprcFrom->right;
rcFrom32.bottom = (INT)lprcFrom->bottom;
rcTo32.left = (INT)lprcTo->left;
rcTo32.top = (INT)lprcTo->top;
rcTo32.right = (INT)lprcTo->right;
rcTo32.bottom = (INT)lprcTo->bottom;
return DrawAnimatedRects((HWND)hwnd, (INT)idAni, &rcFrom32, &rcTo32);
}
/**********************************************************************
* DrawAnimatedRects (USER32.@)
......@@ -1681,7 +1504,7 @@ UINT16 WINAPI RealizePalette16( HDC16 hDC )
{
/* send palette change notification */
HWND hWnd = WindowFromDC( hDC );
if (hWnd) SendMessageA( HWND_BROADCAST, WM_PALETTECHANGED, hWnd, 0L);
if (hWnd) SendMessageA( HWND_BROADCAST, WM_PALETTECHANGED, (WPARAM)hWnd, 0L);
}
return realized;
}
......
......@@ -68,15 +68,6 @@ END:
/***********************************************************************
* GetProp (USER.25)
*/
HANDLE16 WINAPI GetProp16( HWND16 hwnd, LPCSTR str )
{
return (HANDLE16)GetPropA( hwnd, str );
}
/***********************************************************************
* GetPropA (USER32.@)
*/
HANDLE WINAPI GetPropA( HWND hwnd, LPCSTR str )
......@@ -111,15 +102,6 @@ HANDLE WINAPI GetPropW( HWND hwnd, LPCWSTR str )
/***********************************************************************
* SetProp (USER.26)
*/
BOOL16 WINAPI SetProp16( HWND16 hwnd, LPCSTR str, HANDLE16 handle )
{
return (BOOL16)SetPropA( hwnd, str, handle );
}
/***********************************************************************
* SetPropA (USER32.@)
*/
BOOL WINAPI SetPropA( HWND hwnd, LPCSTR str, HANDLE handle )
......@@ -176,15 +158,6 @@ BOOL WINAPI SetPropW( HWND hwnd, LPCWSTR str, HANDLE handle )
/***********************************************************************
* RemoveProp (USER.24)
*/
HANDLE16 WINAPI RemoveProp16( HWND16 hwnd, LPCSTR str )
{
return (HANDLE16)RemovePropA( hwnd, str );
}
/***********************************************************************
* RemovePropA (USER32.@)
*/
HANDLE WINAPI RemovePropA( HWND hwnd, LPCSTR str )
......@@ -282,7 +255,7 @@ INT16 WINAPI EnumProps16( HWND16 hwnd, PROPENUMPROC16 func )
INT16 ret = -1;
TRACE("%04x %08x\n", hwnd, (UINT)func );
if (!(pWnd = WIN_FindWndPtr( hwnd ))) return -1;
if (!(pWnd = WIN_FindWndPtr16( hwnd ))) return -1;
for (prop = pWnd->pProp; (prop); prop = next)
{
/* Already get the next in case the callback */
......
......@@ -463,7 +463,7 @@ HTASK16 WINAPI GetWindowTask16( HWND16 hwnd )
HTASK16 retvalue;
MESSAGEQUEUE *queue;
WND *wndPtr = WIN_FindWndPtr( hwnd );
WND *wndPtr = WIN_FindWndPtr16( hwnd );
if (!wndPtr) return 0;
queue = QUEUE_Lock( wndPtr->hmemTaskQ );
......
......@@ -19,20 +19,6 @@
DEFAULT_DEBUG_CHANNEL(scroll);
/*************************************************************************
* ScrollWindow (USER.61)
*/
void WINAPI ScrollWindow16(HWND16 hwnd, INT16 dx, INT16 dy, const RECT16 *rect,
const RECT16 *clipRect )
{
RECT rect32, clipRect32;
if (rect) CONV_RECT16TO32( rect, &rect32 );
if (clipRect) CONV_RECT16TO32( clipRect, &clipRect32 );
ScrollWindow( hwnd, dx, dy, rect ? &rect32 : NULL,
clipRect ? &clipRect32 : NULL );
}
/*************************************************************************
* ScrollWindow (USER32.@)
*
*/
......@@ -82,27 +68,6 @@ BOOL WINAPI ScrollDC( HDC hdc, INT dx, INT dy, const RECT *rc,
/*************************************************************************
* ScrollWindowEx (USER.319)
*/
INT16 WINAPI ScrollWindowEx16( HWND16 hwnd, INT16 dx, INT16 dy,
const RECT16 *rect, const RECT16 *clipRect,
HRGN16 hrgnUpdate, LPRECT16 rcUpdate,
UINT16 flags )
{
RECT rect32, clipRect32, rcUpdate32;
BOOL16 ret;
if (rect) CONV_RECT16TO32( rect, &rect32 );
if (clipRect) CONV_RECT16TO32( clipRect, &clipRect32 );
ret = ScrollWindowEx( hwnd, dx, dy, rect ? &rect32 : NULL,
clipRect ? &clipRect32 : NULL, hrgnUpdate,
(rcUpdate) ? &rcUpdate32 : NULL, flags );
if (rcUpdate) CONV_RECT32TO16( &rcUpdate32, rcUpdate );
return ret;
}
/*************************************************************************
* ScrollWindowEx (USER32.@)
*
* NOTE: Use this function instead of ScrollWindow32
......
......@@ -1956,8 +1956,8 @@ void SPY_EnterMessage( INT iFlag, HWND hWnd, UINT msg,
{
case SPY_DISPATCHMESSAGE16:
TRACE("%*s(%04x) %-16s message [%04x] %s dispatched wp=%04x lp=%08lx\n",
SPY_IndentLevel, "", hWnd, sp_e.wnd_name, msg,
sp_e.msg_name, wParam, lParam);
SPY_IndentLevel, "", WIN_Handle16(hWnd),
sp_e.wnd_name, msg, sp_e.msg_name, wParam, lParam);
break;
case SPY_DISPATCHMESSAGE:
......@@ -1970,7 +1970,7 @@ void SPY_EnterMessage( INT iFlag, HWND hWnd, UINT msg,
case SPY_SENDMESSAGE:
{
char taskName[30];
HTASK16 hTask = GetWindowTask16(hWnd);
HTASK16 hTask = GetWindowTask16( WIN_Handle16(hWnd) );
if (hTask == GetCurrentTask()) strcpy( taskName, "self" );
else if (!hTask) strcpy( taskName, "Wine" );
......@@ -1982,8 +1982,8 @@ void SPY_EnterMessage( INT iFlag, HWND hWnd, UINT msg,
if (iFlag == SPY_SENDMESSAGE16)
TRACE("%*s(%04x) %-16s message [%04x] %s sent from %s wp=%04x lp=%08lx\n",
SPY_IndentLevel, "", hWnd, sp_e.wnd_name, msg,
sp_e.msg_name, taskName, wParam, lParam );
SPY_IndentLevel, "", WIN_Handle16(hWnd), 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",
SPY_IndentLevel, "", hWnd, sp_e.wnd_name, msg,
......@@ -1996,8 +1996,7 @@ void SPY_EnterMessage( INT iFlag, HWND hWnd, UINT msg,
case SPY_DEFWNDPROC16:
if( SPY_ExcludeDWP ) return;
TRACE("%*s(%04x) DefWindowProc16: %s [%04x] wp=%04x lp=%08lx\n",
SPY_IndentLevel, "", hWnd, sp_e.msg_name,
msg, wParam, lParam );
SPY_IndentLevel, "", WIN_Handle16(hWnd), sp_e.msg_name, msg, wParam, lParam );
break;
case SPY_DEFWNDPROC:
......@@ -2036,7 +2035,7 @@ void SPY_ExitMessage( INT iFlag, HWND hWnd, UINT msg, LRESULT lReturn,
{
case SPY_RESULT_DEFWND16:
TRACE(" %*s(%04x) DefWindowProc16: %s [%04x] returned %08lx\n",
SPY_IndentLevel, "", hWnd, sp_e.msg_name, msg, lReturn );
SPY_IndentLevel, "", WIN_Handle16(hWnd), sp_e.msg_name, msg, lReturn );
break;
case SPY_RESULT_DEFWND:
......@@ -2046,8 +2045,8 @@ void SPY_ExitMessage( INT iFlag, HWND hWnd, UINT msg, LRESULT lReturn,
case SPY_RESULT_OK16:
TRACE(" %*s(%04x) %-16s message [%04x] %s returned %08lx\n",
SPY_IndentLevel, "", hWnd, sp_e.wnd_name, msg,
sp_e.msg_name, lReturn );
SPY_IndentLevel, "", WIN_Handle16(hWnd), sp_e.wnd_name, msg,
sp_e.msg_name, lReturn );
break;
case SPY_RESULT_OK:
......@@ -2059,8 +2058,7 @@ void SPY_ExitMessage( INT iFlag, HWND hWnd, UINT msg, LRESULT lReturn,
case SPY_RESULT_INVALIDHWND16:
WARN(" %*s(%04x) %-16s message [%04x] %s HAS INVALID HWND\n",
SPY_IndentLevel, "", hWnd, sp_e.wnd_name, msg,
sp_e.msg_name );
SPY_IndentLevel, "", WIN_Handle16(hWnd), sp_e.wnd_name, msg, sp_e.msg_name );
break;
case SPY_RESULT_INVALIDHWND:
......
......@@ -5,11 +5,12 @@
*/
#include "struct32.h"
#include "win.h"
#include "winerror.h"
void STRUCT32_MSG16to32(const MSG16 *msg16,MSG *msg32)
{
msg32->hwnd=(HWND)msg16->hwnd;
msg32->hwnd = WIN_Handle32(msg16->hwnd);
msg32->message=msg16->message;
msg32->wParam=msg16->wParam;
msg32->lParam=msg16->lParam;
......@@ -20,7 +21,7 @@ void STRUCT32_MSG16to32(const MSG16 *msg16,MSG *msg32)
void STRUCT32_MSG32to16(const MSG *msg32,MSG16 *msg16)
{
msg16->hwnd=(HWND16)msg32->hwnd;
msg16->hwnd = WIN_Handle16(msg32->hwnd);
msg16->message=msg32->message;
msg16->wParam=msg32->wParam;
msg16->lParam=msg32->lParam;
......@@ -49,24 +50,25 @@ void STRUCT32_MINMAXINFO16to32( const MINMAXINFO16 *from, MINMAXINFO *to )
void STRUCT32_WINDOWPOS32to16( const WINDOWPOS* from, WINDOWPOS16* to )
{
to->hwnd = (HWND16)from->hwnd;
to->hwndInsertAfter = (HWND16)from->hwndInsertAfter;
to->x = (INT16)from->x;
to->y = (INT16)from->y;
to->cx = (INT16)from->cx;
to->cy = (INT16)from->cy;
to->flags = (UINT16)from->flags;
to->hwnd = WIN_Handle16(from->hwnd);
to->hwndInsertAfter = WIN_Handle16(from->hwndInsertAfter);
to->x = from->x;
to->y = from->y;
to->cx = from->cx;
to->cy = from->cy;
to->flags = from->flags;
}
void STRUCT32_WINDOWPOS16to32( const WINDOWPOS16* from, WINDOWPOS* to )
{
to->hwnd = (HWND)from->hwnd;
to->hwndInsertAfter = (HWND)from->hwndInsertAfter;
to->x = (INT)from->x;
to->y = (INT)from->y;
to->cx = (INT)from->cx;
to->cy = (INT)from->cy;
to->flags = (UINT)from->flags;
to->hwnd = WIN_Handle32(from->hwnd);
to->hwndInsertAfter = (from->hwndInsertAfter == (HWND16)-1) ?
HWND_TOPMOST : WIN_Handle32(from->hwndInsertAfter);
to->x = from->x;
to->y = from->y;
to->cx = from->cx;
to->cy = from->cy;
to->flags = from->flags;
}
/* The strings are not copied */
......@@ -76,11 +78,11 @@ void STRUCT32_CREATESTRUCT32Ato16( const CREATESTRUCTA* from,
to->lpCreateParams = from->lpCreateParams;
to->hInstance = (HINSTANCE16)from->hInstance;
to->hMenu = (HMENU16)from->hMenu;
to->hwndParent = (HWND16)from->hwndParent;
to->cy = (INT16)from->cy;
to->cx = (INT16)from->cx;
to->y = (INT16)from->y;
to->x = (INT16)from->x;
to->hwndParent = WIN_Handle16(from->hwndParent);
to->cy = from->cy;
to->cx = from->cx;
to->y = from->y;
to->x = from->x;
to->style = from->style;
to->dwExStyle = from->dwExStyle;
}
......@@ -91,11 +93,11 @@ void STRUCT32_CREATESTRUCT16to32A( const CREATESTRUCT16* from,
to->lpCreateParams = from->lpCreateParams;
to->hInstance = (HINSTANCE)from->hInstance;
to->hMenu = (HMENU)from->hMenu;
to->hwndParent = (HWND)from->hwndParent;
to->cy = (INT)from->cy;
to->cx = (INT)from->cx;
to->y = (INT)from->y;
to->x = (INT)from->x;
to->hwndParent = WIN_Handle32(from->hwndParent);
to->cy = from->cy;
to->cx = from->cx;
to->y = from->y;
to->x = from->x;
to->style = from->style;
to->dwExStyle = from->dwExStyle;
}
......@@ -105,11 +107,11 @@ void STRUCT32_MDICREATESTRUCT32Ato16( const MDICREATESTRUCTA* from,
MDICREATESTRUCT16* to )
{
to->hOwner = (HINSTANCE16)from->hOwner;
to->x = (INT16)from->x;
to->y = (INT16)from->y;
to->cx = (INT16)from->cx;
to->cy = (INT16)from->cy;
to->style = from->style;
to->x = from->x;
to->y = from->y;
to->cx = from->cx;
to->cy = from->cy;
to->style = from->style;
to->lParam = from->lParam;
}
......@@ -117,11 +119,11 @@ void STRUCT32_MDICREATESTRUCT16to32A( const MDICREATESTRUCT16* from,
MDICREATESTRUCTA *to )
{
to->hOwner = (HINSTANCE)from->hOwner;
to->x = (INT)from->x;
to->y = (INT)from->y;
to->cx = (INT)from->cx;
to->cy = (INT)from->cy;
to->style = from->style;
to->x = from->x;
to->y = from->y;
to->cx = from->cx;
to->cy = from->cy;
to->style = from->style;
to->lParam = from->lParam;
}
......@@ -300,16 +300,6 @@ UINT WINAPI SetSystemTimer( HWND hwnd, UINT id, UINT timeout,
/***********************************************************************
* KillTimer (USER.12)
*/
BOOL16 WINAPI KillTimer16( HWND16 hwnd, UINT16 id )
{
TRACE("%04x %d\n", hwnd, id );
return TIMER_KillTimer( hwnd, id, FALSE );
}
/***********************************************************************
* KillTimer (USER32.@)
*/
BOOL WINAPI KillTimer( HWND hwnd, UINT id )
......@@ -320,16 +310,6 @@ BOOL WINAPI KillTimer( HWND hwnd, UINT id )
/***********************************************************************
* KillSystemTimer (USER.182)
*/
BOOL16 WINAPI KillSystemTimer16( HWND16 hwnd, UINT16 id )
{
TRACE("%04x %d\n", hwnd, id );
return TIMER_KillTimer( hwnd, id, TRUE );
}
/***********************************************************************
* KillSystemTimer (USER32.@)
*/
BOOL WINAPI KillSystemTimer( HWND hwnd, UINT id )
......
......@@ -11,6 +11,7 @@
#include "wingdi.h"
#include "wine/winuser16.h"
#include "wine/winbase16.h"
#include "win.h"
#include "heap.h"
DEFAULT_DEBUG_CHANNEL(win);
......@@ -39,13 +40,13 @@ BOOL16 WINAPI WinHelp16( HWND16 hWnd, LPCSTR lpHelpFile, UINT16 wCommand,
/* We might call WinExec() */
ReleaseThunkLock( &mutex_count );
if (!(ret = WinHelpA( hWnd, lpHelpFile, wCommand, (DWORD)MapSL(dwData) )))
if (!(ret = WinHelpA( WIN_Handle32(hWnd), lpHelpFile, wCommand, (DWORD)MapSL(dwData) )))
{
/* try to start the 16-bit winhelp */
if (WinExec( "winhelp.exe -x", SW_SHOWNORMAL ) >= 32)
{
K32WOWYield16();
ret = WinHelpA( hWnd, lpHelpFile, wCommand, (DWORD)MapSL(dwData) );
ret = WinHelpA( WIN_Handle32(hWnd), lpHelpFile, wCommand, (DWORD)MapSL(dwData) );
}
}
......
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