console application形式的程式取得視窗列表 |
答題得分者是:christie
|
duckegg
一般會員 發表:4 回覆:0 積分:0 註冊:2008-12-17 發送簡訊給我 |
|
christie
資深會員 發表:30 回覆:299 積分:475 註冊:2005-03-25 發送簡訊給我 |
Try it !
program console1; {$APPTYPE CONSOLE} uses SysUtils,windows, Messages, Controls, Forms; var HCurrentWindow: HWND; szText: array[0..254] of char; begin HCurrentWindow := GetForegroundWindow(); while HCurrentWindow <> 0 do begin if GetWindowText(HCurrentWindow, @sztext, 255) > 0 then writeln(Strpas(@szText)); HCurrentWindow := GetWindow(HCurrentWindow, GW_HwndNext); end; end. ===================引 用 duckegg 文 章=================== 我有一個程式需要取得WINDOWS現在所有執行的程式名稱, 目前參考 http://delphi.ktop.com.tw/board.php?cid=16&fid=43&tid=18901 可以做出我要的效果, 但是如果我想把程式改成console application的方式, GetWindow無法取得其他視窗的資訊, 不知道要怎麼修改才有辦法運作?
------
What do we live for if not to make life less difficult for each other? |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |