Community Discussions and Support
HTML makes Pegasus 4.61 crash ...

"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."

That was very nearly my workaround.  After restoring the original window process (and before returning 1 from WM_FM_CLOSE) I PostMessage(hWndPmail, WM_SYSCOMMAND, SC_CLOSE, 0) .

Thanks.

 - Vince

<p>"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."</p><p>That was very nearly my workaround.  After restoring the original window process (and before returning 1 from WM_FM_CLOSE) I PostMessage(hWndPmail, WM_SYSCOMMAND, SC_CLOSE, 0) .</p><p>Thanks.</p><p> - Vince </p>

... more often than the previous version did.  After restarting, the same email always opens OK.

 

<p>... more often than the previous version did.  After restarting, the same email always opens OK.</p><p> </p>

[quote user="Vincent Fatica"]... more often than the previous version did.  After restarting, the same email always opens OK. [/quote]

Please get version 4.62.

<p>[quote user="Vincent Fatica"]... more often than the previous version did.  After restarting, the same email always opens OK. [/quote]</p><p>Please get <a href="http://pmail.com/v46x.htm" mce_href="http://pmail.com/v46x.htm" target="_blank">version 4.62</a>.</p>
			Michael
--
IERenderer's Homepage
PGP Key ID (RSA 2048): 0xC45D831B
S/MIME Fingerprint: 94C6B471 0C623088 A5B27701 742B8666 3B7E657C

[quote user="idw"]

[quote user="Vincent Fatica"]... more often than the previous version did.  After restarting, the same email always opens OK. [/quote]

Please get version 4.62.

[/quote]

Thanks.  The first thing I noticed was that my "xclose32.dll" (hard to close) plugin causes it to crash upon startup, although xclose32.dll is not the faulting module.  My plugin was agreeable to v4.61.  Any ideas?

 - Vince

[quote user="idw"]<p>[quote user="Vincent Fatica"]... more often than the previous version did.  After restarting, the same email always opens OK. [/quote]</p><p>Please get <a href="http://pmail.com/v46x.htm" mce_href="http://pmail.com/v46x.htm" target="_blank">version 4.62</a>.</p><p>[/quote]</p><p>Thanks.  The first thing I noticed was that my "xclose32.dll" (hard to close) plugin causes it to crash upon startup, although xclose32.dll is not the faulting module.  My plugin was agreeable to v4.61.  Any ideas?</p><p> - Vince </p>

[quote user="Vincent Fatica"]Thanks.  The first thing I noticed was that my "xclose32.dll" (hard to close) plugin causes it to crash upon startup, although xclose32.dll is not the faulting module.  My plugin was agreeable to v4.61.  Any ideas?[/quote]

No, please install the MiniDump extension and send a crash report (its ReadMe file provides more details).

<p>[quote user="Vincent Fatica"]Thanks.  The first thing I noticed was that my "xclose32.dll" (hard to close) plugin causes it to crash upon startup, although xclose32.dll is not the faulting module.  My plugin was agreeable to v4.61.  Any ideas?[/quote]</p><p>No, please install the <a href="/files/folders/community_add-ons_for_pegasus_mail/entry12763.aspx" mce_href="/files/folders/community_add-ons_for_pegasus_mail/entry12763.aspx" target="_blank">MiniDump extension</a> and send a crash report (its <em>ReadMe</em> file provides more details).</p>
			Michael
--
IERenderer's Homepage
PGP Key ID (RSA 2048): 0xC45D831B
S/MIME Fingerprint: 94C6B471 0C623088 A5B27701 742B8666 3B7E657C

[quote user="idw"]

[quote user="Vincent Fatica"]Thanks.  The first thing I noticed was that my "xclose32.dll" (hard to close) plugin causes it to crash upon startup, although xclose32.dll is not the faulting module.  My plugin was agreeable to v4.61.  Any ideas?[/quote]

No, please install the MiniDump extension and send a crash report (its ReadMe file provides more details).

[/quote]

 

I installed MiniDump.   The DLL is loaded by Pegasus.  When Pmail crashes, I see nothing from MiniDump (should I see something?).  I am getting files in %TEMP% with names like ~df959fc92bb881b620.tmp.  They are not human-readable.  Are they the dumps?

