3,882
社区成员
发帖
与我相关
我的任务
分享
#ifdef _UNICODE
typedef wchar_t TCHAR;
#define __T(x) L##x
#define _T(x) __T(x)
#else
#define __T(x) x
typedef char TCHAR;
#endif
宏 未定义_UNICODE(ANSI字符) 定义了_UNICODE(Unicode字符)
_tcschr strchr wcschr
_tcscmp strcmp wcscmp
_tcslen strlen wcslen
#include <windows.h>
int main()
{
MessageBox(0, "test", "title", 0);
return 0;
}
WINUSERAPI
int
WINAPI
MessageBoxA(
__in_opt HWND hWnd,
__in_opt LPCSTR lpText,
__in_opt LPCSTR lpCaption,
__in UINT uType);
WINUSERAPI
int
WINAPI
MessageBoxW(
__in_opt HWND hWnd,
__in_opt LPCWSTR lpText,
__in_opt LPCWSTR lpCaption,
__in UINT uType);
#ifdef UNICODE
#define MessageBox MessageBoxW
#else
#define MessageBox MessageBoxA
#endif // !UNICODE