首页
社区
课程
招聘
[旧帖] [求助]:eek: 这个DLL工程无效 0.00雪花
发表于: 2010-12-18 21:04 794

[旧帖] [求助]:eek: 这个DLL工程无效 0.00雪花

2010-12-18 21:04
794
自己做的个DLL叫“CF自动卡BUG”,C++的,我加载了无效,怎么滴,各位大虾看看,那个keybd_event无效额
#include <windows.h>
HWND hWnd;
HHOOK g;
void c();
void CALLBACK p(HWND hWnd,UINT nMsg,UINT nTimerid,DWORD dwTime)
{
        switch(nMsg)
        {
        case WM_TIMER:c();break;
        }
}
void c2()
{
keybd_event(0x11,0,0,0);
   keybd_event(0x20,0,0,0);
   Sleep(700);
   keybd_event(0x20,0,KEYEVENTF_KEYUP,0);
   Sleep(700);
   keybd_event(0x57,0,0,0);
   Sleep(300);
   keybd_event(0x57,0,KEYEVENTF_KEYUP,0);
   Sleep(300);
   keybd_event(0x53,0,0,0);
   Sleep(300);
   keybd_event(0x53,0,KEYEVENTF_KEYUP,0);
   Sleep(300);
   keybd_event(0x57,0,0,0);
   Sleep(800);
   keybd_event(0x11,0,KEYEVENTF_KEYUP,0);
   keybd_event(0x11,0,0,0);
   keybd_event(0x11,0,KEYEVENTF_KEYUP,0);
   keybd_event(0x57,0,KEYEVENTF_KEYUP,0);
}
void c1()
{
   keybd_event(0x11,0,0,0);
   keybd_event(0x20,0,0,0);
   Sleep(700);
   keybd_event(0x20,0,KEYEVENTF_KEYUP,0);
   Sleep(700);
   keybd_event(0x57,0,0,0);
   Sleep(300);
   keybd_event(0x57,0,KEYEVENTF_KEYUP,0);
   Sleep(300);
   keybd_event(0x53,0,0,0);
   Sleep(300);
   keybd_event(0x53,0,KEYEVENTF_KEYUP,0);
   Sleep(300);
   keybd_event(0x57,0,0,0);
   Sleep(300);
   keybd_event(0x57,0,KEYEVENTF_KEYUP,0);
   Sleep(300);
   keybd_event(0x53,0,0,0);
   Sleep(300);
   keybd_event(0x53,0,KEYEVENTF_KEYUP,0);
   Sleep(300);
   keybd_event(0x57,0,0,0);
   Sleep(800);
   keybd_event(0x11,0,KEYEVENTF_KEYUP,0);
   keybd_event(0x11,0,0,0);
   keybd_event(0x11,0,KEYEVENTF_KEYUP,0);
   keybd_event(0x57,0,KEYEVENTF_KEYUP,0);
}
LRESULT CALLBACK b(int code,WPARAM wParam,LPARAM lParam)
{
        switch(wParam)
        {
        case VK_F1:c1();break;
    case VK_F2:c2();break;
        }
        return CallNextHookEx(g,code,wParam,lParam);
}
BOOL WINAPI DllMain(
  HANDLE hinstDLL,
  DWORD dwReason,
  LPVOID lpvReserved
)
{
        switch(dwReason)
        {
        case DLL_PROCESS_ATTACH:
                {
                        SetTimer(NULL,0,800,TIMERPROC(p));
                        DWORD k=GetWindowThreadProcessId(hWnd,NULL);
                        g=SetWindowsHookEx(WH_KEYBOARD,(HOOKPROC)b,GetModuleHandle("CF自动卡BUG.dll"),k);
                        break;
                }
        }
        return 1;
}
void c()
{
        hWnd=FindWindow(NULL,"CrossFire");
        if(hWnd)
        {
                KillTimer(hWnd,0);
        }
}

[注意]传递专业知识、拓宽行业人脉——看雪讲师团队等你加入!

收藏
免费 0
支持
分享
最新回复 (0)
游客
登录 | 注册 方可回帖
返回
//