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