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. .NET (Core and Framework)
  4. Doesn't a Process have a user?

Doesn't a Process have a user?

Scheduled Pinned Locked Moved .NET (Core and Framework)
csharpquestion
3 Posts 2 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.
  • D Offline
    D Offline
    Dave Midgley
    wrote on last edited by
    #1

    I am writing a C# app which accesses the list of processes using Process.GetProcesses(). However I was very puzzled when I studied the Process class to discover that it has no method or property pertaining to the user that is running the process. Surely, under XP at least, all processes must have an associated user. Certainly Task Manager lists the user with each processes. Can anyone tell me how, having got the Process object, I then find out which user it is running under? Dave

    S 1 Reply Last reply
    0
    • D Dave Midgley

      I am writing a C# app which accesses the list of processes using Process.GetProcesses(). However I was very puzzled when I studied the Process class to discover that it has no method or property pertaining to the user that is running the process. Surely, under XP at least, all processes must have an associated user. Certainly Task Manager lists the user with each processes. Can anyone tell me how, having got the Process object, I then find out which user it is running under? Dave

      S Offline
      S Offline
      S Senthil Kumar
      wrote on last edited by
      #2

      If you know the Win32 API function to retrieve that information, you can always P/Invoke it and pass theHandle[^] property as the HANDLE parameter. Regards Senthil _____________________________ My Blog | My Articles | WinMacro

      D 1 Reply Last reply
      0
      • S S Senthil Kumar

        If you know the Win32 API function to retrieve that information, you can always P/Invoke it and pass theHandle[^] property as the HANDLE parameter. Regards Senthil _____________________________ My Blog | My Articles | WinMacro

        D Offline
        D Offline
        Dave Midgley
        wrote on last edited by
        #3

        Well, if that's the only way . . . Actually I don't know the API call either - anybody help? Dave

        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