?? 運用api函數 getwindow() 配合 getwindowtext().txt
字號:
運用API函數 GetWindow() 配合 GetWindowText() 逐一查出各視窗的標題 (2000年12月29日)
網友更新 分類:數據庫 作者: maming(推薦) 推薦:maming 閱讀次數:507
(http://www.codesky.net)
--------------------------------------------------------------------------------
1. File | New Project 開始一個新的工程
2. 在 Form1 中安排 Button 與 Memo 各一
3. 在 Button1 的 OnClick 事件中撰寫程式如下:
procedure TForm1.Button1Click(Sender: TObject);
var
hCurrentWindow: HWnd;
szText: array[0..254] of char;
begin
hCurrentWindow := GetWindow(Handle, GW_HWNDFIRST);
while hCurrentWindow <> 0 do
begin
if GetWindowText(hCurrentWindow, @szText, 255) > 0 then
Memo1.Lines.Add(StrPas(@szText));
hCurrentWindow := GetWindow(hCurrentWindow, GW_HWNDNEXT);
end;
end;
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -