Connect to wndproc of another application?

I have a little question hoping someone will help me is there any way to connect to another wndproc application?

the situation is that I want to insert a menu into another menubar application, and I want to define commands for each menu item

I managed to insert a menu with menu items using some win32api functions (User32.dll) but I canโ€™t install the commands of this menu item so that it really is something clicked

with some googling I got some information about wndprocess and I have to intercept the ID command and call some function but I am stuck.

Can anybody help me?

+4
source share
1 answer

You are doing it wrong. If you think about it, you will understand that when responding to menu events using your custom "actions", you need some code to run during the targeting process. This means that you will need to enter the code into another process in order to achieve what you want.

Since you still have to enter the code, I strongly recommend that you take a look at the DLL injection into another process (search for โ€œDll Injection Exampleโ€). This will load your code into another process, and you can create your own menu there.

It also has the advantage that a foreign application will not rely on the responsiveness of your application - everything will be in the process.

+2
source

Source: https://habr.com/ru/post/1402545/


All Articles