Delphi獲取其它程序的狀態欄文本內容,在這裡寫成了一個Delphi函數,歡迎大家使用,學習Delphi的,希望與你共同學習進步:
01
function
GetStatusBarText(mHandle: THandle):
string
;
02
var
03
vBuffer:
array
[
0
..
$1000
]
of
Char
04
vSize:
Integer
05
I:
06
vCount:
07
vProcessId: DWord;
08
vProcess: THandle;
09
vPointer:
Pointer
10
vNumberOfBytesRead:
Cardinal
11
begin
12
Result :=
''
13
vCount := SendMessage(mHandle, SB_GETPARTS,
,
);
14
if
vCount <=
then
Exit;
15
GetWindowThreadProcessId(mHandle, @vProcessId);
16
vProcess := OpenProcess(PROCESS_VM_OperaTION
or
PROCESS_VM_READ
17
PROCESS_VM_WRITE,
False
, vProcessId);
18
vPointer := VirtualAllocEx(vProcess,
nil
, MEM_RESERVE
MEM_COMMIT,
19
PAGE_READWRITE);
20
try
21
for
I :=
to
vCount -
1
do
22
23
vSize := SendMessage(mHandle, SB_GETTEXT, I,
) +
24
SendMessage(mHandle, SB_GETTEXT, I,
(vPointer));
25
ReadProcessMemory(vProcess, vPointer, @vBuffer[
],
26
vSize, vNumberOfBytesRead);
27
Result := Result + #
9
+ vBuffer;
28
end
29
Delete(Result,
30
finally
31
VirtualFreeEx(vProcess, vPointer,
, MEM_RELEASE);
32
CloseHandle(vProcess);
33
34
{相關結構:} TDSFXWavesReverb = pa
最小傷害 題解,傷害題解【問題描述】 把兒站在一個NxN的方
Delphi下OpenGL2d繪圖(05)-畫圖片Bmp,一
本例效果圖:代碼文件:unit Unit1;i
制作過程:先添加一個 TCategoryPan