"kalpesh" <> wrote ...
> Now i want Process List of currnt login user from my this printer
> driver
> Or
> we can say that i want Process list of current login user from window
> service
Sounds like a job for WTSEnumerateProcesses() ?
A quick trawl on Google, shows this sample:
http://www.codeproject.com/w2k/Liviu...648#xx908648xx
But you are always going to find it awkward to send WM messages from a
driver or service, to a user session. Basically Microsoft does not want you
to do this; so they don't provide any APIs to make it easy. The robust way
for a service to communicate with a user, is to have a user mode process
which starts when the user logs in (it could be a hidden app, no visible
Windows). This app displays the messages to the user, eg via MessageBox().
The driver and/or service communicate with this user-mode app, using some
proper form of inter-process communication, such as Named Pipes or RPC -
instead of trying to poke a WM message across session and user boundaries.
Sending Window Messages like that worked back in simple Win 3.x days, when
no-one cared about security, and there was only a single user per machine.
But it just doesn't fit in with today's world. You've already seen thsi
page, right?
http://blogs.technet.com/askperf/arc...isolation.aspx
Hope it helps a bit,
Andrew