挖井

类库大魔王的挖井日记

挖一口属于自己的井


编程读取其它进程中StatusBar的内容

void __fastcall TMainForm::GetStatusBarContent()
{
        //TODO: Add your source code here
    int nItemCount;
    int i;
    char chBuffer[256];
    DWORD dwProcessID;
    HANDLE hProcess;
    void * Pointer;
    SIZE_T nNumberOfBytesRead;
   
    nItemCount = SendMessage(hWindow, SB_GETPARTS, 0, 0);
    GetWindowThreadProcessId(hWindow, &dwProcessID);
    hProcess = OpenProcess(PROCESS_VM_OPERATION | PROCESS_VM_READ | PROCESS_VM_WRITE,
                    false,
                    dwProcessID);
    Pointer = VirtualAllocEx(hProcess,
                            NULL,
                            4096,
                            MEM_RESERVE | MEM_COMMIT,
                            PAGE_READWRITE);
    try{
    for(i= 0 ; i < nItemCount ; ++i)
    {
       SendMessage(hWindow, SB_GETTEXT, i, (LPARAM)Pointer);
       ReadProcessMemory(hProcess,
                    Pointer,
                    chBuffer,
                    sizeof(chBuffer),
                    &nNumberOfBytesRead);
       ContentMemo->Lines->Add(chBuffer);
    }//for(i...
    }//try
    __finally
    {
      VirtualFreeEx(hProcess,
                    Pointer,
                    0,
                    MEM_RELEASE);
      CloseHandle(hProcess);
    }
}

本文地址:

https://minidump.info/blog/2005/02/E7-BC-96-E7-A8-8B-E8-AF-BB-E5-8F-96-E5-85-B6-E5-AE-83-E8-BF-9B-E7-A8-8B-E4-B8-ADStatusBar-E7-9A-84-E5-86-85-E5-AE-B9/

感觉本文不错,不妨小额鼓励我一下!
上一篇

编程读取其它进程中ListView的内容

void __fastcall TMainForm::GetListViewContent(){ //TODO: Add your source code here //* int nColumnCount; int nItemCount; int i,j...…

imported from CSDN 全文阅读
下一篇

编程读取其它进程中SysHeader的内容

void __fastcall TMainForm::GetHeaderContent(){ //TODO: Add your source code here int nItemCount; int i; char chBuffer[256]; DWOR...…

imported from CSDN 全文阅读