Article View: borland.public.cppbuilder.nativeapi
Article #15284Re: Monitoring what a user's doing
From: Pete Fraser
Date: Tue, 15 Jul 2003 13:06
Date: Tue, 15 Jul 2003 13:06
50 lines
3021 bytes
3021 bytes
Thanks Max, I was beginning tho think that might be the way to start (Run app from Registry) How does a console app get shut down? Does it need to set up a message queue to get shutdown messages from windows? I've not done this kind of (always running) app before :( I will probably keep the Service based app for later on when I feel braver! Rgds Pete "Max Topley" <mtj2@btopenworld.com> wrote in message news:t6p7hvsgvjr8bkm3f9l4jo034d8d59bprq@4ax.com... On Tue, 15 Jul 2003 11:58:46 +0100, Pete Fraser wrote: >I'm trying to write a service that monitors which user is logged on and what >apps they are running. Does anyone know if: >a) This is possible and More or less, yes. With lots of "ifs" and "buts".......... >b) Any pointers as to how to do it Nasty. Don't forget that there may, at least in theory, be several "users" logged in at any one time, each with their own console and desktop(s). Security features may well get in the way, as well. You'd really need to start poking around in Windows internals and data structures to do the job properly. If you're really keen, you might like to have a look here as a start: http://www.sysinternals.com/ >I've got the basic service going but can't find out how to find out the >current user and their tasks. >I have written loops using GetTopWindow and GetNextWindow before but need to >know how to use these within a service. > >Or is it better to write an app that gets started at login time? > >What I want is something that can't be shut down by any old user (It's an >app to stop kids spending too much time on Messenger etc and thus not doing >homework and I don't want them to be able to shut it down themselves!) I think I'd just write something that starts at user login. If you write it as a console app, and start it from the "Run" key in the registry, then it won't show as an app, but it will show in the process list (but you could deny their account access to the task manager anyway). -- Max
Technical Details
Message-ID:
<3f13fc45@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<3f13de65$1@newsgroups.borland.com> <t6p7hvsgvjr8bkm3f9l4jo034d8d59bprq@4ax.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,c2e41c15dcc5c61d X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-07-15 06:12:03 PST From: "Pete Fraser" <pete.fraser@at.frasersoft.dot.net> Newsgroups: borland.public.cppbuilder.nativeapi References: <3f13de65$1@newsgroups.borland.com> <t6p7hvsgvjr8bkm3f9l4jo034d8d59bprq@4ax.com> Subject: Re: Monitoring what a user's doing Date: Tue, 15 Jul 2003 14:06:13 +0100 Lines: 52 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 NNTP-Posting-Host: 195.12.18.1 Message-ID: <3f13fc45@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1058274373 195.12.18.1 (15 Jul 2003 06:06:13 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail