user: Prefer SendMessageW over SendMessageA where possible.

This commit is contained in:
Alexandre Julliard 2006-05-10 21:33:33 +02:00
parent 2164815a9a
commit 6ebbfd4959
5 changed files with 20 additions and 20 deletions

View File

@ -159,15 +159,15 @@ static BOOL DEFDLG_SetDefId( HWND hwndDlg, DIALOGINFO *dlgInfo, WPARAM wParam)
/* Make sure the old default control is a valid push button ID */ /* Make sure the old default control is a valid push button ID */
hwndOld = GetDlgItem( hwndDlg, old_id ); hwndOld = GetDlgItem( hwndDlg, old_id );
if (!hwndOld || !(SendMessageA( hwndOld, WM_GETDLGCODE, 0, 0) & DLGC_DEFPUSHBUTTON)) if (!hwndOld || !(SendMessageW( hwndOld, WM_GETDLGCODE, 0, 0) & DLGC_DEFPUSHBUTTON))
hwndOld = DEFDLG_FindDefButton( hwndDlg ); hwndOld = DEFDLG_FindDefButton( hwndDlg );
if (hwndOld && hwndOld != hwndNew) if (hwndOld && hwndOld != hwndNew)
SendMessageA( hwndOld, BM_SETSTYLE, BS_PUSHBUTTON, TRUE ); SendMessageW( hwndOld, BM_SETSTYLE, BS_PUSHBUTTON, TRUE );
if (hwndNew) if (hwndNew)
{ {
if(dlgcode & DLGC_UNDEFPUSHBUTTON) if(dlgcode & DLGC_UNDEFPUSHBUTTON)
SendMessageA( hwndNew, BM_SETSTYLE, BS_DEFPUSHBUTTON, TRUE ); SendMessageW( hwndNew, BM_SETSTYLE, BS_DEFPUSHBUTTON, TRUE );
} }
return TRUE; return TRUE;
} }
@ -197,15 +197,15 @@ static BOOL DEFDLG_SetDefButton( HWND hwndDlg, DIALOGINFO *dlgInfo, HWND hwndNew
} }
/* Make sure the old default control is a valid push button ID */ /* Make sure the old default control is a valid push button ID */
if (!hwndOld || !(SendMessageA( hwndOld, WM_GETDLGCODE, 0, 0) & DLGC_DEFPUSHBUTTON)) if (!hwndOld || !(SendMessageW( hwndOld, WM_GETDLGCODE, 0, 0) & DLGC_DEFPUSHBUTTON))
hwndOld = DEFDLG_FindDefButton( hwndDlg ); hwndOld = DEFDLG_FindDefButton( hwndDlg );
if (hwndOld && hwndOld != hwndNew) if (hwndOld && hwndOld != hwndNew)
SendMessageA( hwndOld, BM_SETSTYLE, BS_PUSHBUTTON, TRUE ); SendMessageW( hwndOld, BM_SETSTYLE, BS_PUSHBUTTON, TRUE );
if (hwndNew) if (hwndNew)
{ {
if(dlgcode & DLGC_UNDEFPUSHBUTTON) if(dlgcode & DLGC_UNDEFPUSHBUTTON)
SendMessageA( hwndNew, BM_SETSTYLE, BS_DEFPUSHBUTTON, TRUE ); SendMessageW( hwndNew, BM_SETSTYLE, BS_DEFPUSHBUTTON, TRUE );
} }
return TRUE; return TRUE;
} }
@ -300,8 +300,8 @@ static LRESULT DEFDLG_Proc( HWND hwnd, UINT msg, WPARAM wParam,
if (hwndFocus) if (hwndFocus)
{ {
/* always make combo box hide its listbox control */ /* always make combo box hide its listbox control */
if (!SendMessageA( hwndFocus, CB_SHOWDROPDOWN, FALSE, 0 )) if (!SendMessageW( hwndFocus, CB_SHOWDROPDOWN, FALSE, 0 ))
SendMessageA( GetParent(hwndFocus), CB_SHOWDROPDOWN, FALSE, 0 ); SendMessageW( GetParent(hwndFocus), CB_SHOWDROPDOWN, FALSE, 0 );
} }
} }
return DefWindowProcA( hwnd, msg, wParam, lParam ); return DefWindowProcA( hwnd, msg, wParam, lParam );

View File

