Community Discussions and Support
Persistant registry entry help needed

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

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.

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

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.

 

<p>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.</p><p>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.</p><p>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.</p><p> </p>

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

 

<p>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 </p><p> or F:\pathto\wsendto1.exe</p><p>Martin </p><p> </p>

[quote user="Brian Fluet"]Any thoughts on how to control which instance gets invoked by a mailto link would be greatly appreciated. [/quote]

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.

<p>[quote user="Brian Fluet"]Any thoughts on how to control which instance gets invoked by a mailto link would be greatly appreciated. [/quote]</p><p>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. </p>
			Michael
--
IERenderer's Homepage
PGP Key ID (RSA 2048): 0xC45D831B
S/MIME Fingerprint: 94C6B471 0C623088 A5B27701 742B8666 3B7E657C

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?

 

<p>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?</p><p> </p>

[quote user="Brian Fluet"]How does wsendto determine which instance to invoke?[/quote]

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.

<p>[quote user="Brian Fluet"]How does wsendto determine which instance to invoke?[/quote]</p><p>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. </p>
			Michael
--
IERenderer's Homepage
PGP Key ID (RSA 2048): 0xC45D831B
S/MIME Fingerprint: 94C6B471 0C623088 A5B27701 742B8666 3B7E657C

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.


<p>Michael,</p><p>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.  </p><p>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.  </p><p>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. </p><p> </p>

[quote user="Brian Fluet"]Control of which running instance is invoked remains the issue.[/quote]

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

<p>[quote user="Brian Fluet"]Control of which running instance is invoked remains the issue.[/quote]</p><p>Guess you need to ask David Harris, nobody else can tell ... </p>
			Michael
--
IERenderer's Homepage
PGP Key ID (RSA 2048): 0xC45D831B
S/MIME Fingerprint: 94C6B471 0C623088 A5B27701 742B8666 3B7E657C

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

<p>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.</p><p>I don't know how you can use this controlling method outside of Windows programming though. :-( </p><p> Martin</p>

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.

 

<p>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.  </p><p>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.</p><p>  </p>

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

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?

<p>[quote user="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.[/quote]</p><p>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? </p>
			Michael
--
IERenderer's Homepage
PGP Key ID (RSA 2048): 0xC45D831B
S/MIME Fingerprint: 94C6B471 0C623088 A5B27701 742B8666 3B7E657C

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

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. [<:o)]

 

&lt;p&gt;[quote user=&quot;idw&quot;]This is how it&#039;s supposed to be, I guess, but I don&#039;t know for sure. Would selecting a default mailto handler in the Firefox options solve your issue? [/quote]&lt;/p&gt;&lt;p&gt;I don&#039;t think so.&amp;nbsp; I assume the option to &quot;Use Pegasus Mail WSENDTO Utility&quot; invokes the one recorded in the registry.&amp;nbsp; That&#039;s the LAN install from which I&#039;m running two instances.&amp;nbsp; I don&#039;t think a manual configuration that points to the same WSENDTO will be of benefit.&amp;nbsp; Besides, most of the mailto links I invoke during the day are in a cardfile/contact list app which uses the system mailer. &lt;/p&gt;&lt;p&gt;Today is a good day though; the &quot;right&quot; instance is being invoked. [&amp;lt;:o)]&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;

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

&lt;p&gt;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.&lt;/p&gt;&lt;p&gt;Martin &lt;/p&gt;
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