Thread: ensure my prog only starts in session 0

  1. #1
    Registered User
    Join Date
    Feb 2002
    Posts
    329

    ensure my prog only starts in session 0

    How do i find out what windows session my program is starting up in?
    I'm making a server application, and run into problem when terminal server users are logging on:
    My program is in the startup folder, and is started many times when this happens, strange things happen then..

  2. #2
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    Have you tried Mutex setting to check if the program is already running?
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

  3. #3
    Registered User
    Join Date
    Feb 2002
    Posts
    329
    No, i'm just using FindWindow() with the classname, but it doesn't seem to detect it in another session..
    will a mutex be detected? I'll check if the function i just found doesn't work: WTSGetActiveConsoleSessionId()

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Assembly amature question: prog errors
    By geek@02 in forum Tech Board
    Replies: 1
    Last Post: 10-03-2008, 01:35 PM
  2. need help making a dot bounce up and down y axis in this prog
    By redwing26 in forum Game Programming
    Replies: 10
    Last Post: 08-05-2006, 12:48 PM
  3. an option at the end of this prog to ask if I want to run again
    By bandito9111 in forum C++ Programming
    Replies: 2
    Last Post: 03-31-2003, 02:30 PM
  4. Try my prog...
    By Commander in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 05-09-2002, 07:43 AM
  5. password prog
    By ihsir in forum A Brief History of Cprogramming.com
    Replies: 10
    Last Post: 01-06-2002, 06:39 AM