Single Instance Application

Sdílet
Vložit
  • čas přidán 17. 06. 2024
  • How to create a single instance application?

Komentáře • 6

  • @chicoern
    @chicoern Před rokem +1

    That's a cool concept to apply in PS scripts. Very nice.

  • @thefastjojo
    @thefastjojo Před rokem +3

    Nice content Pavel! I'm looking forward to keeping following you in those quick videos!

  • @logicchild
    @logicchild Před rokem +2

    Great as usual. I remember one day that a malware was taking an app's mutex at startup which prevents the original app from starting. Interesting

    • @zodiacon
      @zodiacon  Před rokem +1

      You can do that for media player as well :)

  • @MarekKnapek
    @MarekKnapek Před rokem

    If you have such single-instance application, it is nice, when you launch the second instance, to activate the first instance's window. Because when the user launches an application they expect some window to appear. It is important to choose proper combination of of single-instancing and window-activating functions. It happened to me, back in he Windows XP days, that launching Firefox web browser did nothing. Because second instance of Firefox could not activate window of first the instance. It was because I was using SysInternals Desktops to create multiple desktops (Windows' terminology, similar to session, different from window-management feature introduced in Windows 10). Single-instancing worked fine across desktops (because named mutexes are per-session), but existing browser window could not be displayed on screen, because I was at different desktop. I was confused for a while: double-clicking Firefox did "nothing".

    • @zodiacon
      @zodiacon  Před rokem

      Indeed. Media Player uses FindWindow to locate its other window, which is common, but only works for the caller's desktop.