试试这个:var HCurrentWindow:hwnd; sztext:array[0..254] Of char; label label1; begin hCurrentWindow:=getwindow(handle,gW_HWnDFirst); while hCurrentWindow<>0 do begin if getWindowtext(hCurrentWindow,@szText,255)>0 then if (trim(strpas((@szText)))='M') or (strpas(@szText)='Default IME')or (strpas(@szText)='SysFader') then goto label1; if (trim(strpas((@szText)))<>'')then Listbox1.Items.Append(strpas(@szText)); label1: hCurrentWindow:=getWindow(hCurrentWindow,Gw_Hwndnext); end; end;
http://expert.csdn.net/Expert/topic/2651/2651029.xml?temp=.3517572
sztext:array[0..254] Of char;
label label1;
begin
hCurrentWindow:=getwindow(handle,gW_HWnDFirst);
while hCurrentWindow<>0 do
begin
if getWindowtext(hCurrentWindow,@szText,255)>0 then
if (trim(strpas((@szText)))='M') or (strpas(@szText)='Default IME')or (strpas(@szText)='SysFader') then
goto label1;
if (trim(strpas((@szText)))<>'')then
Listbox1.Items.Append(strpas(@szText));
label1: hCurrentWindow:=getWindow(hCurrentWindow,Gw_Hwndnext);
end;
end;