Hi, I am a newbie who is trying to find a command/syntax to end a program from the menu of that program.
Does such a command exist? In basic it is just a simple end but I have been unable to find anything.
Tony Evans
Australia
Printable View
Hi, I am a newbie who is trying to find a command/syntax to end a program from the menu of that program.
Does such a command exist? In basic it is just a simple end but I have been unable to find anything.
Tony Evans
Australia
exit(0), google search that, it might help.
"menu of that program"? Are you working with a GUI application? Then you may need to clean up othe resources than just calling exit().Quote:
Originally Posted by tonevans
Well if you're workign with the GUI... then you created a menu, you should know how to check if a menu item is cliked with WM_COMMAND then checking the low word of wParam to make sure it was the exit item of your menu.
Then do:
With the proper handle of course. THen in WM_CLOSE, EndDialog or DestroyWindow or whatever you have to do to end it. Then make sure you call PostQuitMessage also... to get out of the message loop.Code:PostMessage(hWnd, WM_CLOSE, 0, 0);
:)