Welcome Guest.   Make a donation to an author on the site August 29, 2014, 03:20:16 PM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
The N.A.N.Y. Challenge 2013! Download dozens of custom programs!
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1]   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: DONE: Single Application Instance  (Read 17596 times)
richardsugg
Charter Member
***
Posts: 4


Reclaiming the Mind for Christ

View Profile WWW Give some DonationCredits to this forum member
« on: March 03, 2006, 11:32:17 AM »

I would love to see an application that would prevent more than one instance of an application from opening.  For instance, I use Bibleworks, but it allows multiple instances, which I don't like.  It also opens up other windows that are a part of an instance of the application.  In other words, The single instance application can't go by the window title, but would have to go by the process name.

Thanks!
Richard
« Last Edit: March 07, 2006, 01:35:52 AM by brotherS » Logged
mouser
First Author
Administrator
*****
Posts: 33,285



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #1 on: March 03, 2006, 11:55:40 AM »

richard, this is a nice idea that can be reasonably added to a program like our find+run robot and new launch bar program - i will be adding such features in the near future, so that you can tell it that it should bring any currently running instance to the foreground instead of launching a new process.
Logged
skrommel
Fastest code in the west
Developer
***
Posts: 882



View Profile WWW Give some DonationCredits to this forum member
« Reply #2 on: March 03, 2006, 02:03:48 PM »

 smiley I seem to remember that my SingleApp tool will do this if you specify the class.

You find the thread here: http://www.donationcoder.com/forum/index.php?topic=1826.0.


Sorry, months since I made that one... But maybe a v2.0 is needed?

Skrommel
« Last Edit: March 03, 2006, 02:06:09 PM by skrommel » Logged

Please stop by my site at  1 Hour Software by skrommel  for downloads and more info.
wr975
Charter Member
***
Posts: 369



View Profile Give some DonationCredits to this forum member
« Reply #3 on: March 03, 2006, 03:46:40 PM »

Until mouser or skrommel come up with some better solution, you could just use a custom Authotkey script to start your application. Just change PROCESSNAME and PATH/APP.EXE.

[copy or print]
process,exist,PROCESSNAME
if errorlevel = 0
    run,PATH/APP.EXE
else
    WinActivate, ahk_pid %errorlevel%
« Last Edit: March 03, 2006, 03:50:52 PM by wr975 » Logged
skrommel
Fastest code in the west
Developer
***
Posts: 882



View Profile WWW Give some DonationCredits to this forum member
« Reply #4 on: March 04, 2006, 02:45:45 PM »

 smiley Try this one!

SingleInstance - Only allow one instance of a program to run.

Features:
- User defined programs.
- Option to detect hidden programs.
- Won't close instances started before SingleInstance.

You'll find the downloads and more info at 1 Hour Software by Skrommel.

AutoHotkey doesn't support global messagehooks, so I couldn't catch the programs before they were created, but I hope you can live with the "flicker".

Skrommel
« Last Edit: March 04, 2006, 02:59:00 PM by skrommel » Logged

Please stop by my site at  1 Hour Software by skrommel  for downloads and more info.
Hirudin
Charter Member
***
Posts: 542


View Profile Give some DonationCredits to this forum member
« Reply #5 on: March 30, 2006, 01:38:06 AM »

Whoa, don't turn the response time down to "0"! I had it like that for a while, then noticed my CPU usage was at 50%! After turning off Single Instance it dropped down to ~0%, and after starting SI again it went to 50% again!
After starting Single Instance again, confirming the CPU usage was 50% I changed the response time back to "1" which brought the CPU usage back to ~0%.

Logged
saddler
Participant
*
Posts: 2

View Profile Give some DonationCredits to this forum member
« Reply #6 on: August 29, 2007, 08:36:31 AM »

hi!

