?? hook.cpp
字號:
// Hook.cpp: implementation of the CHook class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "Hook.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CHook::CHook()
{
}
CHook::~CHook()
{
}
BOOL CHook::starthook(HWND hWnd)
{
//安裝鉤子并設(shè)定接收顯示窗口句柄
BOOL bResult=FALSE;
glhHook=SetWindowsHookEx(WH_MOUSE,MouseProc,glhInstance,0);
if(glhHook!=NULL)
bResult=TRUE;
//設(shè)置顯示目標(biāo)窗口標(biāo)題編輯框的句柄
glhDisplayWnd=hWnd;
return bResult;
}
BOOL CHook::stophook()
{
//卸載鉤子
BOOL bResult=FALSE;
if(glhHook)
bResult= UnhookWindowsHookEx(glhHook);
if(bResult)
{
glhPrevTarWnd=NULL;
glhDisplayWnd=NULL;//清變量
glhHook=NULL;
}
return bResult;
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -