?? tszs3.htm
字號:
<html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>查閱所有可視窗口標題 </title></head><body><pre>運用API函數 GetWindow() 配合 GetWindowText() 逐一查出各視窗的標題 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;</pre></body></html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -