// 原理就是安装全局的WH_KEYBOARD_LL底层键盘钩子.主程序是360安装路径下的safemon文件夹下的searchdesktop.exe
// 安装底层键盘钩子
g_hHook =::SetWindowsHookEx( WH_KEYBOARD_LL, LowKeyboardProc, g_hDll, 0);
// 底层钩子过程
LRESULT CALLBACK LowKeyboardProc( int code, WPARAM wParam, LPARAM lParam )
{
static BOOL bDbClicked = FALSE;
static DWORD dwFirstClickTime = 0;
static const DWORD DBCLICKTIME = 500;
DWORD dwVKCode = ( DWORD )wParam;
LRESULT lRet =::CallNextHookEx( g_hHook, code, wParam, lParam );
if ( HC_ACTION != code )
{
return lRet;
}
KBDLLHOOKSTRUCT* pKbDllHookStruct = ( KBDLLHOOKSTRUCT* )( lParam );
if ( NULL == pKbDllHookStruct )
{
return lRet;
}
if ( pKbDllHookStruct->flags & LLKHF_INJECTED )
{
return lRet;
}
if ( ( pKbDllHookStruct->vkCode != VK_LCONTROL ) && ( pKbDllHookStruct->vkCode != VK_RCONTROL ) )
{
dwFirstClickTime = 0;
return lRet;
}
if ( wParam == WM_KEYUP )
{
if ( bDbClicked )
{
DWORD dwSecondClickTime = GetTickCount();
DWORD dwIntervalTime = dwSecondClickTime - dwFirstClickTime;
if ( dwIntervalTime < DBCLICKTIME )
{
SendMessage( g_hWndNotify, WM_MYMESSAGE, ( WPARAM )g_pCallback, ( LPARAM )g_pParam );
dwFirstClickTime = 0;
bDbClicked = FALSE;
return lRet;
}
else
{
dwFirstClickTime = dwSecondClickTime;
bDbClicked = FALSE;
}
}
else
{
bDbClicked = FALSE;
}
}
else
{
if ( dwVKCode == WM_KEYFIRST )
{
bDbClicked = TRUE;
}
}
return lRet;
}
360双击CTRL桌面快捷搜索逆向
最新推荐文章于 2024-10-10 00:15:00 发布