What does hInstance mean?

What does hInstance mean?

handle to
hInstance is something called a “handle to an instance” or “handle to a module.” The operating system uses this value to identify the executable (EXE) when it is loaded in memory. The instance handle is needed for certain Windows functions—for example, to load icons or bitmaps.

What is the difference between wWinMain and WinMain?

The only difference between WinMain and wWinMain is the command line string and you should use wWinMain in Unicode applications (and all applications created these days should use Unicode). You can of course manually call GetCommandLineW() in WinMain and parse it yourself if you really want to.

How is WinMain called?

WinMain() is a function which is called by the operating system during creation of a process. First argument is the instance handle of the current application process. Next argument is the handle of the previous instance (used in Win16 programs, no longer used in Win32).

What does WinMain mean?

It means you’re building your program as a 16-bit windows executable. WinMain() is the traditional start point for windows programs (rather than main() which is standard C) and WinMain@16 is that name as adorned when compiling and linking to produce a 16 bit windows program.

What is mainCRTStartup?

mainCRTStartup() is the entrypoint of the C runtime library. It initializes the CRT, calls any static initializers that you wrote in your code, then calls your main() function. Clearly it is essential that both the CRT and your own initialization is performed first.

Where is WinMain defined?

The WinMain char based function was introduced with Windows, in the early 1980’s: int CALLBACK WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow ); where CALLBACK , HINSTANCE and LPSTR are defined by the h> header ( LPSTR is just char* ).

Which is the entry point of window application?

All 32-bit Windows operating system applications use the calling convention WINAPI. This calling convention MUST be used to distinguish the function as the entry point.

What is Lpbyte?

LPBYTE is just a long pointer to a BYTE array. Generally you call RegQueryValueEx twice, once to get the size of the buffer, and once to get the data.

How big is a Tchar?

if you use _UNICODE the sizeof(TCHAR) == sizeof(unsigned short) meaning 2 bytes!

Which is the parameter of the WinMain (): *?

ANSI applications can use the lpCmdLine parameter of the WinMain function to access the command-line string, excluding the program name. Note that lpCmdLine uses the LPSTR data type instead of the LPTSTR data type.