WinMain
Windows functions can be written easily in Unicode or ASCII. Besides the
difference in function name, _tWinMain also has different parameters than the
standard main function:
int WinMain(HINSTANCE hThisInstance,
HINSTANCE hPrevInstance,
LPSTR lpszArgument, // LPWSTR for wWinMain
int iCmdShow);
HINSTANCE objects are references to a program instance. hThisInstance is a
reference to the current program, and hPrevInstance is a reference to any
previously running versions of this same program. However, in Windows NT, the
hPrevInstance data object is always NULL. This means that we can't use the
hPrevInstance value to determine if there are other copies of the same program
running on your system. There are different ways of checking for other copies
of a program running, and we will discuss those methods later.
lpszArgument essentially contains all the information that the argc and argv
variables used to show, except that the command-line arguments are not broken
up into a vector. This means that if you want to sort individual arguments from
the command line, you need to either break them up yourself, or call one of the
available functions to break it up for you. We will discuss these functions
later.
The last argument, "int iCmdShow" is a data item of type int
(integer) that determines whether or not a graphical window should be displayed
immediately, or if the program should run minimized.