Click here to Skip to main content
15,910,603 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I need to influence the behaviour of an existing process (e.g., explorer) by automatically launch another application (e.g., notepad) whenever it starts. What would be the best approach?

One way that I know is to use code injection dll to the explorer through Appinit_dll setting. The code injection dll then spawns the notepad. But doing so would affect not only explorer but all process that loads user32.dll. Am I right?

Is there any other method?
Posted
Comments
Sergey Alexandrovich Kryukov 12-May-14 22:32pm    
Why? why?!

Some parts of beginners go in very wrong direction; I appreciate you interest is such tricks, but most likely you are one of them. Not only this is a problem not for beginners, but this direction of development is practically useless. What, do you want to put yourself in dependence of some other products? Better develop your own code, don't touch utilities supplied with the system and 3rd-party applications.

—SA
jk-newbie 13-May-14 19:55pm    
If everyone has to develop everything herself, we would still be in the medieval period.

1 solution

If you're specifically targeting explorer.exe, you can use a BHO - Browser Helper Objects for Windows Explorer[^]

If not you'll need to use other advanced techniques that are not really recommended or guaranteed to work -
Three Ways to Inject Your Code into Another Process[^]
A More Complete DLL Injection Solution Using CreateRemoteThread[^]
 
Share this answer
 
Comments
CPallini 13-May-14 3:32am    
5.
jk-newbie 13-May-14 19:49pm    
I like the BHO method. I will give it a try. Thanks.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900