Fixed. Thanks.
Printable View
Fixed. Thanks.
Which window are you trying to use ShowWindow() on?
You are using a main (console app) not a winmain (windows app)
You declare a variable and use it before initialising it.
As a general rule I suggest you;Code:HWND hwndMain; //not inititalised
ShowWindow(hwndMain, SW_FORCEMINIMIZE);//will fail as not told WHICH window to minimise
Init ALL variables in the declaration.
Check returns from WIN32 functions
If they fail (check the return code in MSDN) use GetLastError() to find out why.
You need to work a little on that indentation of yours, too.
It will do you wonders. Good luck.
Yeah thanks guys. I initialized it,And now it works... I'm going to start working on my indentation too... It'll be easier to read. Thanks again to both of you.Code:hwndMain=FindWindowA("ConsoleWindowClass",NULL);