Extension development
What is (WM_FM_FORMBASE + 12)?

[quote user="idw"]

There's an official shutdown message sent by Pegasus Mail:

WM_FM_LOGEVENT        =   (WM_FM_FORMBASE + 9);

using he following wParam value:

WLOG_SHUTDOWN = 32;[/quote]

Thanks, Michael.  That will be useful.  I already found a good place in which to RemoveWindowSubclass, namely, in the sub-wndproc, in response to WM_ENDSESSION (of which your explanation speaks).

 

[quote user="idw"] <p>There's an official shutdown message sent by Pegasus Mail: </p><p>WM_FM_LOGEVENT        =   (WM_FM_FORMBASE + 9);</p><p>using he following wParam value:</p><p>WLOG_SHUTDOWN = 32;[/quote]</p><p>Thanks, Michael.  That will be useful.  I already found a good place in which to RemoveWindowSubclass, namely, in the sub-wndproc, in response to WM_ENDSESSION (of which your explanation speaks).</p><p> </p>

What is (WM_FM_FORMBASE + 12)?  That's 2836.  My extension receives it during Pmail shutdown.

Thanks.

 

<p>What is (WM_FM_FORMBASE + 12)?  That's 2836.  My extension receives it during Pmail shutdown.</p><p>Thanks.</p><p> </p>

[quote user="irelam"]Undocumented.  how are you seeing this?
[/quote]

 I saw it while testing, using a MessageBox in my callback function that showed any messages other than WM_FM_INIT.  As I said it arrives when Pmail is shutting down.  It's the only safe place (i.e., no crash) I could find to RemoveWindowSubclass(hWndParent, ...) after I did SetWindowSubclass(hWndParent, ...) [so I could process WM_TIMER messages].  My plugin creates a "mailslot" and reads it periodically (hence WM_TIMER).  I use it to get notification (sound) of new mail arriving at a remote host.

Articles on SetWindowSubclass, RemoveWindowSubclass, DefSubclassProc, and SUBCLASSPROCs in general (COMCTL32.DLL) suggest that you can RemoveWindowSubclass *inside* the sub-wndproc but trying to do that in response to WM_NCDESTROY (as suggested) or WM_CLOSE result in a crash (probably because the extension DLL has already been unloaded, taking the sub-wndproc with it).

<p>[quote user="irelam"]Undocumented.  how are you seeing this? [/quote]</p><p> I saw it while testing, using a MessageBox in my callback function that showed any messages other than WM_FM_INIT.  As I said it arrives when Pmail is shutting down.  It's the only safe place (i.e., no crash) I could find to RemoveWindowSubclass(hWndParent, ...) after I did SetWindowSubclass(hWndParent, ...) [so I could process WM_TIMER messages].  My plugin creates a "mailslot" and reads it periodically (hence WM_TIMER).  I use it to get notification (sound) of new mail arriving at a remote host.</p><p>Articles on SetWindowSubclass, RemoveWindowSubclass, DefSubclassProc, and SUBCLASSPROCs in general (COMCTL32.DLL) suggest that you can RemoveWindowSubclass *inside* the sub-wndproc but trying to do that in response to WM_NCDESTROY (as suggested) or WM_CLOSE result in a crash (probably because the extension DLL has already been unloaded, taking the sub-wndproc with it). </p>

[quote user="Vincent Fatica"]

What is (WM_FM_FORMBASE + 12)?  That's 2836.  My extension receives it during Pmail shutdown.

Thanks.

[/quote]

There's an official shutdown message sent by Pegasus Mail:

WM_FM_LOGEVENT        =   (WM_FM_FORMBASE + 9);

using he following wParam value:

WLOG_SHUTDOWN = 32;       {  See below }

{  ** Note: requires extension manager v1.12 (WinPMail v4.1) or later }
{  This message is sent to extensions once or twice, depending on how }
{  the user exits from the program. If the user presses Alt+F4, chooses }
{  "Quit" from the "File" menu, or clicks the close button on the }
{  Pegasus Mail main window, then this message will be sent to the }
{  extension with "lParam" set to 1: in this case, the extension can }
{  return WPM_PROHIBIT to prevent Pegasus Mail from exiting. The second }
{  time the message is sent is during WM_ENDSESSION processing, in which }
{  case lParam will be set to 0, and program shutdown cannot be cancelled. }
{  If the user shuts Windows down without exiting from Pegasus Mail, only }
{  the second message will be received by the extension. An extension must }
{  not attempt to initiate any user-interface operations if "lParam" is }
{  set to 0 in this message. }

[quote user="Vincent Fatica"]<p>What is (WM_FM_FORMBASE + 12)?  That's 2836.  My extension receives it during Pmail shutdown.</p><p>Thanks.</p><p>[/quote]</p><p>There's an official shutdown message sent by Pegasus Mail: </p><p>WM_FM_LOGEVENT        =   (WM_FM_FORMBASE + 9);</p><p>using he following wParam value:</p><p>WLOG_SHUTDOWN = 32;       {  See below } </p><p>{  ** Note: requires extension manager v1.12 (WinPMail v4.1) or later } {  This message is sent to extensions once or twice, depending on how } {  the user exits from the program. If the user presses Alt+F4, chooses } {  "Quit" from the "File" menu, or clicks the close button on the } {  Pegasus Mail main window, then this message will be sent to the } {  extension with "lParam" set to 1: in this case, the extension can } {  return WPM_PROHIBIT to prevent Pegasus Mail from exiting. The second } {  time the message is sent is during WM_ENDSESSION processing, in which } {  case lParam will be set to 0, and program shutdown cannot be cancelled. } {  If the user shuts Windows down without exiting from Pegasus Mail, only } {  the second message will be received by the extension. An extension must } {  not attempt to initiate any user-interface operations if "lParam" is } {  set to 0 in this message. } </p>
			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