var
hCurrentWindow:HWND;
szText:array [0..254] of char;
begin
hCurrentWindow := GetWindow (Handle ,GW_HWNDFIRST);
if GetWindowText (hCurrentWindow ,@szText,255) >0 then
ListBox1.Items.Add (inttostr(hCurrentWindow));
while hCurrentWindow <> 0 do
begin
if GetWindowText (hCurrentWindow ,@szText,255) >0 then
ListBox1.Items.Add (inttostr(hCurrentWindow));
hCurrentWindow := GetWindow (hCurrentWindow ,GW_HWNDNEXT);
end;
end;
hCurrentWindow:HWND;
szText:array [0..254] of char;
begin
hCurrentWindow := GetWindow (Handle ,GW_HWNDFIRST);
if GetWindowText (hCurrentWindow ,@szText,255) >0 then
ListBox1.Items.Add (inttostr(hCurrentWindow));
while hCurrentWindow <> 0 do
begin
if GetWindowText (hCurrentWindow ,@szText,255) >0 then
ListBox1.Items.Add (inttostr(hCurrentWindow));
hCurrentWindow := GetWindow (hCurrentWindow ,GW_HWNDNEXT);
end;
end;
解决方案 »
- 大家谁知道cxgrid怎么汉化?
- 【技巧】给你一个窗口的句柄,能让它的关闭按钮失效吗?
- 请高手教一下怎样取得一个服务器下所有数据库的名字?100分送,来者有分
- 我想实现如下功能,如果谁会我可以掏钱的。(人民币,请报价。)
- 恭喜menggirl上任,放200
- 提四个简单的问题,100分送上。
- 自己做的Dll文件,有的可以运行,有的出现http500错误(asp运行正常)
- 请教关于数据库的简单问题
- delphi6+paradox的程序利用自带的install发布的时候,怎样来进行别名的设置呢?
- [?]!!!!!!!关于定时自动拨号的问题!!!!!!!!!
- 如何知道参数个数和类型
- d6中如何在用SQL语句增加记录时让时间字段的值为空?用null通不过。
可以获得打开程序窗体名,及其句柄等
type
EnumWindowsProc = function (Hwnd: THandle;
Param: Pointer): Boolean; stdcall;function GetTitle (Hwnd: THandle; Param: Pointer): Boolean; stdcall;
var
Text: string;
begin
SetLength (Text, 100);
GetWindowText (Hwnd, PChar (Text), 100);
FormCallBack.ListBox1.Items.Add (
IntToStr (Hwnd) + ': ' + Text);
Result := True;
end;procedure TFormCallback.BtnTitlesClick(Sender: TObject);
var
EWProc: EnumWindowsProc;
begin
ListBox1.Items.Clear;
EWProc := GetTitle;
EnumWindows (@EWProc, 0);
end;
hCurrentWindow:HWND;
szText:array [0..254] of char;
begin
hCurrentWindow := GetWindow (Handle ,GW_HWNDFIRST);
if GetWindowText (hCurrentWindow ,@szText,255) >0 then
ListBox1.Items.Add (inttostr(hCurrentWindow)+':'+strpas(@szText));
while hCurrentWindow <> 0 do
begin
if GetWindowText (hCurrentWindow ,@szText,255) >0 then
ListBox1.Items.Add (inttostr(hCurrentWindow)+':'+strpas(@szText));
hCurrentWindow := GetWindow (hCurrentWindow ,GW_HWNDNEXT);
end;
end;
netlib(河外孤星) :你的那个例子是得到系统里所有运行的进程了吧。