If I open up a Window console is there a way to check to see if the user pressed the "x" button in the top right corner. I have some routines I need to run before the program exits to free up some memory.
- Sean
Printable View
If I open up a Window console is there a way to check to see if the user pressed the "x" button in the top right corner. I have some routines I need to run before the program exits to free up some memory.
- Sean
Check the WM_CLOSE or WM_DESTROY messages.
didn't he say "console"??
there aren't any windows messages sent to the program if you dont have a message handler, and you dont have one in console mode!
If you open up a console window in a Win32 App, there are no messages sent? I always assumed there was. Never found the need to try it. Guess I shouldn't assume (you all know how the saying goes).
Your right GG
The console is a window like any other....it has messages and the like, but if at any point I wondered about the messages my console was processing, its a good indication that I shouldnt be in console mode ;)
Time to build a proper Win32 App :)
The console is a window like any other....it has messages and the like
yes it is, but when you have a standard console application, the console 'window' looks after it's own messages, they aren't passed to your console application's code.
If that's precisely what you said, then ignore this post :D
U.
Yeah that's what I meant :).....you can try to manipulate the console window yourself with subclassing or SendMessage(), but if it ever crosses you mind, you would be better off with a proper window.Quote:
Originally posted by Uraldor
The console is a window like any other....it has messages and the like
yes it is, but when you have a standard console application, the console 'window' looks after it's own messages, they aren't passed to your console application's code.
If that's precisely what you said, then ignore this post :D
U.
It still amazes me though how many people want to build functionality into their consoles instead of biting the bullet and learning how to create proper Win32 Apps.......ah well!!......you cant convince them all :)
yeah.. aint that the truth :D i have the same problem with a few people that i'm teaching :D
ah well, i'll let them sell themselves short
cheers
U.
Actually I did not avoid making a proper win32 App I can already make one. I am making an interpreter and the program is executed in console mode.
Thanks for your help.
- Sean