Home > Back-end >  DELPHI how to read the content within the container class controls external program?
DELPHI how to read the content within the container class controls external program?

Time:09-26

Everyone a great god, and I want to use the DELPHI programming read on the external program container class controls the content inside, the inside of the external program status bar control, for example, the following is a network, but vcount=0, acquisition is not successful, hope to get your help,

The function GetStatusBarText (mHandle: THandle) : string;
Var
VBuffer: an array of Char [0.. $1000];
VSize: Integer;
I: Integer;
VCount: Integer;
VProcessId: DWORD;
VProcess: THandle;
VPointer: Pointer;
VNumberOfBytesRead: Cardinal;
The begin
Result:=';
VCount:=SendMessage (mHandle SB_GETPARTS, 0, 0).
If vCount & lt;=0 then the Exit;
GetWindowThreadProcessId (mHandle, @ vProcessId);
VProcess:=OpenProcess (PROCESS_VM_OPERATION or PROCESS_VM_READ or
PROCESS_VM_WRITE, False, vProcessId);
VPointer:=VirtualAllocEx (vProcess, nil, $1000, MEM_RESERVE or MEM_COMMIT,
PAGE_READWRITE);
Try
For I:=0 to do vCount - 1
The begin
VSize:=SendMessage (mHandle SB_GETTEXT, I, 0) + 1;
SendMessage (mHandle SB_GETTEXT, I, an Integer (vPointer));
ReadProcessMemory (vProcess vPointer, @ vBuffer [0],
VSize, vNumberOfBytesRead);
Result: the Result +=# 9 + vBuffer;
end;
Delete (Result, 1, 1);
The finally
VirtualFreeEx (vProcess vPointer, 0, MEM_RELEASE);
The CloseHandle (vProcess);
end;
end;

CodePudding user response:

Msctls_statusbar32 controls

CodePudding user response:





The status bar is a derived class msctls_statusbar32 controls

CodePudding user response:

External program isn't Delphi?

CodePudding user response:

Delphi programming for Delphi programming software, easy to obtain, the other is not very good,

CodePudding user response:

The other program is made of VC
  • Related