Detou簡單使用例項

2021-06-19 12:38:56 字數 730 閱讀 5425

開啟vs2008 -》新建 -》專案-》win32專案(輸入detourhook) -》確定 -》下一步 -》windows應用程式(其它預設)-》完成。

把下面**完全拷貝到detourhook.cpp中,detourhook.cpp中原來**完全刪除。編譯。通過。。有警告忽略處理。。。。。

#include "stdafx.h"

#include "detourhook.h"

#include #pragma comment(lib, "detours.lib")

#pragma comment(lib, "detoured.lib")

static int (winapi* old_messageboxw)(hwnd hwnd,lpcwstr lptext,lpcwstr lpcaption,uint utype)=messageboxw;

int winapi new_messageboxw(hwnd hwnd,lpcwstr lptext,lpcwstr lpcaption,uint utype)

void hook()

void unhook()

int apientry _twinmain(hinstance hinstance,

hinstance hprevinstance,

lptstr lpcmdline,

int ncmdshow)

參考:

MySQL簡單使用例項

1 建立學生表student 要求 1 屬性包括學號 sno 學生姓名 sname 年齡 age 性別 所在系 dept 2 學號為表的主碼 3 姓名非空 4 年齡預設值為18 5 性別男或女 2 建立課程表course cno,cname,credit,teacher,pcno 要求 1 屬性包括...

反射使用的簡單例項

建立乙個程式集例項 定義乙個型別陣列並從程式集例項中獲得 type t a.gettypes 迴圈輸出型別陣列中的類的名稱 for int i 0 i 定義乙個方法資訊例項 並從程式集中指定名稱的類中指定名稱的方法獲得 system.reflection.methodinfo m a.gettype...

使用curl的簡單例項

a 使用vs新建乙個win32的控制台程式。b 在工程目錄下,新建乙個include的資料夾,將libcurl 7.18.0 win32 msvc include curl這個目錄拷貝到include目錄下。c 專案 屬性 c c 常規 附加包含目錄 新增 include d 在工程目錄下,新建乙個...