Vincent Fatica:Thanks for that. But it doesn't appear to work exactly like that. It seems wParam is always 1.
This is what David Harris made available to us, it's not my creation.
Vincent Fatica:A crash will occur if I return 0 immediately after restoring the old window process. I'd like to know why, and also if it's expected that PM give up trying to close when a plugin returns 1 in response to WM_FM_CLOSE.
How am I supposed to know why Pegasus Mail crashes? It probably is in the process of calling the just invalidated WndProc while executing the WM_FM_CLOSE call. And as quoted in David's explanation:
... with "wParam" set to 1 to indicate that an attempt has been made to close the extension's
Window. In this case, the extension can return a non-zero value to stop the window from being closed. ...
IOW: Yes, it's expected to not close if you return 1 in response to WM_FM_CLOSE. My suggestion would be to post a WM_CLOSE message (or issue a PostQuitMessage() call?) to hWndPmail after resetting the WndProc which would allow Pegasus Mail to finish the WM_FM_CLOSE processing after resetting the WndProc and then start over with closing the main window.
Michael
--
PGP Key ID (RSA 2048): 0xC45D831B
PGP Plugin for Pegasus Mail: <http://www.pmpgp.de/pmpgp/>
S/MIME Certificate Fingerprint: 26 5c a3 60 02 c6 e3 8a 75 70 d5 6a 67 ff d3 8d b0 b5 5e 5b