Source language: Translate to:

Trayapp should stay in tray when preventing second instance

Post your suggestions for future versions of NeoBook

Moderator: Neosoft Support

Trayapp should stay in tray when preventing second instance

Postby HPW » Wed Sep 15, 2010 1:10 am

I have a tray app which is also set to 'only run once'.
When I start it first the app minmize to the tray correctly.
When I start it a second time, the second instance is prevented,
but the first instance open its window and its button in taskbar.

Starting the second unwanted instance should not make the first instance appear.
Hans-Peter
User avatar
HPW
 
Posts: 2510
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Postby Neosoft Support » Wed Sep 15, 2010 10:11 am

Starting the second unwanted instance should not make the first instance appear.


I'm not sure. Wouldn't someone attempting to run a second copy indicate that they've forgotten that the app was already running or that they wanted to use it? To override this behavior you could try this:

You can detect when a user attempts to launch a second instance of your publication by creating a special subroutine called CommandLine_OnChange. NeoBook will automatically execute this subroutine whenever the user attempts to start more than one copy of your publication. For example:

:CommandLine_OnChange
SetVar "[WindowState]" "Minimize"
Return
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5593
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Postby HPW » Wed Sep 15, 2010 12:47 pm

After correcting the typo it works somehow.

Code: Select all
:CommandLine_OnChange
SetVar "[WindowState]" "Minimized"
Return


It still show up a short time and then disappear into tray.
Thanks for the tip.
Hans-Peter
User avatar
HPW
 
Posts: 2510
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany


Return to NeoBook Suggestions

Who is online

Users browsing this forum: No registered users and 1 guest