If so, I'll send two ... one from the xclose32.dll I've used for years, the one which crashes at startup, and another from a hastily cooked-up xclose32.dll that works but crashes at shutdown.

P.S.  What's (WM_FM_FORMBASE + 12)?  My DLL gets it twice during PM's shutdown.  My WPMFORMS.H is from 7/2007.  Is there a newer one?

[quote user="idw"]<p>[quote user="Vincent Fatica"]Thanks.  The first thing I noticed was that my "xclose32.dll" (hard to close) plugin causes it to crash upon startup, although xclose32.dll is not the faulting module.  My plugin was agreeable to v4.61.  Any ideas?[/quote]</p><p>No, please install the <a href="/files/folders/community_add-ons_for_pegasus_mail/entry12763.aspx" mce_href="/files/folders/community_add-ons_for_pegasus_mail/entry12763.aspx" target="_blank">MiniDump extension</a> and send a crash report (its <i>ReadMe</i> file provides more details).</p><p>[/quote]</p><p> </p><p>I installed MiniDump.   The DLL is loaded by Pegasus.  When Pmail crashes, I see nothing from MiniDump (should I see something?).  I am getting files in %TEMP% with names like ~df959fc92bb881b620.tmp.  They are not human-readable.  Are they the dumps?</p><p>If so, I'll send two ... one from the xclose32.dll I've used for years, the one which crashes at startup, and another from a hastily cooked-up xclose32.dll that works but crashes at shutdown. </p><p>P.S.  What's (WM_FM_FORMBASE + 12)?  My DLL gets it twice during PM's shutdown.  My WPMFORMS.H is from 7/2007.  Is there a newer one? </p>

FWIW, in the recently cooked-up version of xclose32.dll, I can successfully install my WndProc with either of these:

        SetWindowSubclass(hWndPmail, MyWindowProc, 666, 0);
        SetWindowLong(hWndPmail, GWL_WNDPROC, (LONG) MyWindowProc);

