Commit 6f3b4944 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

user32: Remove some explicit LPARAM/WPARAM casts.

parent 425cc7e0
......@@ -742,7 +742,7 @@ static void BUTTON_DrawLabel(HWND hwnd, HDC hdc, UINT dtFlags, const RECT *rc)
lpOutputProc = BUTTON_DrawTextCallback;
if (!(text = get_button_text( hwnd ))) return;
lp = (LPARAM)text;
wp = (WPARAM)dtFlags;
wp = dtFlags;
break;
case BS_ICON:
......
......@@ -717,7 +717,7 @@ static void CBPaintText(
if( (pText = HeapAlloc( GetProcessHeap(), 0, (size + 1) * sizeof(WCHAR))) )
{
/* size from LB_GETTEXTLEN may be too large, from LB_GETTEXT is accurate */
size=SendMessageW(lphc->hWndLBox, LB_GETTEXT, (WPARAM)id, (LPARAM)pText);
size=SendMessageW(lphc->hWndLBox, LB_GETTEXT, id, (LPARAM)pText);
pText[size] = '\0'; /* just in case */
} else return;
}
......@@ -730,7 +730,7 @@ static void CBPaintText(
static const WCHAR empty_stringW[] = { 0 };
if( CB_HASSTRINGS(lphc) ) SetWindowTextW( lphc->hWndEdit, pText ? pText : empty_stringW );
if( lphc->wState & CBF_FOCUSED )
SendMessageW(lphc->hWndEdit, EM_SETSEL, 0, (LPARAM)(-1));
SendMessageW(lphc->hWndEdit, EM_SETSEL, 0, -1);
}
else /* paint text field ourselves */
{
......@@ -776,8 +776,7 @@ static void CBPaintText(
dis.itemState = itemState;
dis.hDC = hdc;
dis.rcItem = rectEdit;
dis.itemData = SendMessageW(lphc->hWndLBox, LB_GETITEMDATA,
(WPARAM)id, 0 );
dis.itemData = SendMessageW(lphc->hWndLBox, LB_GETITEMDATA, id, 0);
/*
* Clip the DC and have the parent draw the item.
......@@ -975,16 +974,15 @@ static INT CBUpdateLBox( LPHEADCOMBO lphc, BOOL bSelect )
if( pText )
{
GetWindowTextW( lphc->hWndEdit, pText, length + 1);
idx = SendMessageW(lphc->hWndLBox, LB_FINDSTRING,
(WPARAM)(-1), (LPARAM)pText );
idx = SendMessageW(lphc->hWndLBox, LB_FINDSTRING, -1, (LPARAM)pText);
HeapFree( GetProcessHeap(), 0, pText );
}
SendMessageW(lphc->hWndLBox, LB_SETCURSEL, (WPARAM)(bSelect ? idx : -1), 0);
SendMessageW(lphc->hWndLBox, LB_SETCURSEL, bSelect ? idx : -1, 0);
/* probably superfluous but Windows sends this too */
SendMessageW(lphc->hWndLBox, LB_SETCARETINDEX, (WPARAM)(idx < 0 ? 0 : idx), 0);
SendMessageW(lphc->hWndLBox, LB_SETTOPINDEX, (WPARAM)(idx < 0 ? 0 : idx), 0);
SendMessageW(lphc->hWndLBox, LB_SETCARETINDEX, idx < 0 ? 0 : idx, 0);
SendMessageW(lphc->hWndLBox, LB_SETTOPINDEX, idx < 0 ? 0 : idx, 0);
return idx;
}
......@@ -1004,13 +1002,12 @@ static void CBUpdateEdit( LPHEADCOMBO lphc , INT index )
if( index >= 0 ) /* got an entry */
{
length = SendMessageW(lphc->hWndLBox, LB_GETTEXTLEN, (WPARAM)index, 0);
length = SendMessageW(lphc->hWndLBox, LB_GETTEXTLEN, index, 0);
if( length != LB_ERR)
{
if( (pText = HeapAlloc( GetProcessHeap(), 0, (length + 1) * sizeof(WCHAR))) )
{
SendMessageW(lphc->hWndLBox, LB_GETTEXT,
(WPARAM)index, (LPARAM)pText );
SendMessageW(lphc->hWndLBox, LB_GETTEXT, index, (LPARAM)pText);
}
}
}
......@@ -1023,7 +1020,7 @@ static void CBUpdateEdit( LPHEADCOMBO lphc , INT index )
}
if( lphc->wState & CBF_FOCUSED )
SendMessageW(lphc->hWndEdit, EM_SETSEL, 0, (LPARAM)(-1));
SendMessageW(lphc->hWndEdit, EM_SETSEL, 0, -1);
HeapFree( GetProcessHeap(), 0, pText );
}
......@@ -1061,7 +1058,7 @@ static void CBDropDown( LPHEADCOMBO lphc )
lphc->droppedIndex = SendMessageW(lphc->hWndLBox, LB_GETCURSEL, 0, 0);
SendMessageW(lphc->hWndLBox, LB_SETTOPINDEX,
(WPARAM)(lphc->droppedIndex == LB_ERR ? 0 : lphc->droppedIndex), 0 );
lphc->droppedIndex == LB_ERR ? 0 : lphc->droppedIndex, 0);
SendMessageW(lphc->hWndLBox, LB_CARETON, 0, 0);
}
......@@ -1356,7 +1353,7 @@ static LRESULT COMBO_Command( LPHEADCOMBO lphc, WPARAM wParam, HWND hWnd )
lphc->wState |= CBF_NOLBSELECT;
CBUpdateEdit( lphc, index );
/* select text in edit, as Windows does */
SendMessageW(lphc->hWndEdit, EM_SETSEL, 0, (LPARAM)(-1));
SendMessageW(lphc->hWndEdit, EM_SETSEL, 0, -1);
}
else
{
......@@ -1655,8 +1652,7 @@ static LRESULT COMBO_SetItemHeight( LPHEADCOMBO lphc, INT index, INT height )
}
}
else if ( CB_OWNERDRAWN(lphc) ) /* set listbox item height */
lRet = SendMessageW(lphc->hWndLBox, LB_SETITEMHEIGHT,
(WPARAM)index, (LPARAM)height );
lRet = SendMessageW(lphc->hWndLBox, LB_SETITEMHEIGHT, index, height);
return lRet;
}
......@@ -1665,8 +1661,8 @@ static LRESULT COMBO_SetItemHeight( LPHEADCOMBO lphc, INT index, INT height )
*/
static LRESULT COMBO_SelectString( LPHEADCOMBO lphc, INT start, LPARAM pText, BOOL unicode )
{
INT index = unicode ? SendMessageW(lphc->hWndLBox, LB_SELECTSTRING, (WPARAM)start, pText) :
SendMessageA(lphc->hWndLBox, LB_SELECTSTRING, (WPARAM)start, pText);
INT index = unicode ? SendMessageW(lphc->hWndLBox, LB_SELECTSTRING, start, pText) :
SendMessageA(lphc->hWndLBox, LB_SELECTSTRING, start, pText);
if( index >= 0 )
{
if( lphc->wState & CBF_EDIT )
......
......@@ -3195,14 +3195,14 @@ static BOOL EDIT_CheckCombo(EDITSTATE *es, UINT msg, INT key)
nEUI = 2;
}
SendMessageW(hLBox, WM_KEYDOWN, (WPARAM)key, 0);
SendMessageW(hLBox, WM_KEYDOWN, key, 0);
break;
case WM_SYSKEYDOWN: /* Handle Alt+up/down arrows */
if (nEUI)
SendMessageW(hCombo, CB_SHOWDROPDOWN, bDropped ? FALSE : TRUE, 0);
else
SendMessageW(hLBox, WM_KEYDOWN, (WPARAM)VK_F4, 0);
SendMessageW(hLBox, WM_KEYDOWN, VK_F4, 0);
break;
}
......@@ -3326,7 +3326,7 @@ static LRESULT EDIT_WM_KeyDown(EDITSTATE *es, INT key)
HWND hwDefCtrl = GetDlgItem(es->hwndParent, LOWORD(dw));
if (hwDefCtrl)
{
SendMessageW(es->hwndParent, WM_NEXTDLGCTL, (WPARAM)hwDefCtrl, (LPARAM)TRUE);
SendMessageW(es->hwndParent, WM_NEXTDLGCTL, (WPARAM)hwDefCtrl, TRUE);
PostMessageW(hwDefCtrl, WM_KEYDOWN, VK_RETURN, 0);
}
}
......@@ -3797,7 +3797,7 @@ static LRESULT EDIT_WM_SysKeyDown(EDITSTATE *es, INT key, DWORD key_data)
if (EDIT_CheckCombo(es, WM_SYSKEYDOWN, key))
return 0;
}
return DefWindowProcW(es->hwndSelf, WM_SYSKEYDOWN, (WPARAM)key, (LPARAM)key_data);
return DefWindowProcW(es->hwndSelf, WM_SYSKEYDOWN, key, key_data);
}
......
......@@ -1583,7 +1583,7 @@ LRESULT WINAPI DefMDIChildProcW( HWND hwnd, UINT message,
case WM_SYSCHAR:
if (wParam == '-')
{
SendMessageW( hwnd, WM_SYSCOMMAND, (WPARAM)SC_KEYMENU, (DWORD)VK_SPACE);
SendMessageW( hwnd, WM_SYSCOMMAND, SC_KEYMENU, VK_SPACE);
return 0;
}
break;
......@@ -1686,7 +1686,7 @@ BOOL WINAPI TranslateMDISysAccel( HWND hwndClient, LPMSG msg )
return 0;
}
TRACE("wParam = %04lx\n", wParam);
SendMessageW(ci->hwndActiveChild, WM_SYSCOMMAND, wParam, (LPARAM)msg->wParam);
SendMessageW(ci->hwndActiveChild, WM_SYSCOMMAND, wParam, msg->wParam);
return 1;
}
}
......
......@@ -1750,7 +1750,7 @@ static BOOL process_keyboard_message( MSG *msg, UINT hw_id, HWND hwnd_filter,
{
/* Handle VK_APPS key by posting a WM_CONTEXTMENU message */
if (msg->wParam == VK_APPS && !MENU_IsMenuActive())
PostMessageW(msg->hwnd, WM_CONTEXTMENU, (WPARAM)msg->hwnd, (LPARAM)-1);
PostMessageW(msg->hwnd, WM_CONTEXTMENU, (WPARAM)msg->hwnd, -1);
}
}
......
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