🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #2455

Re: would like info on a monitoring type program

#2455
From: Michael Harris
Date: Mon, 19 Feb 2007 16:43
46 lines
2575 bytes
Alan is not familiar with a watchdog type application....
you need to enum the running procs....
http://www.codeproject.com/threads/w32process.asp

restarting
SECURITY_DESCRIPTOR sd;
SECURITY_ATTRIBUTES sa;
   InitializeSecurityDescriptor(&sd, SECURITY_DESCRIPTOR_REVISION);
   SetSecurityDescriptorDacl(&sd, true, NULL, false);
   sa.nLength = sizeof(SECURITY_ATTRIBUTES);
   sa.bInheritHandle = false;
   sa.lpSecurityDescriptor = &sd;
STARTUPINFO si;
memset(&si, 0, sizeof(STARTUPINFO));
si.cb = sizeof(STARTUPINFO);
PROCESS_INFORMATION pi;

if( CreateProcess(NULL,
                  AppIdentity.c_str(), // passed in ansistring
                  NULL,  //security
                  NULL,  // security
                  TRUE,  //inherits handles
                  0,
                  0,
                  0,
                  &si,
                  &pi) )

{}

sooner or later you will realize a need to monitor services also. see 
OpenSCManager and related APIs


--
Michael

"tom"  wrote in message
>    Thank you Alan Bellingham for the great insight on your answer. I 
> didn't know that one had to do that. Now that I have had my Monday morning 
> chuckle can anyone give me any more information that might point me to a 
> program that would allow me to do what I originally posted. That is to 
> allow me to possibly start a process that did not start on a reboot or 
> cold start of my computer. Thank you
> 
Technical Details
Message-ID: <45d9d3eb@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!203.109.252.33.MISMATCH!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <45d882c7$1@newsgroups.borland.com> <d51ht2d165ipu7bqqj99ognjrep4v46r1n@4ax.com> <45d9a763@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,fcb6977ffe1cf3bd
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
Reply-To: "Michael Harris" <techonos-NO-SPAM-@attbi.com>
From: "Michael Harris" <techonos-NO-SPAM-@attbi.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <45d882c7$1@newsgroups.borland.com> <d51ht2d165ipu7bqqj99ognjrep4v46r1n@4ax.com> <45d9a763@newsgroups.borland.com>
Subject: Re: would like info on a monitoring type program
Date: Mon, 19 Feb 2007 10:43:06 -0600
Lines: 48
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
NNTP-Posting-Host: 76.187.71.134
Message-ID: <45d9d3eb@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1171903467 76.187.71.134 (19 Feb 2007 08:44:27 -0800)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!203.109.252.33.MISMATCH!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail