Re: Let me elaborate (Re: [AD] Problem with Windows XP + MinGW + alegro (windowed))

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


> Well, the generated WinMain() function is not part of the DLL, is it?

No it isn't, of course.

> It's actually the main thread, right? If so, can we not send it a
> message, or get it to poll a flag, and call ExitProcess() if the user
> has closed the program?

The primary thread hasn't got a message loop (handling the messages is the
purpose of the window thread), so it couldn't process a 'terminate' message.

Maybe can we send it sort of a 'terminate' signal, by using the very limited
signal API of ANSI C and registering the signal handler in the END_OF_MAIN()
macro ? (Does anyone know another way of using signals under Windows ?) Or
create a blocking thread in END_OF_MAIN() whose only task would be to call
ExitProcess() as soon as a 'terminate' event is triggered ?

Much ado about a so little thing...

---
Eric Botcazou
ebotcazou@xxxxxxxxxx



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/