How do I hook into the WndProc of another application in Vb.Net

672 Views Asked by At

I am trying to simulate some clicking on a flash control on a window belonging to another executable using the AutoIT COM Object.

Since it is a long-running script I'd like to keep the system usable by normal (read: physical) means meanwhile. I first taught of a virtual machine, then I remembered that WndProc hooking exists.

Now I'd like to simulate clicks with fake WM_* messages instead of using AutoIt because it hijacks the mouse, in order to be able to run the automation in background without the mouse moving by itself and my current active window (i.e. notepad) losing focus.

My problem is that I have no idea on how to achieve the WndProc hooking in Vb.Net. People says a Dll injection is needed but in my previous Realbasic experience I did it in plain win api. (To write messages I don't know, but to read worked.)

Ps. I've checked and no similar question seems to address this (at least in vb.net).

0

There are 0 best solutions below