@ -228,8 +228,8 @@ LRESULT WINAPI IconTitleWndProc( HWND hWnd, UINT msg,
if (wParam) ICONTITLE_SetTitlePos( hWnd, owner ); if (wParam) ICONTITLE_SetTitlePos( hWnd, owner );
return 0; return 0;
case WM_ERASEBKGND: case WM_ERASEBKGND:
if( GetWindowLongA( owner, GWL_STYLE ) & WS_CHILD ) if( GetWindowLongW( owner, GWL_STYLE ) & WS_CHILD )
lParam = SendMessageA( owner, WM_ISACTIVEICON, 0, 0 ); lParam = SendMessageW( owner, WM_ISACTIVEICON, 0, 0 );
else else
lParam = (owner == GetActiveWindow()); lParam = (owner == GetActiveWindow());
if( ICONTITLE_Paint( hWnd, owner, (HDC)wParam, (BOOL)lParam ) ) if( ICONTITLE_Paint( hWnd, owner, (HDC)wParam, (BOOL)lParam ) )

View File

@ -671,7 +671,7 @@ static LONG MDICascade( HWND client, MDICLIENTINFO *ci )
int i, total; int i, total;
if (IsZoomed(ci->hwndActiveChild)) if (IsZoomed(ci->hwndActiveChild))
SendMessageA(client, WM_MDIRESTORE, (WPARAM)ci->hwndActiveChild, 0); SendMessageW(client, WM_MDIRESTORE, (WPARAM)ci->hwndActiveChild, 0);
if (ci->nActiveChildren == 0) return 0; if (ci->nActiveChildren == 0) return 0;
@ -724,7 +724,7 @@ static void MDITile( HWND client, MDICLIENTINFO *ci, WPARAM wParam )
BOOL has_icons = FALSE; BOOL has_icons = FALSE;
if (IsZoomed(ci->hwndActiveChild)) if (IsZoomed(ci->hwndActiveChild))
SendMessageA(client, WM_MDIRESTORE, (WPARAM)ci->hwndActiveChild, 0); SendMessageW(client, WM_MDIRESTORE, (WPARAM)ci->hwndActiveChild, 0);
if (ci->nActiveChildren == 0) return; if (ci->nActiveChildren == 0) return;

View File

@ -1318,9 +1318,9 @@ static void NC_TrackMinMaxBox( HWND hwnd, WORD wParam )
return; return;
if (wParam == HTMINBUTTON) if (wParam == HTMINBUTTON)
SendMessageA( hwnd, WM_SYSCOMMAND, SC_MINIMIZE, MAKELONG(msg.pt.x,msg.pt.y) ); SendMessageW( hwnd, WM_SYSCOMMAND, SC_MINIMIZE, MAKELONG(msg.pt.x,msg.pt.y) );
else else
SendMessageA( hwnd, WM_SYSCOMMAND, SendMessageW( hwnd, WM_SYSCOMMAND,
IsZoomed(hwnd) ? SC_RESTORE:SC_MAXIMIZE, MAKELONG(msg.pt.x,msg.pt.y) ); IsZoomed(hwnd) ? SC_RESTORE:SC_MAXIMIZE, MAKELONG(msg.pt.x,msg.pt.y) );
} }
@ -1377,7 +1377,7 @@ static void NC_TrackCloseButton (HWND hwnd, WORD wParam)
ReleaseDC( hwnd, hdc ); ReleaseDC( hwnd, hdc );
if (!pressed) return; if (!pressed) return;
SendMessageA( hwnd, WM_SYSCOMMAND, SC_CLOSE, MAKELONG(msg.pt.x,msg.pt.y) ); SendMessageW( hwnd, WM_SYSCOMMAND, SC_CLOSE, MAKELONG(msg.pt.x,msg.pt.y) );
} }
@ -1573,7 +1573,7 @@ LRESULT NC_HandleSysCommand( HWND hwnd, WPARAM wParam, LPARAM lParam )
break; break;
case SC_CLOSE: case SC_CLOSE:
return SendMessageA( hwnd, WM_CLOSE, 0, 0 ); return SendMessageW( hwnd, WM_CLOSE, 0, 0 );
case SC_VSCROLL: case SC_VSCROLL:
case SC_HSCROLL: case SC_HSCROLL:

View File

@ -385,7 +385,7 @@ HWND WINPOS_WindowFromPoint( HWND hwndScope, POINT pt, INT *hittest )
*hittest = HTCLIENT; *hittest = HTCLIENT;
break; break;
} }
res = SendMessageA( list[i], WM_NCHITTEST, 0, MAKELONG(pt.x,pt.y) ); res = SendMessageW( list[i], WM_NCHITTEST, 0, MAKELONG(pt.x,pt.y) );
if (res != HTTRANSPARENT) if (res != HTTRANSPARENT)
{ {
*hittest = res; /* Found the window */ *hittest = res; /* Found the window */
@ -679,7 +679,7 @@ BOOL WINPOS_RedrawIconTitle( HWND hWnd )
{ {
if( lpPos->hwndIconTitle ) if( lpPos->hwndIconTitle )
{ {
SendMessageA( lpPos->hwndIconTitle, WM_SHOWWINDOW, TRUE, 0); SendMessageW( lpPos->hwndIconTitle, WM_SHOWWINDOW, TRUE, 0);
InvalidateRect( lpPos->hwndIconTitle, NULL, TRUE ); InvalidateRect( lpPos->hwndIconTitle, NULL, TRUE );
return TRUE; return TRUE;
} }
@ -706,7 +706,7 @@ BOOL WINPOS_ShowIconTitle( HWND hwnd, BOOL bShow )
{ {
if (!IsWindowVisible(title)) if (!IsWindowVisible(title))
{ {
SendMessageA( title, WM_SHOWWINDOW, TRUE, 0 ); SendMessageW( title, WM_SHOWWINDOW, TRUE, 0 );
SetWindowPos( title, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SetWindowPos( title, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE |
SWP_NOACTIVATE | SWP_NOZORDER | SWP_SHOWWINDOW ); SWP_NOACTIVATE | SWP_NOZORDER | SWP_SHOWWINDOW );
} }
@ -795,7 +795,7 @@ void WINPOS_GetMinMaxInfo( HWND hwnd, POINT *maxSize, POINT *maxPos,
MinMax.ptMaxPosition.y = -yinc; MinMax.ptMaxPosition.y = -yinc;
} }
SendMessageA( hwnd, WM_GETMINMAXINFO, 0, (LPARAM)&MinMax ); SendMessageW( hwnd, WM_GETMINMAXINFO, 0, (LPARAM)&MinMax );
/* Some sanity checks */ /* Some sanity checks */