Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. The XP Problem

The XP Problem

Scheduled Pinned Locked Moved C / C++ / MFC
designhelptutorialquestion
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    1. Both we know in the XP system, we can switch user. 2. If i installed an AP in "user1" and lanch it. 3. Then i switch into "user2", and user2 will lanch the same AP too. 4. How to design the AP can dectect the AP has running in another user? Evil

    C B J 3 Replies Last reply
    0
    • L Lost User

      1. Both we know in the XP system, we can switch user. 2. If i installed an AP in "user1" and lanch it. 3. Then i switch into "user2", and user2 will lanch the same AP too. 4. How to design the AP can dectect the AP has running in another user? Evil

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      Probably the registry - HKEY_CURRENT_USER is a virtual key, that is mapped to the user logged in. Dunno about in XP though. Christian #include "std_disclaimer.h" The careful application of terror is also a form of communication. Eagles may soar, but weasels don't get sucked into jet engines.

      1 Reply Last reply
      0
      • L Lost User

        1. Both we know in the XP system, we can switch user. 2. If i installed an AP in "user1" and lanch it. 3. Then i switch into "user2", and user2 will lanch the same AP too. 4. How to design the AP can dectect the AP has running in another user? Evil

        B Offline
        B Offline
        Ben Burnett
        wrote on last edited by
        #3

        You can create a semaphore with the 'Global\' prefix, just like you would if you were coding for Terminal Server (I think they based the code for Fast User Switching partly on it).

        HANDLE hMySemaphore = CreateSemaphore ( SemaphoreAttributes, 1, 1, "Global\\ThereCanBeOnlyOne" );

        Note that you'll have to remove the back hack if you’re going to be running the application on Win9x or NT 4.0 (Win2K will just ignore it). Ben Burnett --------- On the topic of code with no error handling -- It's not poor coding, it's "optimistic" ;)

        L 1 Reply Last reply
        0
        • B Ben Burnett

          You can create a semaphore with the 'Global\' prefix, just like you would if you were coding for Terminal Server (I think they based the code for Fast User Switching partly on it).

          HANDLE hMySemaphore = CreateSemaphore ( SemaphoreAttributes, 1, 1, "Global\\ThereCanBeOnlyOne" );

          Note that you'll have to remove the back hack if you’re going to be running the application on Win9x or NT 4.0 (Win2K will just ignore it). Ben Burnett --------- On the topic of code with no error handling -- It's not poor coding, it's "optimistic" ;)

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          I had tried this way, but it seem work correct in the same user, but can't work when i switch into another user in XP.

          1 Reply Last reply
          0
          • L Lost User

            1. Both we know in the XP system, we can switch user. 2. If i installed an AP in "user1" and lanch it. 3. Then i switch into "user2", and user2 will lanch the same AP too. 4. How to design the AP can dectect the AP has running in another user? Evil

            J Offline
            J Offline
            Jens Kreiensiek
            wrote on last edited by
            #5

            take a look here to get information about fast user switching...

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups