Pegasus Mail & Mercury

Welcome to the Community for Pegasus Mail and
The Mercury Mail Transport System, the Internet's longest-serving PC e-mail system!
Welcome to Pegasus Mail & Mercury Sign in | Join | Help
in
Home Blogs Forums Downloads Pegasus Mail Overview Mercury Overview Wiki

Persistant registry entry help needed

Last post 04-21-2017, 21:50 by Brian Fluet. 12 replies.
Sort Posts: Previous Next
  •  04-20-2017, 16:35

    • Brian Fluet is not online. Last active: 04-24-2017, 16:36 Brian Fluet
    • Top 10 Contributor
    • Joined on 12-24-2014
    • North Carolina, USA
    • SuperStar
    • Points 14,445

    Persistant registry entry help needed

    I run three instance of Pegasus Mail on my office PC.  One is run from a flash drive which I start manually.  The other two are started from a batch file, LAN install of Pegasus Mail, two different users.

    Until Win10, the last instance started  was the instance recorded in the registry key HKEY_CURRENT_USER\Software\Pegasus Mail.  Under Win10 this no longer happens reliably.  I need control of this so that mailto links invoke the preferred instance.  I have added a delay to the batch file that provides plenty of time for the first instance to be fully started before the second one starts but this hasn't helped.  As a solution I'm wondering about executing a .reg file as the final step in the batch file.  I've never created a .reg file nor executed one from a batch file so am looking for advice on what the .reg file would need to look like and thoughts on whether this is a good idea or not.

    Edit:  I'm embarrassed about ass_uming that the HKEY_CURRENT_USER\Software\Pegasus Mail registry key was incorrect.  It's not.  It reflects the last instance started yet mailto links invoke a different instance.  Perhaps I'm wrong about the reg key being the point of reference for mailto links.  Could be that it's only the point of reference for the installer.  I check the reg entries associated with WSENDTO but they all contain the path to WSENDTO.EXE of the LAN install, as expected.  Any thoughts on how to control which instance gets invoked by a mailto link would be greatly appreciated.

     


    Brian Fluet
  •  04-20-2017, 18:09

    • irelam is not online. Last active: 04-24-2017, 16:51 irelam
    • Top 10 Contributor
    • Joined on 03-23-2007
    • Edmonton, Alberta, Canada
    • SuperStar
    • Points 18,270
    • BetaTeam Moderator

    Re: Persistant registry entry help needed

    Could you possibly have three versions of WSendto.exe, ie Wsendto1.exe, WSendto2.,exe, and WSendto3.exe. Then you would need to detect the environment you need. It would seem that you have the drive letter such as F;, L:  (ie Flash and LAN).  You don't mention how you would determine which instance to use. But it might be selected by selecting L:\pathto\sendto2.exe and L:\pathto\wsendto3.exe 

    or F:\pathto\wsendto1.exe

    Martin

     

  •  04-20-2017, 18:23

    • idw is online. Last active: Mon, Apr 24 2017, 17:13 idw
    • Top 10 Contributor
    • Joined on 03-25-2007
    • Germany
    • SuperStar
    • Points 43,500
    • BetaTeam

    Re: Persistant registry entry help needed

    Brian Fluet:
    Any thoughts on how to control which instance gets invoked by a mailto link would be greatly appreciated.

    Are you talking about mailto links in your browser or in a HTML message displayed by Pegasus Mail's respective HTML renderer? IERenderer should directly invoke its parent instance and does so without looking for any instance of WSendTo, but browsers should rather do the latter.


    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
  •  04-20-2017, 18:27

    • Brian Fluet is not online. Last active: 04-24-2017, 16:36 Brian Fluet
    • Top 10 Contributor
    • Joined on 12-24-2014
    • North Carolina, USA
    • SuperStar
    • Points 14,445

    Re: Persistant registry entry help needed

    The flash drive instance of pmail is never invoked by a mailto link.  The need is to get control of which LAN instance is invoked by a mailto.  The path to wsendto is H:\PMAIL\WSENDTO.EXE.   I don't know how having multiple wsendto files would control which running instance gets invoked.  How does wsendto determine which instance to invoke?

     


    Brian Fluet
  •  04-20-2017, 18:36

    • idw is online. Last active: Mon, Apr 24 2017, 17:13 idw
    • Top 10 Contributor
    • Joined on 03-25-2007
    • Germany
    • SuperStar
    • Points 43,500
    • BetaTeam

    Re: Persistant registry entry help needed

    Brian Fluet:
    How does wsendto determine which instance to invoke?

    Examining its executable with a hex viewer reveals that it's looking for Pegasus Mail's Registry entries like assumed by you, but only David Harris can tell for sure.


    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
  •  04-20-2017, 19:14

    • Brian Fluet is not online. Last active: 04-24-2017, 16:36 Brian Fluet
    • Top 10 Contributor
    • Joined on 12-24-2014
    • North Carolina, USA
    • SuperStar
    • Points 14,445

    Re: Persistant registry entry help needed

    Michael,

    FWIW, mailto links executed from within Pegasus Mail create a new message window within the same instance.  Clicking a mailto link while viewing the same html message in Firefox or IE invokes the other ("wrong") instance of Pmail.  Mailto links in apps outside of Pegasus Mail also invoke the wrong instance. 

    I just tested a mailto link from both FF and IE after shutting down the "wrong" instance and was very surprised to see the flash drive instance get invoked by both.  The "by both" part isn't surprising but the flash drive instance certainly is.  Shutting down the flash drive instance results in the remaining running instance being invoked. 

    With all instances shutdown, the mailto links invoke the instance referenced by the registry key so this part works as expected.  Control of which running instance is invoked remains the issue.



    Brian Fluet
  •  04-20-2017, 23:54

    • idw is online. Last active: Mon, Apr 24 2017, 17:13 idw
    • Top 10 Contributor
    • Joined on 03-25-2007
    • Germany
    • SuperStar
    • Points 43,500
    • BetaTeam

    Re: Persistant registry entry help needed

    Brian Fluet:
    Control of which running instance is invoked remains the issue.

    Guess you need to ask David Harris, nobody else can tell ...


    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
  •  04-21-2017, 2:26

    • irelam is not online. Last active: 04-24-2017, 16:51 irelam
    • Top 10 Contributor
    • Joined on 03-23-2007
    • Edmonton, Alberta, Canada
    • SuperStar
    • Points 18,270
    • BetaTeam Moderator

    Re: Persistant registry entry help needed

    I believe that the solution includes the use of the HINSTANCE handle which is a value stored in the HWINDOW structure. See MSDN entries describing how to create Windows with the same classname. This allows Windows with same class name to exist together.  This is also the original way to prevent the starting of multiple Windows with the same name. This goes beyond the simple Lock mechanism which is used to prevent the starting of multiple instances of a Windows class name.

    I don't know how you can use this controlling method outside of Windows programming though. :-(

     Martin

  •  04-21-2017, 13:49

    • Brian Fluet is not online. Last active: 04-24-2017, 16:36 Brian Fluet
    • Top 10 Contributor
    • Joined on 12-24-2014
    • North Carolina, USA
    • SuperStar
    • Points 14,445

    Re: Persistant registry entry help needed

    My sense is that something controls the instance that gets invoked because it will be the same instance throughout the day.  The instance does not appear to be chosen at random.  The odd part is that there is no way to know which instance will be the chosen instance for that day. 

    This happened occasionally on my Win7 machine and when previously discussed I came to the conclusion that the last instance started was the instance used.  On the rare occasions when this wasn't the case we chalked it up to a timing issue.  It's much more unpredictable on my Win10 machine, even with startups more spread out so I'm going to create a larger spread just to see if it makes a difference.

     


    Brian Fluet
  •  04-21-2017, 16:33

    • idw is online. Last active: Mon, Apr 24 2017, 17:13 idw
    • Top 10 Contributor
    • Joined on 03-25-2007
    • Germany
    • SuperStar
    • Points 43,500
    • BetaTeam

    Re: Persistant registry entry help needed

    Brian Fluet:
    This happened occasionally on my Win7 machine and when previously discussed I came to the conclusion that the last instance started was the instance used.

    This is how it's supposed to be, I guess, but I don't know for sure. Would selecting a default mailto handler in the Firefox options solve your issue?


    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
  •  04-21-2017, 17:00

    • Brian Fluet is not online. Last active: 04-24-2017, 16:36 Brian Fluet
    • Top 10 Contributor
    • Joined on 12-24-2014
    • North Carolina, USA
    • SuperStar
    • Points 14,445

    Re: Persistant registry entry help needed

    idw:
    This is how it's supposed to be, I guess, but I don't know for sure. Would selecting a default mailto handler in the Firefox options solve your issue?

    I don't think so.  I assume the option to "Use Pegasus Mail WSENDTO Utility" invokes the one recorded in the registry.  That's the LAN install from which I'm running two instances.  I don't think a manual configuration that points to the same WSENDTO will be of benefit.  Besides, most of the mailto links I invoke during the day are in a cardfile/contact list app which uses the system mailer.

    Today is a good day though; the "right" instance is being invoked. Party!!!

     


    Brian Fluet
  •  04-21-2017, 21:29

    • irelam is not online. Last active: 04-24-2017, 16:51 irelam
    • Top 10 Contributor
    • Joined on 03-23-2007
    • Edmonton, Alberta, Canada
    • SuperStar
    • Points 18,270
    • BetaTeam Moderator

    Re: Persistant registry entry help needed

    Just briefly back to instances. Windows keeps a list of active window apps, and this is in startup order. So if you can control the startup of instances, it is likely that Windows will use the first occurence of your app or Wsendto.exe if there is no direct pointer to the locations in your app.

    Martin

  •  04-21-2017, 21:50

    • Brian Fluet is not online. Last active: 04-24-2017, 16:36 Brian Fluet
    • Top 10 Contributor
    • Joined on 12-24-2014
    • North Carolina, USA
    • SuperStar
    • Points 14,445

    Re: Persistant registry entry help needed

    irelam:
    Just briefly back to instances. Windows keeps a list of active window apps, and this is in startup order. So if you can control the startup of instances, it is likely that Windows will use the first occurence of your app or Wsendto.exe if there is no direct pointer to the locations in your app.

    This behavior is the expectation so I have been controlling startups accordingly.  Unfortunately, the behavior doesn't always follow the expectation.  This was occasional on my Win7 machine but is more frequent on my Win10 box.


    Brian Fluet
View as RSS news feed in XML

Contact | Advertise | Host provider: PraktIT | Terms of Use | Privacy Statement
Copyright © 2007-2011 David Harris / Peter Strömblad. | Pegasus Mail Home Page