Quick question.
I have an app that use a native DLL through PInvoke, this DLL may call a PostQuitMessage().
How can I avoid it? (as my app should not close)
I tried AddMessageFilter, but it doesn’t trigger the WM_QUIT.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yup, IMessageFilter cannot work. WM_QUIT makes the GetMessage() function return FALSE. It never gets around to calling the message filter, the message loop immediately exits. Overriding WndProc() or canceling OnFormClosing() won’t work either. The only workaround I can think of is Detours to disable PostQuitMessage(). That requires some C/C++ skillz.