I've struggled with this issue before, and have come up with mildly satisfactory solution, but for a current project, it's not really satisfying.
I need to run my own "Quit" process in a standalone, which is sort of possible using menubar, but on OSX, there's the "Quit" in the ApplicationName menu (e.g. Max/MSP menu) which will bypass any "Quit" that I put in the File menu with menubar.
On windows, I can "disable" the default Quit in File with a message to menubar, which results in an unsightly dual "Quit" (the disabled default + the Quit I create in menubar), but at least it functions. However, if the user clicks the "contatining" window's "X" to close the app, then my all-important "Quit" routine is bypassed. (I guess that is a separate question - can I disable the application window?).
SO those are my issues that I'd LOVE to be able to workaround...is possible?