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. get logged on user

get logged on user

Scheduled Pinned Locked Moved C / C++ / MFC
question
4 Posts 3 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.
  • H Offline
    H Offline
    hph
    wrote on last edited by
    #1

    hello, i need to know who to determine whether a user is logged on or not. i have already tried GetUserName but this didn't work, because i have a service running as 'system', so GetUserName only returns 'system'. Now, how can i get this information ? OS: Windows 2000 Thanks in advance.

    D T H 3 Replies Last reply
    0
    • H hph

      hello, i need to know who to determine whether a user is logged on or not. i have already tried GetUserName but this didn't work, because i have a service running as 'system', so GetUserName only returns 'system'. Now, how can i get this information ? OS: Windows 2000 Thanks in advance.

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      Check out the UserName property of Win32_ComputerSystem.


      "Ideas are a dime a dozen. People who put them into action are priceless." - Unknown

      1 Reply Last reply
      0
      • H hph

        hello, i need to know who to determine whether a user is logged on or not. i have already tried GetUserName but this didn't work, because i have a service running as 'system', so GetUserName only returns 'system'. Now, how can i get this information ? OS: Windows 2000 Thanks in advance.

        T Offline
        T Offline
        Toby Opferman
        wrote on last edited by
        #3

        If this is Windows 2000 and you think they will always launch the shell you could simpy enumerate processes looking for explorer.exe or whatever they replaced the shell with. Alternatively you could write a Winlogon Notification DLL which gets notified of events such as Logon and Logoff. 8bc7c0ec02c0e404c0cc0680f7018827ebee

        1 Reply Last reply
        0
        • H hph

          hello, i need to know who to determine whether a user is logged on or not. i have already tried GetUserName but this didn't work, because i have a service running as 'system', so GetUserName only returns 'system'. Now, how can i get this information ? OS: Windows 2000 Thanks in advance.

          H Offline
          H Offline
          hph
          wrote on last edited by
          #4

          thanks for the hints, but i have found another workaround. because i have already a process which gets launched at startup - i simply put a pipe in it, which delivers the needed informationen whether a user has logged on. thanks anyway.

          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