Making the window disappear

Started by
5 comments, last by DanTheRocker 22 years, 5 months ago
When the user clicks the minimize button, I would like my window to disappear from the start bar as well. I have this code: case WM_SYSCOMMAND: switch( LOWORD( wParam ) ) { case SC_MINIMIZE: ShowWindow( hWnd, SW_HIDE ); break; } break; After trying this, I came to realize that the SW_HIDE flag does no get rid of the start bar, it only minimizes the window. What should I put in the SC_MINIMIZE case statement to make the window go completely away?
-Dan
Advertisement
Well, first of all. this message is only recieved when the user is trying to minimize the window so that''s what it should do. However if you really wan the window to go completely away (never to be seen again). Then just call DestroyWindow(hWnd) and your window will go bye bye.
------------------------------Piggies, I need more piggies![pig][pig][pig][pig][pig][pig]------------------------------Do not invoke the wrath of the Irken elite. [flaming]
i'm not sure if this will work, but try this:

    //test for system commands in the message quecase WM_SYSCOMMAND:     /*switch the loword:wparam in case we have other wm_system  commands, then it will make it easier to read*/     switch( LOWORD( wParam ) )     {     //we want to hide the window if the user tries to minimise      case SC_MINIMIZE://test case minimize     ShowWindow( hWnd, FALSE );//hide the window     }break;}break;     


if this doesn't suit ur needs, i have a few other ideas.

Edited by - kmsixpence on November 12, 2001 7:29:18 PM

Edited by - kmsixpence on November 12, 2001 7:30:03 PM

Edited by - kmsixpence on November 12, 2001 7:30:51 PM

Edited by - kmsixpence on November 12, 2001 7:33:16 PM
Has the same effect as the way I did it. What were those other ideas?
-Dan
DanTheRocker, that''s so strange that I tried your codes and succeeded!
I am using Win2000, does this matter?
humm...so it worked for you did it? Im using Win98. The only thing different that it does for me is make it minimize faster. It totally went away for you? Does this work for other people?
-Dan
Whoa,Whoa,Whoa...I just tried putting it somewhere else and it worked. I see no reason that it sould have made a difference, but it works so I''m happy. Thanks
-Dan

This topic is closed to new replies.

Advertisement