Does anyone know when we need to use Unicode function rather than ANSI function when we use WinMain or wWinMain? Or can we use the normal generic function? And also with the usage of WinMain or wWinMain, will it affect the type of parameter used in a function?
For example in the two different tutorials of creating empty windoes, one tutorial from MSDN specifies like this:
int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE, PWSTR pCmdLine, int nCmdShow)
{
...
// Create the window.
HWND hwnd = CreateWindowEx(
0, // Optional window styles.
CLASS_NAME, // Window class
L"Learn to Program Windows", // Window text
WS_OVERLAPPEDWINDOW, // Window style
// Size and position
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
NULL, // Parent window
NULL, // Menu
hInstance, // Instance handle
NULL // Additional application data
);
While another tutorial specifies like this:
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nCmdShow)
{
...
hwnd = CreateWindowEx(
WS_EX_CLIENTEDGE,
g_szClassName,
"The title of my window",
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, CW_USEDEFAULT, 240, 120,
NULL, NULL, hInstance, NULL);
Notice in the title of the window, one is using L"Title" while another is using "Title", so I assume that depending of types of WinMain it also affects type of parameters since as far as I know wWinMain is used for Unicode and WinMain is for ANSI.
Also another related question if I am using wWinMain or WinMain and then I use the generic function, such as MessageBox, will it resolve to MessageBoxW or MessageBoxA depending of WinMain type?
Thanks