Replace GetModuleHandle("user32.dll") with User32Instance.

svn path=/trunk/; revision=20122
This commit is contained in:
Filip Navara 2005-12-12 21:34:32 +00:00
parent fca11cd62d
commit 26846ce596
3 changed files with 17 additions and 22 deletions

View file

@ -349,7 +349,7 @@ static BOOL MDI_MenuDeleteItem( HWND client, HWND hWndChild )
if (clientInfo->nActiveChildren - 1 > MDI_MOREWINDOWSLIMIT)
{
WCHAR szTmp[50];
LoadStringW(GetModuleHandleA("USER32"), IDS_MDI_MOREWINDOWS, szTmp, sizeof(szTmp)/sizeof(szTmp[0]));
LoadStringW(User32Instance, IDS_MDI_MOREWINDOWS, szTmp, sizeof(szTmp)/sizeof(szTmp[0]));
AppendMenuW(clientInfo->hWindowMenu, MF_STRING, clientInfo->idFirstChild + MDI_MOREWINDOWSLIMIT, szTmp);
}
return TRUE;
@ -680,7 +680,7 @@ static HWND MDICreateChild( HWND parent, MDICLIENTINFO *ci,
if (ci->nActiveChildren == MDI_MOREWINDOWSLIMIT + 1)
{
WCHAR szTmp[50];
LoadStringW(GetModuleHandleA("USER32"), IDS_MDI_MOREWINDOWS, szTmp, sizeof(szTmp)/sizeof(szTmp[0]));
LoadStringW(User32Instance, IDS_MDI_MOREWINDOWS, szTmp, sizeof(szTmp)/sizeof(szTmp[0]));
ModifyMenuW(ci->hWindowMenu,
ci->idFirstChild + MDI_MOREWINDOWSLIMIT,
@ -2391,12 +2391,12 @@ static HWND MDI_MoreWindowsDialog(HWND hwnd)
HRSRC hRes;
HANDLE hDlgTmpl;
hRes = FindResourceA(GetModuleHandleA("USER32"), "MDI_MOREWINDOWS", (LPSTR)RT_DIALOG);
hRes = FindResourceA(User32Instance, "MDI_MOREWINDOWS", (LPSTR)RT_DIALOG);
if (hRes == 0)
return 0;
hDlgTmpl = LoadResource(GetModuleHandleA("USER32"), hRes );
hDlgTmpl = LoadResource(User32Instance, hRes);
if (hDlgTmpl == 0)
return 0;
@ -2406,7 +2406,7 @@ static HWND MDI_MoreWindowsDialog(HWND hwnd)
if (template == 0)
return 0;
return (HWND) DialogBoxIndirectParamA(GetModuleHandleA("USER32"),
return (HWND) DialogBoxIndirectParamA(User32Instance,
(LPDLGTEMPLATE) template,
hwnd, MDI_MoreWindowsDlgProc, (LPARAM) hwnd);
}

View file

@ -1043,9 +1043,7 @@ NTSTATUS STDCALL
User32LoadSysMenuTemplateForKernel(PVOID Arguments, ULONG ArgumentLength)
{
LRESULT Result;
HMODULE hUser32;
hUser32 = GetModuleHandleW(L"USER32");
Result = (LRESULT)LoadMenuW(hUser32, L"SYSMENU");
Result = (LRESULT)LoadMenuW(User32Instance, L"SYSMENU");
return(ZwCallbackReturn(&Result, sizeof(LRESULT), STATUS_SUCCESS));
}

View file

@ -196,7 +196,6 @@ MessageBoxTimeoutIndirectW(
DLGITEMTEMPLATE *iico, *itxt;
NONCLIENTMETRICSW nclm;
WCHAR capbuf[32];
HMODULE hUser32;
LPVOID buf;
BYTE *dest;
LPCWSTR caption, text;
@ -213,11 +212,9 @@ MessageBoxTimeoutIndirectW(
BOOL defbtn = FALSE;
DWORD units = GetDialogBaseUnits();
hUser32 = GetModuleHandleW(L"USER32");
if(!lpMsgBoxParams->lpszCaption || !HIWORD((LPWSTR)lpMsgBoxParams->lpszCaption))
{
LoadStringW(hUser32, IDS_ERROR, &capbuf[0], 32);
LoadStringW(User32Instance, IDS_ERROR, &capbuf[0], 32);
caption = &capbuf[0];
}
else
@ -335,34 +332,34 @@ MessageBoxTimeoutIndirectW(
switch(Buttons[i])
{
case IDOK:
LoadStringW(hUser32, IDS_OK, ButtonText[i], MSGBOXEX_MAXBTNSTR - 1);
LoadStringW(User32Instance, IDS_OK, ButtonText[i], MSGBOXEX_MAXBTNSTR - 1);
break;
case IDCANCEL:
LoadStringW(hUser32, IDS_CANCEL, ButtonText[i], MSGBOXEX_MAXBTNSTR - 1);
LoadStringW(User32Instance, IDS_CANCEL, ButtonText[i], MSGBOXEX_MAXBTNSTR - 1);
break;
case IDYES:
LoadStringW(hUser32, IDS_YES, ButtonText[i], MSGBOXEX_MAXBTNSTR - 1);
LoadStringW(User32Instance, IDS_YES, ButtonText[i], MSGBOXEX_MAXBTNSTR - 1);
break;
case IDNO:
LoadStringW(hUser32, IDS_NO, ButtonText[i], MSGBOXEX_MAXBTNSTR - 1);
LoadStringW(User32Instance, IDS_NO, ButtonText[i], MSGBOXEX_MAXBTNSTR - 1);
break;
case IDTRYAGAIN:
LoadStringW(hUser32, IDS_TRYAGAIN, ButtonText[i], MSGBOXEX_MAXBTNSTR - 1);
LoadStringW(User32Instance, IDS_TRYAGAIN, ButtonText[i], MSGBOXEX_MAXBTNSTR - 1);
break;
case IDCONTINUE:
LoadStringW(hUser32, IDS_CONTINUE, ButtonText[i], MSGBOXEX_MAXBTNSTR - 1);
LoadStringW(User32Instance, IDS_CONTINUE, ButtonText[i], MSGBOXEX_MAXBTNSTR - 1);
break;
case IDABORT:
LoadStringW(hUser32, IDS_ABORT, ButtonText[i], MSGBOXEX_MAXBTNSTR - 1);
LoadStringW(User32Instance, IDS_ABORT, ButtonText[i], MSGBOXEX_MAXBTNSTR - 1);
break;
case IDRETRY:
LoadStringW(hUser32, IDS_RETRY, ButtonText[i], MSGBOXEX_MAXBTNSTR - 1);
LoadStringW(User32Instance, IDS_RETRY, ButtonText[i], MSGBOXEX_MAXBTNSTR - 1);
break;
case IDIGNORE:
LoadStringW(hUser32, IDS_IGNORE, ButtonText[i], MSGBOXEX_MAXBTNSTR - 1);
LoadStringW(User32Instance, IDS_IGNORE, ButtonText[i], MSGBOXEX_MAXBTNSTR - 1);
break;
case IDHELP:
LoadStringW(hUser32, IDS_HELP, ButtonText[i], MSGBOXEX_MAXBTNSTR - 1);
LoadStringW(User32Instance, IDS_HELP, ButtonText[i], MSGBOXEX_MAXBTNSTR - 1);
break;
default:
ButtonText[i][0] = (WCHAR)0;