Making the window disappear
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?
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.
i'm not sure if this will work, but try this:
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
//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
DanTheRocker, that''s so strange that I tried your codes and succeeded!
I am using Win2000, does this matter?
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?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement