1、Windows函数的呼叫:
/*早期MessageBox位于动态链接库USER.EXE*/
int WINAPI MessageBox(HWND,LPCSTR,LPCSTR,UINT); //第二、三个参数指向常数字符串的指针
/*
32位Windows则多包涵一个USER32.DLL的动态链接库,
它包含有32位使用者接口函数的进入点,两个进入点如下
*/
WINUSERAPI int WINAPI MessageBoxA(HWND hWnd,LPCSTR lpText,LPCSTR lpCaption,UINT uType);
WINUSERAPI int WINAPI MessageBoxW(HWND hWnd,LPCWSTR lpText,LPCWSTR lpCaption,UINT uType);
/*WINUSER.H若定义了UNICODE,则MessageBox为MessageBoxW,否则为MessageBoxA*/
#ifdef UNICODE
#define MessageBox MessageBoxW
#else
#define MessageBox MessageBoxA
#endif
2、Windows的字符串函数:
Windows 函数呼叫
/*同样,根据是否定义UNICODE,选择接受常规字符串还是宽字符串*/
ILength = Istrlen(pString); //计算长度
pString = Istrcpy(pString1,pString2); //复制字符串
pString = Istrcpyn(pString1,pString2,iCount);
pString = Istrcat(pString1,pString2); //连接字符串
iComp = Istrcmp(pString1,pString2); //比较字符串
iComp = Istrcmpi(pString1,pString2);