The XP Problem
-
-
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
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. 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
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" ;)
-
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" ;)
-
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
take a look here to get information about fast user switching...