Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Detecting when any application is started (API?)

Status
Not open for further replies.

aaronino

Programmer
Aug 6, 2001
19
US
Hi,

I would like to detect when an application is started. It doesn't matter what the application is, I'd like my application to be able to react to any application/process opening. I imagine I want to tie into the API event for starting applications. I'm dealing with Windows XP Home, if that's important.

I'd also like to know how to programmatically close an application. Basically, I'm trying to completely lock down a computer so that only certain applications can be started unless they're started through my application, and I'm also curious about where I can find API documentation, if any exists.

Thanks in advance for any help on any of these problems.

-Aaron
 

GoTo MS and search for...

EnumWindows
GetWindowText

There is a lot more API's that you will need but these should get you started. Also Dan Appleman's book on API's is a decent reference.

Good Luck

 
Sounds like you want to do a system hook, welcome to the quickest way to freeze your machine...but hey sounds like a virus that you're trying to write anyway.
 
SemperFi,

Yeah, I know it sounds like that. But I, uh, promise I'm not!

It's actually like a shell for the OS...so I can track what is happening on the machine. I don't want tasks or applications started without going through my shell.

Can you detect API events with a system hook? Is that what it means? And are they really so unstable that it's not worth it? If so, I can use what vb5prgrmr told me and just store the list of applications then loop through every so often to check for new ones...But I'd rather tie directly to the event if possible.

Thanks for your help if you feel comfortable. If not, I understand.

vb5prgrm - Thank you as well. I looked into those functions and they look what i need to grab a list of the applications currently running on the system.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top