“APIENTRY _tWinMain” and “WINAPI WinMain” difference

_tWinMain is just a #define shortcut in tchar.h to the appropriate version of WinMain.

If _UNICODE is defined, then _tWinMain expands to wWinMain. Otherwise, _tWinMain is the same as WinMain.

The relevant macro looks something like this (there’s actually a lot of other code interspersed):

#ifdef  _UNICODE
#define _tWinMain  wWinMain
#else
#define _tWinMain  WinMain
#endif

Leave a Comment