This is a discussion on Big problem :( within the Windows Programming forums, part of the Platform Specific Boards category; Fixed. Thanks....
Last edited by bradszy; 02-19-2008 at 01:01 AM.
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.
Last edited by novacain; 02-18-2008 at 11:57 PM.
"Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
"I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
"If you are going through hell....keep going."
For information on how to enable C++11 on your compiler, look here.
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);