仿照別人寫的鍵盤HOOK,hoho

2021-04-08 20:28:39 字數 910 閱讀 2596

就這個小破程式還耽誤了我兩天,我真是太笨了。。。

這是乙個全域性的鉤子,需要放在dll中。關於dll的部分就不說了。

#pragma data_seg("simdata")

hwnd glbprevwnd = null;

static hhook glbhook = null;

hinstance glbinst = null;

file * f1;

#pragma data_seg()

#pragma comment(linker, "/section:simdata,rws")

lresult callback keyboardproc(

int ncode,

wparam wparam,

lparam lparam)

else

;messagebox(null, op, "提示",mb_ok|mb_iconinformation);

}fclose(f1);

}       

}   

return callnexthookex( glbhook, ncode, wparam, lparam );   

}bool starthook()

bool stophook()

return true;

}呼叫的時候要動態的載入:

typedef bool (callback *lphookstart) ();

lphookstart mystart;

hinstance hhand;

hhand = loadlibrary("simhook.dll");

if( (mystart = (lphookstart)getprocaddress(hhand, "starthook")) != null)

仿照SDK程式設計寫的視窗

option explicit public declare function createwindowex lib user32 alias createwindowexa byval dwexstyle as long,byval lpclassname as string,byval lpwi...

別人寫的雙鏈表

寫了個雙向鍊錶 include template struct nodetype template class doublelist template const doublelist doublelist operator const doublelist otherlist if this ot...

如何看待別人寫的「心得,總結」

首先宣告一點,心得與總結不包括教程,教育型別,而是一些個人 學習 總結,工作 總結,技巧總結等 一直以來,自己都認為,學習別人的 學習心得,總結或工作心得,總結 是最快的提公升方法,因為是站在前人的基礎上進行學習,所以能規避掉學習道路上的陷阱,障礙,困難等,它能讓自己以最順利,最安全的方法去走這條路...