can you make this application to find the duplicated application by performing a window title check instead of PID?
i've seen that you can put something like this:
WinGetTitle, title, ahk_id %wID%,,,$ 
to get the window title but i don't know this scripting language to modify your tool, so can you help?
i need a program to monitor the programs are running by the window_title because i need to block some users in the company i work to open more than one specific web-based application, but in the same time to still have access to other sites.
For eg. let's say we have Test1 web-based application and the IE window title will be Test1 - Microsoft Internet Explorer. They also use Test2 and Test3 from IE, but Test1 should be opened only once.

So... anyone with an idea? Can you give me the code, at least, and to compile it by myself?

Thanks in advance!
Cristian

I tryed google to find something like this and your application was the closest to what i want. There is also another one, PWone.exe, a command line tool but that one can't be found for download anymore.
Logged
mouser
First Author
Administrator
*****
Posts: 33,285



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #7 on: August 29, 2007, 06:09:22 PM »

Quote
So... anyone with an idea? Can you give me the code, at least, and to compile it by myself?

I think all of skrommel's downloads come with source code in ahk format.

ps. don't forget to consider sending skrommel a donation if you like his stuff  thumbs up
Logged
saddler
Participant
*
Posts: 2

View Profile Give some DonationCredits to this forum member
« Reply #8 on: August 29, 2007, 06:36:03 PM »

i know he has posted the source code but my programming skills aren't that good  Cool
that's why i'm asking help here smiley
Logged
mouser
First Author
Administrator
*****
Posts: 33,285



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #9 on: August 29, 2007, 07:01:46 PM »

Oh sorry i misunderstood your request for the source code, now i see you were asking for some help with the not yet written source code for the features you are asking for. sorry! hopefully one of the ahk coders here will help.
Logged
RobC
Supporting Member
**
Posts: 21


see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #10 on: December 03, 2009, 07:05:30 AM »

I am trying to prevent multiple instances of FireFox.
I tried with SingleInstance, but cannot get it to work (with FF).
Is there a trick as to what I should list in your Options Dialog ?
EG any of these ? 
firefox
firefox.exe
C:\Program Files\Mozilla Firefox\firefox.exe

Thanks,
Rob
Logged
skwire
Moderator
*****
Posts: 4,036



Another Coding Snack request? Om nom nom...

see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #11 on: December 03, 2009, 07:53:11 AM »

Please try this bit of AHK code.  I've written it as a shell hook that should only allow one instance of Firefox to exist.

Formatted for AutoIt with the GeSHI Syntax Highlighter [copy or print]
  1. Gui +LastFound
  2. hWnd := WinExist()
  3. DllCall( "RegisterShellHookWindow", UInt, hWnd )
  4. MsgNum := DllCall( "RegisterWindowMessage", Str, "SHELLHOOK" )
  5. OnMessage( MsgNum, "ShellMessage" )
  6. DetectHiddenWindows, On
  7. SetTitleMatchMode, 2
  8.  
  9. ShellMessage( wParam, lParam )
  10. {
  11.    WinGetClass, myClass, ahk_id %lParam%
  12.  
  13.    If ( wParam = 1 ) ; HSHELL_WINDOWCREATED
  14.    {
  15.        If ( InStr( myClass, "MozillaUIWindowClass" ) )
  16.        {
  17.            WinGet, myList, List, ahk_class MozillaUIWindowClass
  18.            If ( myList > 1 )
  19.            {
  20.                WinClose, % "ahk_id " . lParam
  21.            }
  22.        }
  23.    }
  24. }
Logged

RobC
Supporting Member
**
Posts: 21


see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #12 on: December 03, 2009, 11:02:08 AM »

Thanks for that.
Could you advise what program to use to 'compile' it, and how to do it ?
Or, attach a compiled version.

Rob
Logged
srhamy
Participant
*
Posts: 3

View Profile Give some DonationCredits to this forum member
« Reply #13 on: December 03, 2009, 02:03:05 PM »

http://www.autohotkey.com/
Logged
skwire
Moderator
*****
Posts: 4,036



Another Coding Snack request? Om nom nom...

see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #14 on: December 03, 2009, 02:52:56 PM »

Here you go.  Source/binary download
Logged

Pages: [1]   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.112s | Server load: 0.26 ]