Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

receiving notification when user runs a program

hi,
i am creating a program to respond to other programes run by the user

eg. if the user runs a program with the caption "hello", my program gets notified and perform some action.

so the basic problem is: how do i get this notification to my program??

so i am looking for something like

OnProgramRun
{
if (program_caption = "hello")
{do action .....}

}

platform : win98se
:)
[451 byte] By [hanhao] at [2007-11-11 7:44:12]
# 1 Re: receiving notification when user runs a program
You want to know when a specific program is executed? Is that your question?
jonnin at 2007-11-11 21:02:04 >
# 2 Re: receiving notification when user runs a program
You want to know when a specific program is executed? Is that your question?

kinda
my main objective is to respond to a program being ran
do act accordingly

eg. if that program has a caption "hello"
i perform a certain action

if tha program has a caption "today"
i perform another action
hanhao at 2007-11-11 21:02:58 >
# 3 Re: receiving notification when user runs a program
What is a "caption"
jonnin at 2007-11-11 21:04:03 >
# 4 Re: receiving notification when user runs a program
Add
[B]CWnd* pWnd = AfxGetMainWnd();
pWnd->PostMessage(WM_USER+01, 1, LPARAM lParam);
to your main code under OnInitDialog(), if the application is dialog based
or to InitInstance() if the project is normal Win32 project. Then add OnMessage(WM_USER+01, OnProgramExecute);. After that add function named OnProgramEcecute to your WinApp.h or to WinAppDlg.h.
Then just create the function, and write your own code under it.
DragonArt at 2007-11-11 21:04:58 >