Unicode简介
#include<windows.h> #include<stdio.h> #include<tchar.h> #include<stdarg.h> typedef TCHAR tchar; int __cdecl MessageBoxPrint(tchar *Caption, tchar *szFormat, ...){ tchar szBuffer[1024] = {}; va_list pArgList; va_start(pArgList, szFormat); _vsnprintf(szBuffer, sizeof szBuffer / sizeof(tchar), szFormat, pArgList); va_end(pArgList); return MessageBox(nullptr, Caption, szBuffer, MB_OK); } int __stdcall WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow){ int screex_x = GetSystemMetrics(SM_CXSCREEN); int screex_y = GetSystemMetrics(SM_CYSCREEN); tchar *caption = TEXT("fengyucoding"); tchar *szFormat = TEXT("the screen is %d width, %d high"); return MessageBoxPrint(caption, szFormat, screex_x, screex_y); }