Archived

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

DanTheRocker

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 this post


Link to post
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 this post


Link to post
Share on other sites
i'm not sure if this will work, but try this:

    

//test for system commands in the message que

case 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 this post


Link to post
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 this post


Link to post
Share on other sites