Identify Which Desktop an App is Running On

  • Thread starter Thread starter Jay
  • Start date Start date
J

Jay

Hey There,
Is it possible to get an unique identifier for a desktop that a
particular app is running from, from a service? If there are two
instances of the app running on different desktops (one desktop is
locked, the other is in use) then the service should have different
values for each one.

Thanks,
Jay
(patelj27b at gmail dot com)
 
Jay said:
Hey There,
Is it possible to get an unique identifier for a desktop that a
particular app is running from, from a service? If there are two

How are you identifying a "particular app"? By .exe name? By window title?

OpenInputDesktop, or else EnumDesktops and EnumDesktopWindows should let you
find a desktop handle for the desktop. Then
GetUserObjectInformation can get you the unique name.
 
Mr. Voigt,
I am going to be identifying the particular app by .exe name,
which I can find, in turn, the Process ID.

-Jay
 
Mr. Voigt,
Also, if the calling process is a service process, can it get the
input desktop handle from Open InputDesktop? Would it have the correct
window station?

-Jay
 
Back
Top