vs2005 0xc0000142错误和KBDLLHOOKSTRUCT没有声明2

#ifndef WINVER
#define WINVER 0x0400
#endif
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0400
#endif//这几行放在#include<Windows.h>的前面啊 我晕
#include<Windows.h>
#include <TCHAR.H>
/*#pragma data_seg("MySec")

#pragma data_seg()*/
HWND g_hwnd=NULL;

HHOOK g_hKeyBoard=NULL;
HINSTANCE handle=NULL;

BOOL WINAPI DllMain(HINSTANCE hInstance,ULONG ulReason,LPVOID Reserved)

{
switch( ulReason) 

case DLL_PROCESS_ATTACH:
// Initialize once for each new process.
// Return FALSE to fail DLL load.
handle= hInstance;
break;
case DLL_THREAD_ATTACH:
// Do thread-specific initialization.
break;
case DLL_THREAD_DETACH:
// Do thread-specific cleanup.
break;
case DLL_PROCESS_DETACH:
// Perform any necessary cleanup.
break;
}
return TRUE;  // Successful DLL_PROCESS_ATTACH.
}
LRESULT CALLBACK LowLevelKeyboardProc(          int nCode,
 WPARAM wParam,
 LPARAM lParam
 )
{
KBDLLHOOKSTRUCT* kb= (KBDLLHOOKSTRUCT *)lParam;
if(kb->vkCode==VK_LWIN)
return TRUE;
else
return CallNextHookEx(g_hKeyBoard,nCode,wParam,lParam);

}

void SetHookLL(HWND wnd)

{
g_hwnd=wnd;
g_hKeyBoard=SetWindowsHookEx(WH_KEYBOARD_LL,LowLevelKeyboardProc,handle,0);
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值