Hi Jean-Marc,
What is a quit menu? Do you mean the Quit menu item in the File menu under Windows and in the application menu under Mac OS X? Or do you mean the menu in the top-left corner of Windows menus?
If you mean the Quit menu item in the File menu, you can simply handle the menuPick message in the File menu button. Just make this button quit your application.
If you mean the menu in the top-left of the window, you might try catching the shutdownRequest message. This should actually also work on Mac OS X instead of the appleEvent message.
Here's a good example of how to quit your standalone properly. You may need to make slight adjustments to the handler, because it assume you're using MySQL for instance. Just comment out what you don't need.
Best,
Mark