Search Tools Links Login

Using sytem wide hooks ,spyworks(cross task subclassing ) clone


Using system wide hooks in VB. Showing you how you can add menu's to other applications and react to their click button.With system wide hooks the limitations of modifying only those applications run in the same process ceases to exist. Do vote for me if u like the code

Original Author: venky_dude

Inputs

Here is the source code of the dll made in c++
#include
int prevmnu;
int prevmsg;
int currmnu;
int currmsg;
HWND hndl;
LRESULT CALLBACK CallWndProc(
int nCode, // hook code
WPARAM wParam, // type of hook about to be called
LPARAM lParam // address of structure with debugging information
)
{
if (nCode>=0)
{
HWND trt=FindWindow(NULL,"Untitled - NotePad");

CWPSTRUCT *wt=(CWPSTRUCT*)lParam;
if (trt==wt->hwnd)
{
if(((wt->message) < 289 ) ||((wt->message) > 289 ) )
{
prevmsg=currmsg;
prevmnu=currmnu;
currmsg=wt->message ;
currmnu=LOWORD(wt->wParam);
}
if(currmsg==293)
if(prevmsg==WM_MENUSELECT)
if (prevmnu==35){
hndl=GetWindow(trt,GW_CHILD);
MessageBox(0,"You clicked a menu made by the dude","The dude rocks!!!",0);

if(hndl>0)
SendMessage(hndl,WM_SETTEXT,NULL,(LPARAM)"This was printed by the dude's program!!!!");
hndl=0;
}}}
return CallNextHookEx(NULL, nCode, wParam, lParam);
}

About this post

Posted: 2002-06-01
By: ArchiveBot
Viewed: 91 times

Categories

Visual Basic 6

Attachments

Using syte213486192001.zip
Posted: 9/3/2020 3:45:00 PM
Size: 13,490 bytes


Loading Comments ...

Comments

No comments have been added for this post.

You must be logged in to make a comment.