• ### Announcements

#### Archived

This topic is now archived and is closed to further replies.

# Making the window disappear

## Recommended Posts

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?

##### Share on other sites
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.

##### Share on other sites
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

##### Share on other sites
Has the same effect as the way I did it. What were those other ideas?

##### Share on other sites
DanTheRocker, that''s so strange that I tried your codes and succeeded!
I am using Win2000, does this matter?

##### Share on other sites
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?

##### Share on other sites
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

• ## Partner Spotlight

• ### Forum Statistics

• Total Topics
627651
• Total Posts
2978397

• 10
• 12
• 22
• 13
• 33