getting an app. to start another app.

I have writtin an application that I would like to start when a particular application is started. In other words I want to be able to start, lets say word.exe, and have my application execute at the same time. Is this possible?

Well, you're not allowed to do much !
Instead, you can possibly move the exe file of the application you want to execute (let's say '..\Program Files\Microsoft Office\Office\WINWORD.EXE') to a directory

This solution would mean the user would have to start my application first and then the other application would start. I want the user to be able to start my application by starting a different application. In other words, I need my application to automatically be started.

Well, this is possible by setting a shell hook using 'SetWindowsHookEx()'. When your hook proc receives 'HSHELL_WINDOWCREATED', you can check if it is e.g. 'WinWord' by using 'GetWindowText( ( HWND) wParam), ...)' (see help on 'ShellProc()' why i use 'wParam', it's a bit too much to elaborate here ;-). If so, the shell hook could start your application.

On Win95/Win NT 4 and over, try modifying registry key "HKEY_CLASSES_ROOT\exefile\shell\open\command" that specify what command is executed when an .EXE file is launched from the shell.

The default value is '"%1" %*' meaning the launched command is the exefile itself with all its parameters.

You can set the key value to something like 'MYLAUNCH "%1" %*'
where MYLAUNCH is a program of yours that will be executed every time a exe file is launched. MYLAUNCH will receive the exe file path as first parameter.
Then, in MYLAUNCH, you'll have the possibility to launch the exe file using WinExec or CreateProcess API.

Be careful when modifying this registry key, because it control every executable program that you will have to launch from the shell. To prevent problems, test your MYLAUNCH program first with 'batfile' key for example, that controls .BAT file launching.

Where is this registry key located. I've not heard of this before, could you give me a little more help?

jkr- the requirements of the project I'm working on are out of my control and that's why I'm not able to create the global hook. I'm sure that it would have worked but I think my superiors believe it would effect system resources too much.

The HKEY_CLASSES_ROOT registry key contains associations between file extensions and commands (specifies what command is executed when a file with associated extension is lauched)

Don't you know how to use REGEDIT tool ?
Execute REGEDIT (Registry editor) from WIN95/NT shell and open successively the following keys on the left part of the Registry editor window :
HKEY_CLASSES_ROOT, exefile, shell, open, command
(HKEY_CLASSES_ROOT contains a great amount of ".xxx" keys. "exefile" is located after those ones in ASCII order)
Then, on the right part of the Registry editor window, you can modify "(Default)" key by double-clicking it.

On what system are you working :
Win 3.x ? Win 95 ? NT 3.51 ? NT 4 ?

Once again, be careful when modifying registry keys. As I last wrote, you should first test your program by modifying "batfile" key instead of "exefile" and try lauching a .BAT file.

Here is a small code piece that can be used for a MYLAUNCH program, as I described earlier :

Well, you're not allowed to do much !
Instead, you can possibly move the exe file of the application you want to execute (let's say '..\Program Files\Microsoft Office\Office\WINWORD.EXE') to a directory that is not in the PATH environment variable. Then replace '..\Program Files\Microsoft Office\Office\WINWORD.EXE'
by your own WINWORD.EXE program, which does its own stuff and then launch the real WINWORD.EXE (you can use MYLAUNCH example for this purpose).

Thus, any WINWORD executed from the shell will launch your own WINWORD.EXE

I haven't tested this solution, but you should find your way based upon this idea.
Hope this helps !

I think your answers a great and I know the registry solution would have work. You right I'm not allowed to do much. O well, ya gotta listen to the boss I guess. Thanks for your input and I'll try you other solution. It sound logical.

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms. Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go. MFC has a very cool system for handli…

Introduction:
Load and Save to file, Document-View interaction inside the SDI.
Continuing from the second article about sudoku.
Open the project in visual studio.
From the class view select CSudokuDoc and double click to open the header …

Internet Business Fax to Email Made Easy -
With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number.
You'll receive secure faxes in your email, fr…