int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR lpCmd, int nShow)
what are these 4 parameters for , i always see them
int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR lpCmd, int nShow)
what are these 4 parameters for , i always see them
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.Quote:
hPrevInst is for console programs mostly (instance of the last console program in the same window).