Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Detect program starting

Posted on 1998-07-22
10
Medium Priority
?
164 Views
Last Modified: 2010-04-04
How can I detect from Delphi 2.0 programs if any Windows program is starting and read it's path? HELP ME, fastest as yu can!
0
Comment
Question by:mmilan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
  • +2
10 Comments
 

Expert Comment

by:westy100697
ID: 1358379
This is not really an answer more of a direction I think you should look at. Have a look in the Win32 help file for Event Logging Information. The procedures to look at i reckon relate to the registry and log files. These are as follows

GetNumberofEventLogRecords()
GetOldestEventLogRecord()
OpenEventLog()
ReportEvent()
ReportEventLog()
etc etc

See if that helps at all...
Like I said may not be a solution but may point you in direction...

WESTY
0
 
LVL 4

Expert Comment

by:erajoj
ID: 1358380
An easy way, not the best, is to scan the process list (process walking) by using
Process32First and Process32Next. Then you will get a complete list of all available
Win32 processes.

OR

.even easier, if you just want to detect windowed "programs"; use EnumWindows, EnumChildWindows to get all visible windows.

/// John
0
 
LVL 4

Accepted Solution

by:
d003303 earned 200 total points
ID: 1358381
Yo,
set a WH_SHELL hook with SetWindowsHookEx and listen to the HSHELL_WINDOWCREATED hook code in your hook proc.
Hook procedures need to resist in a DLL and are mapped in the process space where the hook event occured. So you cannot pass parameters through global DLL variables. You need memory mapped files for that.
For sample code, you'll have to increase the points ;-)

Slash/d003303
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Expert Comment

by:bome
ID: 1358382
Well, don't want to offend you, d003303, but I have made a freely available shell hook component. mmilan, give him the points and I'll give you the component... ;)

On the other hand I don't understand ..."and read it's path?"
What do you want to say with that ?

bome
0
 
LVL 4

Expert Comment

by:erajoj
ID: 1358383
The executable filename?
0
 

Author Comment

by:mmilan
ID: 1358384
Is it OK, HURRY UP!
0
 
LVL 4

Expert Comment

by:d003303
ID: 1358385
Yo,
mmilan, reject my answer and give bome the points !
bome, no problem. Just didn't know you have something for hooking in stock ;-)

Slash/d003303
0
 

Expert Comment

by:bome
ID: 1358386
OK, read the executable filename. My component does not provide that.

mmilan, what do you mean with hurry up ?

bome
0
 

Expert Comment

by:bome
ID: 1358387
OK, d003303.
mmilan, download it at
http://clio.unice.fr/~fbomers/Watch100.zip

I don't want the points, d003303, your answer was right and appropriate for the points.

bome

PS: and I was too late :)
0
 
LVL 4

Expert Comment

by:d003303
ID: 1358388
Yo,
I took a look at your problem with the program path. The only thing you can get is the name of the module (EXE, DLL, VXD, DRV, ...) and the name of the process (EXE) the window belongs to. AFAIK there is no way to get the complete path out.
If you want to write a log with all used apps on the system, you may want to create a continiously updated table with EXE files in the system and search through that with the process file name.

Slash/d003303
0

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question