#include <tchar.h> int MessageBoxPrintf(HWND hwnd,UINT uType,TCHAR *szCaption,TCHAR *szFormat,...) { TCHAR szBuffer[1024]; va_list pArgList; va_start(pArgList,szFormat); _vsntprintf(szBuffer,sizeof(szBuffer)/sizeof(TCHAR),szFormat,pArgList); va_end(pArgList); return MessageBox(hwnd,szBuffer,szCaption,uType); }