The WndProc looks like this, (commented parts depending on how it's installed:

LRESULT CALLBACK MyWindowProc(HWND hWnd, UINT uMsg, WPARAM wParam,
                              LPARAM lParam)  //, UINT_PTR uIdSubclass, DWORD_PTR dwRefData)
{
    if ( uMsg == WM_SYSCOMMAND && wParam == SC_CLOSE )
    {
        wParam = SC_MINIMIZE;
    }
    //return DefSubclassProc(hWnd, uMsg, wParam, lParam);
    return CallWindowProc((WNDPROC) OldWndProc, hWnd, uMsg, wParam, lParam);
}

This works but I can't figure out when/how to either remove the subclass (RemoveWindowSubclass) or set the WndProc back to the original (SetWindowLong) when PM is closing.  I tried both methods in response to DLL_PROCESS_DETACH and in response to  (WM_FM_FORMBASE + 12) which I get at shutdown, but PM crashes.

 - Vince

<p>FWIW, in the recently cooked-up version of xclose32.dll, I can successfully install my WndProc with either of these:</p><p>        SetWindowSubclass(hWndPmail, MyWindowProc, 666, 0);         SetWindowLong(hWndPmail, GWL_WNDPROC, (LONG) MyWindowProc);</p><p>The WndProc looks like this, (commented parts depending on how it's installed:</p><p>LRESULT CALLBACK MyWindowProc(HWND hWnd, UINT uMsg, WPARAM wParam,                               LPARAM lParam)  //, UINT_PTR uIdSubclass, DWORD_PTR dwRefData) {     if ( uMsg == WM_SYSCOMMAND && wParam == SC_CLOSE )     {         wParam = SC_MINIMIZE;     }     //return DefSubclassProc(hWnd, uMsg, wParam, lParam);     return CallWindowProc((WNDPROC) OldWndProc, hWnd, uMsg, wParam, lParam); } </p><p>This works but I can't figure out when/how to either remove the subclass (RemoveWindowSubclass) or set the WndProc back to the original (SetWindowLong) when PM is closing.  I tried both methods in response to DLL_PROCESS_DETACH and in response to  (WM_FM_FORMBASE + 12) which I get at shutdown, but PM crashes.</p><p> - Vince </p>

*** betatech@pmail.gen.nz
550 Address '<betatech@pmail.gen.nz>' not known here.

*** betatech@pmail.gen.nz 550 Address &#039;&amp;lt;betatech@pmail.gen.nz&amp;gt;&#039; not known here.

[quote user="Vincent Fatica"]I installed MiniDump.   The DLL is loaded by Pegasus.  When Pmail crashes, I see nothing from MiniDump (should I see something?).[/quote]

All you need to know is contained in the ReadMe file - plus details about additional debugging options if the extension fails to capture your specific crash: In your latter case (on closing) MiniDump's extension module probably fails since it's already (being) unloaded when the crash occurs, in the other one it might crash along with Pegasus Mail, so you need to use MiniDump's Start menu group shortcut called Debug Pegasus Mail.

[quote user="Vincent Fatica"]I am getting files in %TEMP% with names like ~df959fc92bb881b620.tmp.  They are not human-readable.  Are they the dumps?[/quote]

No, they are always there when Pegasus Mail is running, created by Pegasus Mail itself.

[quote user="Vincent Fatica"]P.S.  What's (WM_FM_FORMBASE + 12)?  My DLL gets it twice during PM's shutdown.  My WPMFORMS.H is from 7/2007.  Is there a newer one?[/quote]

No, only additions to it (this is the Pascal version):

const
  WM_FM_CLOSE = (WM_FM_FORMBASE + 12);
  // This message is sent twice to extensions, once 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. If "wParam" is 0, then the window is being
  // closed, and the extension should take any steps necessary to tidy itself
  // up. The "wParam==0" case is sent during the WM_DESTROY processing for
  // the enclosing window, before any windows are destroyed, so the extension
  // can assume that any windows it has created are still valid.

&lt;p&gt;[quote user=&quot;Vincent Fatica&quot;]I installed MiniDump. &amp;nbsp; The DLL is loaded by Pegasus.&amp;nbsp; When Pmail crashes, I see nothing from MiniDump (should I see something?).[/quote]&lt;/p&gt;&lt;p&gt;All you need to know is contained in the &lt;em&gt;ReadMe&lt;/em&gt; file - plus details about additional debugging options if the extension fails to capture your specific crash: In your latter case (on closing) MiniDump&#039;s extension module probably fails since it&#039;s already (being) unloaded when the crash occurs, in the other one it might crash along with Pegasus Mail, so you need to use MiniDump&#039;s Start menu group shortcut called &lt;em&gt;Debug Pegasus Mail&lt;/em&gt;.&lt;/p&gt;&lt;p&gt;[quote user=&quot;Vincent Fatica&quot;]I am getting files in %TEMP% with names like ~df959fc92bb881b620.tmp.&amp;nbsp; They are not human-readable.&amp;nbsp; Are they the dumps?[/quote]&lt;/p&gt;&lt;p&gt;No, they are always there when Pegasus Mail is running, created by Pegasus Mail itself.&lt;/p&gt;&lt;p&gt;[quote user=&quot;Vincent Fatica&quot;]P.S.&amp;nbsp; What&#039;s (WM_FM_FORMBASE + 12)?&amp;nbsp; My DLL gets it twice during PM&#039;s shutdown.&amp;nbsp; My WPMFORMS.H is from 7/2007.&amp;nbsp; Is there a newer one?[/quote]&lt;/p&gt;&lt;p&gt;No, only additions to it (this is the Pascal version):&lt;/p&gt;&lt;p&gt;&lt;blockquote&gt;const &amp;nbsp; WM_FM_CLOSE = (WM_FM_FORMBASE + 12); &amp;nbsp; // This message is sent twice to extensions, once with &quot;wParam&quot; set to 1 &amp;nbsp; // to indicate that an attempt has been made to close the extension&#039;s &amp;nbsp; // Window. In this case, the extension can return a non-zero value to stop &amp;nbsp; // the window from being closed. If &quot;wParam&quot; is 0, then the window is being &amp;nbsp; // closed, and the extension should take any steps necessary to tidy itself &amp;nbsp; // up. The &quot;wParam==0&quot; case is sent during the WM_DESTROY processing for &amp;nbsp; // the enclosing window, before any windows are destroyed, so the extension &amp;nbsp; // can assume that any windows it has created are still valid. &lt;/blockquote&gt; &lt;p&gt;&lt;/p&gt;
			Michael
--
IERenderer's Homepage
PGP Key ID (RSA 2048): 0xC45D831B
S/MIME Fingerprint: 94C6B471 0C623088 A5B27701 742B8666 3B7E657C

[quote user="Vincent Fatica"]This works but I can't figure out when/how to either remove the subclass (RemoveWindowSubclass) or set the WndProc back to the original (SetWindowLong) when PM is closing.  I tried both methods in response to DLL_PROCESS_DETACH and in response to  (WM_FM_FORMBASE + 12) which I get at shutdown, but PM crashes.[/quote]

Subclassing windows in a "black box application" is always a delicate thing to do, you've got to figure this out by trial and error, I'm afraid.

&lt;p&gt;[quote user=&quot;Vincent Fatica&quot;]This works but I can&#039;t figure out when/how to either remove the subclass (RemoveWindowSubclass) or set the WndProc back to the original (SetWindowLong) when PM is closing.&amp;nbsp; I tried both methods in response to DLL_PROCESS_DETACH and in response to&amp;nbsp; (WM_FM_FORMBASE + 12) which I get at shutdown, but PM crashes.[/quote]&lt;/p&gt;&lt;p&gt;Subclassing windows in a &quot;black box application&quot; is always a delicate thing to do, you&#039;ve got to figure this out by trial and error, I&#039;m afraid.&lt;/p&gt;
			Michael
--
IERenderer's Homepage
PGP Key ID (RSA 2048): 0xC45D831B
S/MIME Fingerprint: 94C6B471 0C623088 A5B27701 742B8666 3B7E657C

[quote user="Vincent Fatica"]*** betatech@pmail.gen.nz

550 Address '<betatech@pmail.gen.nz>' not known here.[/quote]

Wrong address (where did you get it from?), it's beta-reports [at] pmail.gen.nz. But as I said, if MiniDump works correctly there's no need for you to enter this address manually, it'll all happen automatically as described in the ReadMe file - which also contains my personal address.

[quote user=&quot;Vincent Fatica&quot;]*** betatech@pmail.gen.nz &lt;p&gt;550 Address &#039;&amp;lt;betatech@pmail.gen.nz&amp;gt;&#039; not known here.[/quote]&lt;/p&gt;&lt;p&gt;Wrong address (where did you get it from?), it&#039;s &lt;em&gt;beta-reports [at] pmail.gen.nz&lt;/em&gt;. But as I said, if MiniDump works correctly there&#039;s no need for you to enter this address manually, it&#039;ll all happen automatically as described in the &lt;em&gt;ReadMe&lt;/em&gt; file - which also contains my personal address.&lt;/p&gt;
			Michael
--
IERenderer's Homepage
PGP Key ID (RSA 2048): 0xC45D831B
S/MIME Fingerprint: 94C6B471 0C623088 A5B27701 742B8666 3B7E657C

[quote user="idw"][quote user="Vincent Fatica"]*** betatech@pmail.gen.nz

550 Address '<betatech@pmail.gen.nz>' not known here.[/quote]

Wrong address (where did you get it from?), it's beta-reports [at] pmail.gen.nz. But as I said, if MiniDump works correctly there's no need for you to enter this address manually, it'll all happen automatically as described in the ReadMe file - which also contains my personal address.

[/quote]

I got it from  MDReadMe.txt.

[quote user=&quot;idw&quot;][quote user=&quot;Vincent Fatica&quot;]*** betatech@pmail.gen.nz &lt;p&gt;550 Address &#039;&amp;lt;betatech@pmail.gen.nz&amp;gt;&#039; not known here.[/quote]&lt;/p&gt;&lt;p&gt;Wrong address (where did you get it from?), it&#039;s &lt;i&gt;beta-reports [at] pmail.gen.nz&lt;/i&gt;. But as I said, if MiniDump works correctly there&#039;s no need for you to enter this address manually, it&#039;ll all happen automatically as described in the &lt;i&gt;ReadMe&lt;/i&gt; file - which also contains my personal address.&lt;/p&gt;&lt;p&gt;[/quote]&lt;/p&gt;&lt;p&gt;I got it from&amp;nbsp; MDReadMe.txt. &lt;/p&gt;

[quote user="Vincent Fatica"]I got it from  MDReadMe.txt.[/quote]

Ok, I'll correct it for future versions.

&lt;p&gt;[quote user=&quot;Vincent Fatica&quot;]I got it from&amp;nbsp; MDReadMe.txt.[/quote]&lt;/p&gt;&lt;p&gt;Ok, I&#039;ll correct it for future versions.&lt;/p&gt;
			Michael
--
IERenderer's Homepage
PGP Key ID (RSA 2048): 0xC45D831B
S/MIME Fingerprint: 94C6B471 0C623088 A5B27701 742B8666 3B7E657C

Hi, Michael.  You wrote:

WM_FM_CLOSE = (WM_FM_FORMBASE + 12);
  // This message is sent twice to extensions, once 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. If "wParam" is 0, then the window is being
  // closed, and the extension should take any steps necessary to tidy itself
  // up. The "wParam==0" case is sent during the WM_DESTROY processing for
  // the enclosing window, before any windows are destroyed, so the extension
  // can assume that any windows it has created are still valid.

Thanks for that.  But it doesn't appear to work exactly like that.  It seems wParam is always 1.  But that doesn't seem to matter and it's  not the point of my post.

I have a plugin that makes PM hard to close and doesn't crash, but I still have questions.  In fact, it makes PM too hard to close (explanation below).  Here's my plugin's message process:

LRESULT WINAPI MessageProc (HWND hWnd, WORD wMsg, WPARAM wParam, LPARAM lParam)
{
    if ( wMsg == WM_FM_INIT )
    {
        hWndPmail = (HWND) SendMessage(hWndParent, WM_F_GETWINDOW, 0, 0);
        OldWndProc = SetWindowLong(hWndPmail, GWL_WNDPROC, (LONG) MyWindowProc);
        if ( START_MINIMIZED )
            PostMessage(hWndPmail, WM_SYSCOMMAND, SC_MINIMIZE, 0);
    }
    else if ( wMsg == WM_FM_CLOSE && OldWndProc != NULL )
    {
        SetWindowLong(hWndPmail, GWL_WNDPROC, (LONG) OldWndProc);
        OldWndProc = NULL;
        return 1;  // returning 0 will cause a crash!
    }
    return 0;
}

What happens is this:  "X" and "Close" don't work; PM is minimized instead (that's the point of the plugin).  If I "File\Exit", I get WM_FM_CLOSE with wParam == 1.  The old window process is restored and because I return 1, PM makes no further efforts to close (really, it keeps running ... is that expected?).   Now, if I "X",  "Close", or "File\Exit" (old windpw process in place) I get  WM_FM_CLOSE with wParam == 1 again.  I return 0.  PM continues its shutdown processing and I finally get another WM_FM_CLOSE with wParam == 1 just before PM terminates.

The fact that I must try twice to terminate PM is OK with me personally but not exactly as desired.

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.

Thanks.

 - Vince

&lt;p&gt;Hi, Michael.&amp;nbsp; You wrote:&lt;/p&gt;&lt;p&gt;WM_FM_CLOSE = (WM_FM_FORMBASE + 12); &amp;nbsp; // This message is sent twice to extensions, once with &quot;wParam&quot; set to 1 &amp;nbsp; // to indicate that an attempt has been made to close the extension&#039;s &amp;nbsp; // Window. In this case, the extension can return a non-zero value to stop &amp;nbsp; // the window from being closed. If &quot;wParam&quot; is 0, then the window is being &amp;nbsp; // closed, and the extension should take any steps necessary to tidy itself &amp;nbsp; // up. The &quot;wParam==0&quot; case is sent during the WM_DESTROY processing for &amp;nbsp; // the enclosing window, before any windows are destroyed, so the extension &amp;nbsp; // can assume that any windows it has created are still valid. &lt;/p&gt;&lt;p&gt;Thanks for that.&amp;nbsp; But it doesn&#039;t appear to work exactly like that.&amp;nbsp; It seems wParam is always 1.&amp;nbsp; But that doesn&#039;t seem to matter and it&#039;s&amp;nbsp; not the point of my post. &lt;/p&gt;&lt;p&gt;I have a plugin that makes PM hard to close and doesn&#039;t crash, but I still have questions.&amp;nbsp; In fact, it makes PM too hard to close (explanation below).&amp;nbsp; Here&#039;s my plugin&#039;s message process:&lt;/p&gt;&lt;p&gt;LRESULT WINAPI MessageProc (HWND hWnd, WORD wMsg, WPARAM wParam, LPARAM lParam) { &amp;nbsp;&amp;nbsp;&amp;nbsp; if ( wMsg == WM_FM_INIT ) &amp;nbsp;&amp;nbsp;&amp;nbsp; { &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; hWndPmail = (HWND) SendMessage(hWndParent, WM_F_GETWINDOW, 0, 0); &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; OldWndProc = SetWindowLong(hWndPmail, GWL_WNDPROC, (LONG) MyWindowProc); &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; if ( START_MINIMIZED ) &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; PostMessage(hWndPmail, WM_SYSCOMMAND, SC_MINIMIZE, 0); &amp;nbsp;&amp;nbsp;&amp;nbsp; } &amp;nbsp;&amp;nbsp;&amp;nbsp; else if ( wMsg == WM_FM_CLOSE &amp;amp;&amp;amp; OldWndProc != NULL ) &amp;nbsp;&amp;nbsp;&amp;nbsp; { &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; SetWindowLong(hWndPmail, GWL_WNDPROC, (LONG) OldWndProc); &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; OldWndProc = NULL; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; return 1;&amp;nbsp; // returning 0 will cause a crash! &amp;nbsp;&amp;nbsp;&amp;nbsp; } &amp;nbsp;&amp;nbsp;&amp;nbsp; return 0; }&lt;/p&gt;&lt;p&gt;What happens is this:&amp;nbsp; &quot;X&quot; and &quot;Close&quot; don&#039;t work; PM is minimized instead (that&#039;s the point of the plugin).&amp;nbsp; If I &quot;File\Exit&quot;, I get WM_FM_CLOSE with wParam == 1.&amp;nbsp; The old window process is restored and because I return 1, PM makes no further efforts to close (really, it keeps running ... is that expected?). &amp;nbsp; Now, if I &quot;X&quot;,&amp;nbsp; &quot;Close&quot;, or &quot;File\Exit&quot; (old windpw process in place) I get&amp;nbsp; WM_FM_CLOSE with wParam == 1 again.&amp;nbsp; I return 0.&amp;nbsp; PM continues its shutdown processing and I finally get another WM_FM_CLOSE with wParam == 1 just before PM terminates.&lt;/p&gt;&lt;p&gt;The fact that I must try twice to terminate PM is OK with me personally but not exactly as desired.&lt;/p&gt;&lt;p&gt;A crash will occur if I return 0 immediately after restoring the old window process.&amp;nbsp; I&#039;d like to know why, and also if it&#039;s expected that PM give up trying to close when a plugin returns 1 in response to WM_FM_CLOSE.&lt;/p&gt;&lt;p&gt;Thanks.&lt;/p&gt;&lt;p&gt;&amp;nbsp;- Vince &lt;/p&gt;

[quote user="Vincent Fatica"]Thanks for that.  But it doesn't appear to work exactly like that.  It seems wParam is always 1.[/quote]

This is what David Harris made available to us, it's not my creation.

[quote user="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.[/quote]

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.

 

&lt;p&gt;[quote user=&quot;Vincent Fatica&quot;]Thanks for that.&amp;nbsp; But it doesn&#039;t appear to work exactly like that.&amp;nbsp; It seems wParam is always 1.[/quote]&lt;/p&gt;&lt;p&gt;This is what David Harris made available to us, it&#039;s not my creation.&lt;/p&gt;&lt;p&gt;[quote user=&quot;Vincent Fatica&quot;]A crash will occur if I return 0 immediately after restoring the old window process.&amp;nbsp; I&#039;d like to know why, and also if it&#039;s expected that PM give up trying to close when a plugin returns 1 in response to WM_FM_CLOSE.[/quote]&lt;/p&gt;&lt;p&gt;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&#039;s explanation:&lt;/p&gt;&lt;p&gt;&lt;blockquote&gt;... with &quot;wParam&quot; set to 1 to indicate that an attempt has been made to close the extension&#039;s Window. In this case, the extension can return a non-zero value to stop the window from being closed. ...&lt;/blockquote&gt;&lt;p&gt;IOW: Yes, it&#039;s expected to not close if you return 1 in response to&amp;nbsp;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.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;
			Michael
--
IERenderer's Homepage
PGP Key ID (RSA 2048): 0xC45D831B
S/MIME Fingerprint: 94C6B471 0C623088 A5B27701 742B8666 3B7E657C
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft