Raymond Chen explains it here: TEXT vs. _TEXT vs. _T, and UNICODE vs. _UNICODE:
The plain versions without the underscore affect the character set the Windows header files treat as default. So if you define
UNICODE
, thenGetWindowText
will map toGetWindowTextW
instead ofGetWindowTextA
, for example. Similarly, theTEXT
macro will map toL"..."
instead of"..."
.The versions with the underscore affect the character set the C runtime header files treat as default. So if you define
_UNICODE
, then_tcslen
will map towcslen
instead ofstrlen
, for example. Similarly, the_TEXT
macro will map toL"..."
instead of"..."
.
Looking into Windows SDK you will find things like this:
#ifdef _UNICODE
#ifndef UNICODE
#define UNICODE
#endif
#endif