int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR lpCmd, int nShow)
what are these 4 parameters for , i always see them
This is a discussion on int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR lpCmd, int nShow) { within the Windows Programming forums, part of the Platform Specific Boards category; int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR lpCmd, int nShow) what are these 4 parameters for , i always see ...
int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR lpCmd, int nShow)
what are these 4 parameters for , i always see them
"You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter
The first one, hInst, is needed for creating windows, controls etc. and much more. But you can always use GetModuleHandle(NULL) anywhere you need to put a HISTANCE.
hPrevInst is for console programs mostly (instance of the last console program in the same window).
lpCmd is the command line for the program (for parameters).
nShow is needed for ShowWindow(windowhandle,nShow).
I assume you didn't understand anything in my explanations. I am so bad explanator.
Actually hPrevInst is depreciated, and always NULL.hPrevInst is for console programs mostly (instance of the last console program in the same window).