79.游戏分析工具闪屏问题优化与数据被修改高亮

免责声明:内容仅供学习参考,请合法利用知识,禁止进行违法犯罪活动!

内容参考于:易道云信息技术研究院

上一个内容:78.游戏分析工具解析结果
以 78.游戏分析工具解析结果 它的代码为基础进行修改

完整代码地址:下载名为:GAMEHACKER2.zip

链接:https://pan.baidu.com/s/17_aXbMCyexGIlP3Yz_ajIA

提取码:ilbw

--来自百度网盘超级会员V4的分享

添加列表绘制事件

CwndRAN.cpp文件的修改

BOOL CwndRAN::OnInitDialog()
{
    CDialogEx::OnInitDialog();

    LONG_PTR lStyle;
    // 得到窗口的样式,GWL_STYLE在GetWindowLongPtr说明中有
    lStyle = GetWindowLongPtr(LstData.m_hWnd, GWL_STYLE);
    lStyle |= LVS_REPORT;
    SetWindowLongPtr(LstData.m_hWnd, GWL_STYLE, lStyle);

    DWORD dStyle = LstData.GetExtendedStyle();
    dStyle |= LVS_EX_FULLROWSELECT;
    dStyle |= LVS_EX_GRIDLINES;
    LstData.SetExtendedStyle(dStyle);

    LstData.InsertColumn(0, L"内存地址", 0, 200);
    LstData.InsertColumn(1, L"偏移", 0, 200);
    LstData.InsertColumn(2, L"类型", 0, 200);
    LstData.InsertColumn(3, L"名称", 0, 200);
    LstData.InsertColumn(4, L"值", 0, 200);
    LstData.InsertColumn(5, L"注释", 0, 200);
    LstData.InsertColumn(6, L"显示类型", 0, 400);
    InitDataTypeTable();
    // ::表示全局命名空间,::SetTimer();表示使用全局命名空间里的 SetTimer 函数
     ::SetTimer(this->m_hWnd, 700000, 3000, ReadData);
    
    return TRUE;
}
void CwndRAN::OnAnlClass()
{
    auto hSel = mTree.GetSelectedItem();
    auto hRoot = mTree.GetRootItem();
    if (hSel == hRoot)return;
    auto h = GetFirstItem(hSel);
    if (h) {
        auto obj = GetOBJPtr(h);
        if (obj) {
            if (CurOBJ != obj) {
                LstData.DeleteAllItems();
            }
            CurOBJ = obj;
            ReadData(0, 0, 10002, 0);
        }
    }
}
void CwndRAN::SHOWMemContext()
{
    if (!CurOBJ)return;
     //FALSE表示插入数据的时候是数据层面不会进行显示
     LstData.SetRedraw(FALSE);

     
    int LstCount = LstData.GetItemCount();
    int icount = 0;

    LPVOID _address = CurOBJ->GetMemAddress();
    
    PCMEMContext _mcontext = CurOBJ->MEMContext;
    
    while (_mcontext) {
    
        int length = _mcontext->lenth;
        for (int i = 0; i < length; i++)
        {
            DWORD_PTR adr = (DWORD_PTR)_address + _mcontext->offset;
            CString txt, offset, name, val, oldval;
            txt.Format(L"0x%X", adr + i*_mcontext->type->Size);
            offset.Format(L"0x%X", _mcontext->offset + i * _mcontext->type->Size);

            if (length > 1) name.Format(L"%s[%d]", _mcontext->txtName, i);
            else name.Format(L"%s", _mcontext->txtName);
            
            val = CurOBJ->ReadValue(_mcontext, i);

            if(LstCount) 
                LstData.SetItemText(icount, 0, txt); 
            else 
                LstData.InsertItem(icount, txt);
        
            LstData.SetItemText(icount, 1, offset);
            LstData.SetItemText(icount, 2, _mcontext->type->UName);
            LstData.SetItemText(icount, 3, name);

            oldval = LstData.GetItemText(icount, 4);
            if (oldval != val) {
                LstData.SetItemText(icount, 4, val);
                LstData.SetItemData(icount, 1);
            }
            else {
                LstData.SetItemData(icount, 0);
            }

        
            LstData.SetItemText(icount++, 5, _mcontext->txtNote);
        }
        _mcontext = _mcontext->Next;
    }
     //TRUE表示把修改过的数据显示出来
    LstData.SetRedraw(TRUE);
}

void CwndRAN::OnNMCustomdrawList1(NMHDR* pNMHDR, LRESULT* pResult)
{
    LPNMCUSTOMDRAW pNMCD = reinterpret_cast<LPNMCUSTOMDRAW>(pNMHDR);
    // TODO: 在此添加控件通知处理程序代码
    *pResult = 0;
    NMLVCUSTOMDRAW* lp = (NMLVCUSTOMDRAW*)pNMHDR;
    auto& cmd = lp->nmcd;
    switch (cmd.dwDrawStage)
    {
    case CDDS_PREPAINT: {
        *pResult = CDRF_NOTIFYITEMDRAW;
        break;
    }
    case CDDS_ITEMPREPAINT: {
        DWORD dIndex = LstData.GetItemData(cmd.dwItemSpec);
        COLORREF color[2]{ RGB(0,0,0),RGB(255,0,0)};
        //COLORREF colorBK[3]{ RGB(255,255,0),RGB(0,255,0), RGB(255, 192, 203) };
        // 列表字体颜色
        lp->clrText = color[dIndex];
        //lp->clrTextBk = colorBK[dIndex];
    }
    default:
        break;
    }
}

  • 4
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
使用`window.location.href`可以实现页面跳转。当你将一个新的URL赋值给`window.location.href`时,浏览器会加载该URL对应的页面,并在当前窗口中显示。 要实现闪屏效果,你可以在跳转之前先显示一个闪屏页面,然后再跳转到目标页面。以下是一个简单的示例代码: ```javascript // 显示闪屏页面 function showSplashScreen() { // 在页面中创建一个元素,用于显示闪屏内容 var splashScreen = document.createElement('div'); splashScreen.style.width = '100%'; splashScreen.style.height = '100%'; splashScreen.style.backgroundColor = 'white'; splashScreen.style.display = 'flex'; splashScreen.style.justifyContent = 'center'; splashScreen.style.alignItems = 'center'; // 在闪屏页面中添加一些内容,比如加载动画或者公司logo等 splashScreen.innerHTML = '<h1>Loading...</h1>'; // 将闪屏页面添加到body元素中 document.body.appendChild(splashScreen); } // 跳转到目标页面 function redirectToTargetPage() { // 显示闪屏页面 showSplashScreen(); // 延时一段时间后跳转到目标页面 setTimeout(function() { window.location.href = '目标页面的URL'; }, 2000); // 延时2秒钟,可以根据需要调整时间 } // 调用函数实现跳转闪屏效果 redirectToTargetPage(); ``` 在上面的代码中,`showSplashScreen`函数用于显示闪屏页面,你可以根据需要自定义闪屏页面的样式和内容。`redirectToTargetPage`函数用于跳转到目标页面,其中通过`setTimeout`函数设置了一个延时,延时结束后会将`window.location.href`设置为目标页面的URL,实现页面跳转。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值