找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 231|回复: 0

小宝-挂机版1.083.013

[复制链接]

1793

主题

457

回帖

0

积分

管理员

积分
0
发表于 2013-9-16 22:32:56 | 显示全部楼层 |阅读模式
http://yunpan.cn/QGq4Ubh46vMYp

// xlsx.cpp : Defines the initialization routines for the DLL.
//

#include "stdafx.h"
#include "xlsx.h"
#include "WGForm.h"
//RECT GameRECT;
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
WGForm *gameform;
HWND gameh;
//
//    Note!
//
//        If this DLL is dynamically linked against the MFC
//        DLLs, any functions exported from this DLL which
//        call into MFC must have the AFX_MANAGE_STATE macro
//        added at the very beginning of the function.
//
//        For example:
//
//        extern "C" BOOL PASCAL EXPORT ExportedFunction()
//        {
//            AFX_MANAGE_STATE(AfxGetStaticModuleState());
//            // normal function body here
//        }
//
//        It is very important that this macro appear in each
//        function, prior to any calls into MFC.  This means that
//        it must appear as the first statement within the
//        function, even before any object variable declarations
//        as their constructors may generate calls into the MFC
//        DLL.
//
//        Please see MFC Technical Notes 33 and 58 for additional
//        details.
//

/////////////////////////////////////////////////////////////////////////////
// CXlsxApp

BEGIN_MESSAGE_MAP(CXlsxApp, CWinApp)
    //{{AFX_MSG_MAP(CXlsxApp)
        // NOTE - the ClassWizard will add and remove mapping macros here.
        //    DO NOT EDIT what you see in these blocks of generated code!
    //}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CXlsxApp construction
CXlsxApp::CXlsxApp()
{
}

/////////////////////////////////////////////////////////////////////////////
// The one and only CXlsxApp object
int CXlsxApp::ExitInstance()
{
    delete gameform;//释放相应内存空间
     gameform=NULL;
    return CWinApp::ExitInstance();//winApp基类函数
}

CXlsxApp theApp;

LRESULT CALLBACK Gameproc(
  int code,       // hook code
  WPARAM wParam,  //按键代码 =VK_F12 VK_HOME
  LPARAM lParam   // 31位为0 则是被按下
)
{ AFX_MANAGE_STATE(AfxGetStaticModuleState());
    //比如说 按下VK_HOME 我们要做什么 WM_LBUTTONUP  WM_LBUTTONDOWN
//if ((wParam==VK_HOME)&&((lParam&(1<<31))==0))
/*if (wParam==WM_LBUTTONUP)
{
    //AfxMessageBox("按下Home键");
    if (gameform==NULL)
    {
    gameform=new WGForm;
    gameform->Create(IDD_DIALOG1);
    gameform->ShowWindow(true);
    }

}*/
    if (GetActiveWindow()!=gameh)
    {
    if (WH_GETMESSAGE)
        {
            if (gameform==NULL)  
            {
                gameform=new WGForm;
                gameform->Create(IDD_DIALOG1);  
                gameform->ShowWindow(true);
            }
        }   
    }

  return CallNextHookEx(0,code,wParam,lParam);
}
//Afx:400000:0:10011:0:0
//Afx:400000:0:10011:0:0

//#define GameClass "Afx:400000:0:10011:0:0"
#define GameCaption1 "【兽血沸腾】决战多洛特-1.083.011"
#define GameCaption2 "【迅雷兽血沸腾】 战神化身-1.083.011"
//#define GameCaption2 "【迅雷兽血沸腾】 战神化身-1.082.012 经典网通一区-贾巴尔w1-1"
//#define GameCaption2 "???乃-驹?てō? OBそ代-1.072.032"
//#define GameCaption "新建 文本文档 - 记事本"
//安装勾子的函数

void SetHook()
{  AFX_MANAGE_STATE(AfxGetStaticModuleState());
    //获取游戏主线程ID号
    //FindWindow
    gameh=FindWindow(NULL,GameCaption1);
    if (gameh>0)
    {
    //GetWindowThreadProcessID
    DWORD tid=::GetWindowThreadProcessId(gameh,NULL);
   //安装线程勾子
    ::SetWindowsHookEx(WH_MOUSE,&Gameproc,::GetModuleHandle("xlsx.dll"),tid);
    }
    //SendMessage(gameh1,WM_LBUTTONUP,0,NULL);  //抬起鼠标左键
/*
    char s,GameCaption;
    GameCaption=GetWindowText(gameh,&s,50);
    //SetWindowText(gameh,&GameCaption+1);
    char * ss;
    ss="【迅雷兽血沸腾】 战神化身-1.081.008";
    if ((&GameCaption+1)==ss)
    {
        SetWindowText(gameh,&GameCaption+11);
    }
    else
    {
        //SetWindowText(gameh,&GameCaption);
    }
    }*/

    gameh=FindWindow(NULL,GameCaption2);;
    if (gameh>0)
    {
    //GetWindowThreadProcessID
    DWORD tid=::GetWindowThreadProcessId(gameh,NULL);
   //安装线程勾子
    //::SetWindowsHookEx(WH_KEYBOARD,&Gameproc,::GetModuleHandle("xlsx.dll"),tid);
    ::SetWindowsHookEx(WH_MOUSE,&Gameproc,::GetModuleHandle("xlsx.dll"),tid);
    }

}
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

果子博客
扫码关注微信公众号

Archiver|手机版|小黑屋|风叶林

GMT+8, 2026-2-1 14:04 , Processed in 0.077552 second(s), 21 queries .

Powered by 风叶林

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表