任務欄上各控件句柄:<br>procedure TForm1.Button1Click(Sender: TObject);<br>var handle1,handle2:thandle;<br> str,str1:array [0..225] of char;<br>begin<br> handle1:=findwindow('Shell_TrayWnd',nil);<br> if handle1<>0 then<br> handle2:=GetWindow(handle1,GW_CHILD);<br> if handle2<>0 then<br> begin<br> getwindowtext(handle2,str,225);<br> getclassname(handle2,str1,225);<br> listbox1.Items.Add(inttostr(handle2)+' 標題:'+str+' 類名:'+str1);<br> while handle2<>0 do<br> begin<br> handle2:=GetWindow(handle2,GW_HWNDNEXT);<br> if handle2<>0 then<br> begin<br> getwindowtext(handle2,str,225);<br> getclassname(handle2,str1,225);<br> listbox1.Items.Add(inttostr(handle2)+' 標題:'+str+' 類名:'+str1);<br> end;<br> end;<br> end;<br><br>end;<br>