Results 1 to 3 of 3

Thread: only one instance of an application in windows

  1. #1
    Join Date
    Oct 2008
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default only one instance of an application in windows

    como controlar que solo se pueda abrir una vez una aplicacion en windows.
    la aplicacion .exe utiliza Qt4

    how to check that can be opened only once an application in windows.
    the application. exe uses Qt4

    thank

  2. #2
    Join Date
    Mar 2007
    Location
    Germany
    Posts
    229
    Thanks
    2
    Thanked 29 Times in 28 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: only one instance of an application in windows

    Open a TCP port. If another instance of the application starts and also tries to open that port, the port is already used. Then you can quit the new instance.

    Or:
    When your application starts, check if a dedicated file exists (e.g. yourApp.lock). If not, create that file and continue loading (don't forget to delete that file when exiting). If it exists it must be created by another instance of your application. Then you can exit.

  3. #3
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: only one instance of an application in windows

    See QtCentre Wiki: [WIKI]SingleApplication[/WIKI]
    J-P Nurmi

Similar Threads

  1. setting main application icon on windows
    By JeanC in forum Qt Programming
    Replies: 7
    Last Post: 12th June 2017, 05:35
  2. Start Qt application as Windows Service
    By ^NyAw^ in forum Qt Programming
    Replies: 12
    Last Post: 10th May 2008, 17:23
  3. Only let one instance of the application run
    By chrisdsimpson in forum Newbie
    Replies: 1
    Last Post: 9th April 2008, 21:30
  4. Porting Qt embedded application to windows.
    By vipin in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 14th January 2008, 16:08
  5. Application plugin on windows
    By Eyee in forum Qt Programming
    Replies: 2
    Last Post: 22nd March 2006, 17:36

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.