HTFC Forums

H.T.F.C.

How To Fix Computers





Go Back   HTFC Forums > Software Newsgroups > Windows Vista

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1  
Old 06-27-2007, 06:14 AM
kalpesh
 
Posts: n/a
Default Get Process List from window Service

I am developing virtual printer driver In window vista operation
system which run under spooler service.

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
i got the current user session id from WTSGetActiveConsoleSessionId()
API
now how can i get the process list of this active session my Window
serivice i got idea
that using WTSQuerySessionInformation get the application name running
user session
but i dont know how to use this function help me.

Any comments are welcome..
Kalpesh.

Reply With Quote
Sponsored Links
  #2  
Old 06-27-2007, 08:09 AM
Andrew McLaren
 
Posts: n/a
Default Re: Get Process List from window Service

"kalpesh" <kalpeshgedia@gmail.com> 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

Reply With Quote
  #3  
Old 06-27-2007, 08:47 AM
Andrew McLaren
 
Posts: n/a
Default Re: Get Process List from window Service

By the way, while I think your question *is* appropriate for this newsgroup,
you'll probably get better answers at a forum like Code Guru:
http://www.codeguru.com/forum/

.... or The Code Project:
http://www.codeproject.com/script/co...p?forumid=1647

.... or the "microsoft.public.win32.programmer.ui" newsgroup.

I don't think many of the folks reading
microsoft.public.windows.vista.general are Win32 C++ programmers! Most of
them are just users. You'll get better answers for these questions from
places where programmers hang out.

Good luck!
Andrew

Reply With Quote
  #4  
Old 06-27-2007, 09:08 AM
kalpesh
 
Posts: n/a
Default Re: Get Process List from window Service

On Jun 27, 12:47 pm, "Andrew McLaren" <and...@somewhere.com> wrote:
> By the way, while I think your question *is* appropriate for this newsgroup,
> you'll probably get better answers at a forum like Code Guru:
> http://www.codeguru.com/forum/
>
> ... or The Code Project:
> http://www.codeproject.com/script/co...p?forumid=1647
>
> ... or the "microsoft.public.win32.programmer.ui" newsgroup.
>
> I don't think many of the folks reading
> microsoft.public.windows.vista.general are Win32 C++ programmers! Most of
> them are just users. You'll get better answers for these questions from
> places where programmers hang out.
>
> Good luck!
> Andrew


Thanks a lot
kalpesh.

Reply With Quote
  #5  
Old 06-27-2007, 09:42 AM
kalpesh
 
Posts: n/a
Default Re: Get Process List from window Service

On Jun 27, 1:08 pm, kalpesh <kalpeshge...@gmail.com> wrote:
> On Jun 27, 12:47 pm, "Andrew McLaren" <and...@somewhere.com> wrote:
>
>
>
>
>
> > By the way, while I think your question *is* appropriate for this newsgroup,
> > you'll probably get better answers at a forum like Code Guru:
> > http://www.codeguru.com/forum/

>
> > ... or The Code Project:
> > http://www.codeproject.com/script/co...p?forumid=1647

>
> > ... or the "microsoft.public.win32.programmer.ui" newsgroup.

>
> > I don't think many of the folks reading
> > microsoft.public.windows.vista.general are Win32 C++ programmers! Most of
> > them are just users. You'll get better answers for these questions from
> > places where programmers hang out.

>
> > Good luck!
> > Andrew

>
> Thanks a lot
> kalpesh.- Hide quoted text -
>
> - Show quoted text -


Thanks for reply
i have more question that my Printer driver DLL is one serice which
run in session 0 and user run in session 1 , session 2 and so on..
In
window vista operation system.

now i want process list of user session means i want a process list
of
session 1 from session 0, is it possible in VISTA if yes then HOW
please help me...


Thanks,
Kalpesh



Reply With Quote
  #6  
Old 06-27-2007, 03:36 PM
Andrew McLaren
 
Posts: n/a
Default Re: Get Process List from window Service

> now i want process list of user session means i want a process list
> of
> session 1 from session 0, is it possible in VISTA if yes then HOW


See Liviu Birjega 's sample C++ code at the link I sent before:
http://www.codeproject.com/w2k/Liviu...648#xx908648xx

Reply With Quote
Sponsored Links
Fix your Windows Problems - FAST.
FREE Safe Scan Registry Check. Locate & Fix Errors in Minutes!
Reply


Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
PDIHWCTL service failed, EventID: 7000, Source: Service Control Manager Eventlog Provider ls [sb] Windows Vista 0 06-21-2007 04:20 AM
MessageBox from Window Service in Vista kalpesh Windows Vista 0 06-19-2007 01:25 PM
MessageBox from Window Service in Vista kalpesh Windows Vista 0 06-19-2007 01:25 PM
Process & service programmernovice@yahoo.com Windows XP 1 06-09-2007 03:39 AM
Winword.exe child of svchost (DCom Server Process Launcher, Terminal Service) TheOne Windows XP 1 04-03-2007 12:06 PM


All times are GMT. The time now is 11:55 AM.


Powered by vBulletin® Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0
© 2004 - 2007 Web-S-Sense Pty. Ltd. Usenet and forums posts © their respective authors.
Ad Management by RedTyger