How to simulate 'X' (the red button at the top right corner) ?
-
I'm developing a game in win32 c++ DirectX. On my graphic game window I have a picture of a 'close' button. When I click on it I want it to to the same as clicking the 'X' button. But although I tried several things:
::SendMessage(hWnd, WM_CLOSE, NULL, NULL);
::SendMessage(hWnd, WM_DESTROY, NULL, NULL);
DestroyWindow(hWnd);
I get strange bugs that won't happen when I click 'X'. -
I'm developing a game in win32 c++ DirectX. On my graphic game window I have a picture of a 'close' button. When I click on it I want it to to the same as clicking the 'X' button. But although I tried several things:
::SendMessage(hWnd, WM_CLOSE, NULL, NULL);
::SendMessage(hWnd, WM_DESTROY, NULL, NULL);
DestroyWindow(hWnd);
I get strange bugs that won't happen when I click 'X'. -
I'm developing a game in win32 c++ DirectX. On my graphic game window I have a picture of a 'close' button. When I click on it I want it to to the same as clicking the 'X' button. But although I tried several things:
::SendMessage(hWnd, WM_CLOSE, NULL, NULL);
::SendMessage(hWnd, WM_DESTROY, NULL, NULL);
DestroyWindow(hWnd);
I get strange bugs that won't happen when I click 'X'.Hanan888 wrote:
::SendMessage(hWnd, WM_DESTROY, NULL, NULL);
Don't do that! That doesn't destroy a window :) Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
Hanan888 wrote:
::SendMessage(hWnd, WM_DESTROY, NULL, NULL);
Don't do that! That doesn't destroy a window :) Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
Thanks. I Really shouldn't post
::SendMessage(hWnd, WM_DESTROY, NULL, NULL);
as a real candidate. I was pretty desperate when I posted that message... :)hehe the last act of a desperate programmer :)
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
Hanan888 wrote:
::SendMessage(hWnd, WM_DESTROY, NULL, NULL);
Don't do that! That doesn't destroy a window :) Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
Mark Salsbery wrote:
Don't do that! That doesn't destroy a window
Opps, let me check how many windows has been destroyed by me till date!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
Never mind - my own stupidity is the source of every "problem" - Mixturecheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You/codeProject$$>
-
hehe the last act of a desperate programmer :)
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
"He got sick of it. Sick of life, sick of people, sick of Win32. Desperate and dispirited, he code
::SendMessage(hWnd, WM_DESTROY, NULL, NULL);
. And I can tell you this: whatever it does, it doesn't destroy a window..." :):laugh: Excellent!
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
Mark Salsbery wrote:
Don't do that! That doesn't destroy a window
Opps, let me check how many windows has been destroyed by me till date!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
Never mind - my own stupidity is the source of every "problem" - Mixturecheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You/codeProject$$>
Huh? What are you talking about Alok? :)
Mark Salsbery Microsoft MVP - Visual C++ :java: