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 active user's desktop resolution from system account.

Get active user's desktop resolution from system account.

Scheduled Pinned Locked Moved C / C++ / MFC
windows-admintutorial
2 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.
  • _ Offline
    _ Offline
    _Superman_
    wrote on last edited by
    #1

    Hi Guys, What's up!!! I'm trying to figure out how to get the desktop resolution of the active user from the system account. The situation is something like this - I have a custom print processor (One of the print spooler components) that runs in the context of the SYSTEM account. I need to get the desktop resolution of the user who gave the print command in order to do some image processing on an EMF file. So it doesn't matter how many users have logged-in to the machine. I tried using WTSEnumerateSessions/WTSQuerySessionInformation. This only works if you are using a remote session (mstsc.exe) and not for a normal session. My alternate solution for this would be to spawn some process in the user context (Don't know how) and get the desktop resolution to the registry from where it could be read in the SYSTEM context. But I was wondering if there was a cleaner way to achieve this.

    «_Superman_» I love work. It gives me something to do between weekends.

    G 1 Reply Last reply
    0
    • _ _Superman_

      Hi Guys, What's up!!! I'm trying to figure out how to get the desktop resolution of the active user from the system account. The situation is something like this - I have a custom print processor (One of the print spooler components) that runs in the context of the SYSTEM account. I need to get the desktop resolution of the user who gave the print command in order to do some image processing on an EMF file. So it doesn't matter how many users have logged-in to the machine. I tried using WTSEnumerateSessions/WTSQuerySessionInformation. This only works if you are using a remote session (mstsc.exe) and not for a normal session. My alternate solution for this would be to spawn some process in the user context (Don't know how) and get the desktop resolution to the registry from where it could be read in the SYSTEM context. But I was wondering if there was a cleaner way to achieve this.

      «_Superman_» I love work. It gives me something to do between weekends.

      G Offline
      G Offline
      Garth J Lancaster
      wrote on last edited by
      #2

      Im in two minds/tracks of thought .. 1 goes .. use EnumDisplayDevices, EnumDisplaySettings, the other goes get/use WinSta0 and get the user session/desktop through that, but, Im begining to think thats useless/impractical sorry ..

      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