confirmation on exit

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
alguem
Posts: 14
Joined: Fri Jun 09, 2006 10:43 pm

confirmation on exit

Post by alguem »

i want to put a confirmation window when the player click on the "close button" at the main window of the game. is it possible? thanks
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

Yes, this is possible...
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
alguem
Posts: 14
Joined: Fri Jun 09, 2006 10:43 pm

Post by alguem »

how can i do it?
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

Have a look at tutorial #5 (UserInterface)...
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
alguem
Posts: 14
Joined: Fri Jun 09, 2006 10:43 pm

Post by alguem »

i did not find anything useful at the tutorial :(
(the "close button" is the "X" of the title bar)
TheC
Posts: 93
Joined: Fri May 05, 2006 7:50 am

Post by TheC »

If you are using the WinMain call (making irrlicht work in a win32 window), you can do an event check for event 0x803 (iirc), which is program exit.
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

Ohhh, you mean how to detect if the program was closed by clicking the close button from the Windows window !!!
Sorry, you asked about confirming on exit, not how to detect something...
The confirmation should be covered by tut5...
Your actual question: I don't know...
It was asked sometimes in the forum, I think, but I don't know if it was solved...
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
drac_gd
Posts: 132
Joined: Sun Apr 09, 2006 8:43 pm

Post by drac_gd »

assuming u r using windows this might work. ( didnt try it )

in CIrrDeviceWin32.cpp function WinProc add case WM_CLOSE:

set a flag or something
return 1 so windows doesnt process the close event.

after conformation call PostQuitMessage
alguem
Posts: 14
Joined: Fri Jun 09, 2006 10:43 pm

Post by alguem »

drac_gd wrote:assuming u r using windows this might work. ( didnt try it )

in CIrrDeviceWin32.cpp function WinProc add case WM_CLOSE:

set a flag or something
return 1 so windows doesnt process the close event.

after conformation call PostQuitMessage
thank you man, it really worked.

*i dont think that it is a newbie question :| *
Post Reply