DonationCoder.com Forum

DonationCoder.com Software => Mouser's Zone => Screenshot Captor => Topic started by: lanux128 on April 14, 2014, 07:23 AM

Title: Command-line option starts a new instance of SC
Post by: lanux128 on April 14, 2014, 07:23 AM
i have a shortcut on my desktop with the following command, "<path>\ScreenshotCaptor.exe -scan". whenever i click this shortcut to initiate a scan, SC gets launched in a new instance and only then the scan command is carried out. in the end, i end up with two SC icons in the system tray. is there a setting to avoid this? thanks!
Title: Re: Command-line option starts a new instance of SC
Post by: mouser on April 14, 2014, 07:28 AM
does that still happen even with the new beta?
Title: Re: Command-line option starts a new instance of SC
Post by: lanux128 on April 14, 2014, 07:40 AM
yes, it still happens with the new beta. sorry, forgot to mention that in the first post.

btw, i am using win7 pro 32-bit.
Title: Re: Command-line option starts a new instance of SC
Post by: mouser on April 14, 2014, 07:44 AM
Assuming you are sure its launching the same ScreenshotCaptor.exe location as is already running (i.e. not two different versions of SC installed in different locations), then this is a bug, and I will look into it today and try to fix right away.
It shouldn't be launching a second instance.
Title: Re: Command-line option starts a new instance of SC
Post by: lanux128 on April 14, 2014, 07:52 AM
i have only 1 ScreenshotCaptor.exe in the whole of the drive C:\ or "Everything" is lying.. :)

Spoiler
(http://i.imgur.com/nUGA9eK.png)

Title: Re: Command-line option starts a new instance of SC
Post by: mouser on April 14, 2014, 08:00 AM
Ok, I'm on it.

Oh, you could do a test for me -- can you make another shortcut to a second instance with NO commandline parameters -- and tell me if it launches a second instance in that case?
Title: Re: Command-line option starts a new instance of SC
Post by: lanux128 on April 14, 2014, 08:27 AM
ah, yes.. even without a command-line option, a new instance is launched..
Title: Re: Command-line option starts a new instance of SC
Post by: mouser on April 14, 2014, 08:34 AM
Ok that's a big clue.  That does *not* happen here (Win 7).
So it seems to me you are experiencing a generic non-specific failure of the single-instance behavior of SC.

Now the question is why.

1. Can anyone else test and see what behavior they see?
2. Lanux -- in your original post you say you end up with 2 instances in tray.  Can I ask you to elaborate? Do you end up with 2 separate copies of the program running? Or just 2 system tray icons?
3. Lanux, can you see if the same behavior happens if you EXIT all running instances, and then start them both up (let the first fully start before launching second) with your new shortcut?
Title: Re: Command-line option starts a new instance of SC
Post by: lanux128 on April 14, 2014, 09:03 AM
2. Lanux -- in your original post you say you end up with 2 instances in tray.  Can I ask you to elaborate? Do you end up with 2 separate copies of the program running? Or just 2 system tray icons?

i get two separate copies as can be seen in this screenshot below.
Spoiler
(http://i.imgur.com/MkTy00x.png)



3. Lanux, can you see if the same behavior happens if you EXIT all running instances, and then start them both up (let the first fully start before launching second) with your new shortcut?

the behaviour persists even after exiting both instances and re-starting again.
Title: Re: Command-line option starts a new instance of SC
Post by: mouser on April 14, 2014, 09:09 AM
How strange. Ok i'm looking into it now.

Can anyone else confirm that they get 2 instances or whether their installation properly limits it to a single instance?
My XP and Win7 installs both behave properly.
Title: Re: Command-line option starts a new instance of SC
Post by: lanux128 on April 14, 2014, 09:18 AM
by any chance, does SC have any option like the one in the image below, which i may have inadvertently turned it off/on?

Spoiler
(http://i.imgur.com/QMmDhON.png)


Title: Re: Command-line option starts a new instance of SC
Post by: bob99 on April 14, 2014, 09:30 AM
With SC already running and using the run command I get the "Hello there! You've tried to launch a new copy..." popup. I got a UAC popup 1st asking if I wanted it to run.

I'm on Win 7 Pro, x64 machine. SC is installed in the x86 program files folder.

Edit
Should have told you I'm still running V4.8. Haven't installed the beta yet.
Title: Re: Command-line option starts a new instance of SC
Post by: mouser on April 14, 2014, 09:33 AM
With SC already running and using the run command I get the "Hello there! You've tried to launch a new copy..." popup. I got a UAC popup 1st asking if I wanted it to run.

thanks bob -- so your single-instance detection is working correctly.
ps. the new beta (https://www.donationcoder.com/forum/index.php?topic=3474.0) does away with that "hello there" message.
Title: Re: Command-line option starts a new instance of SC
Post by: bob99 on April 14, 2014, 09:35 AM
With SC already running and using the run command I get the "Hello there! You've tried to launch a new copy..." popup. I got a UAC popup 1st asking if I wanted it to run.

thanks bob -- so your single-instance detection is working correctly.
ps. the new beta (https://www.donationcoder.com/forum/index.php?topic=3474.0) does away with that "hello there" message.

Just tried it again. Same result. Single instance popup.
Title: Re: Command-line option starts a new instance of SC
Post by: bob99 on April 14, 2014, 09:47 AM
thanks bob -- so your single-instance detection is working correctly.
ps. the new beta (https://www.donationcoder.com/forum/index.php?topic=3474.0) does away with that "hello there" message.

There's probably some other reason you are taking out the "Hello there" message. But it never bothered me. Actually I kind of liked the reminder I had it already running. Sometimes some of my tray icons disappear for seemingly no reason. In my case it kept me from having two instances running.