?? crtmbox.c
字號:
/***
*crtmbox.c - CRT MessageBoxA wrapper.
*
* Copyright (c) 1995-1997, Microsoft Corporation. All rights reserved.
*
*Purpose:
* Wrap MessageBoxA.
*
*******************************************************************************/
#ifdef _WIN32
#include <awint.h>
/***
*__crtMessageBox - call MessageBoxA dynamically.
*
*Purpose:
* Avoid static link with user32.dll. Only load it when actually needed.
*
*Entry:
* see MessageBoxA docs.
*
*Exit:
* see MessageBoxA docs.
*
*Exceptions:
*
*******************************************************************************/
int __cdecl __crtMessageBoxA(
LPCSTR lpText,
LPCSTR lpCaption,
UINT uType
)
{
static int (APIENTRY *pfnMessageBoxA)(HWND, LPCSTR, LPCSTR, UINT) = NULL;
static HWND (APIENTRY *pfnGetActiveWindow)(void) = NULL;
static HWND (APIENTRY *pfnGetLastActivePopup)(HWND) = NULL;
HWND hWndParent = NULL;
if (NULL == pfnMessageBoxA)
{
HANDLE hlib = LoadLibrary("user32.dll");
if (NULL == hlib || NULL == (pfnMessageBoxA =
(int (APIENTRY *)(HWND, LPCSTR, LPCSTR, UINT))
GetProcAddress(hlib, "MessageBoxA")))
return 0;
pfnGetActiveWindow = (HWND (APIENTRY *)(void))
GetProcAddress(hlib, "GetActiveWindow");
pfnGetLastActivePopup = (HWND (APIENTRY *)(HWND))
GetProcAddress(hlib, "GetLastActivePopup");
}
if (pfnGetActiveWindow)
hWndParent = (*pfnGetActiveWindow)();
if (hWndParent != NULL && pfnGetLastActivePopup)
hWndParent = (*pfnGetLastActivePopup)(hWndParent);
return (*pfnMessageBoxA)(hWndParent, lpText, lpCaption, uType);
}
#endif /* _WIN32 */
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -