| functionEnumProc( hot007.com h:HWND;//handleofchildwindow l:integer//application-definedvalue ):boolean;stdcall; varbuf:array[0..255]ofchar; begin GetWindowText(h,buf,sizeof(buf)-1); ifiswindowvisible(h)then Form1.ListBox1.items.add ('' strpas(buf) ':' inttostr(h)) else Form1.ListBox1.items.add ('-' strpas(buf) ':' inttostr(h)); Result:=true; end; procedureTForm1.Fresh1; begin ListBox1.clear; enumChildwindows(Panel2.handle, TFNWndEnumProc(@enumproc),0); end; |
| procedureTForm1.Hide1Click(Sender:TObject); varh:integer; s:string; begin ifListBox1.itemindex=-1thenexit; s:=Listbox1.items[ListBox1.itemindex]; h:=strtoint(copy(s,pos(':',s) 1,length(s))); 复制于jc567.cn ShowWindow(h,SW_HIDE); Fresh1; end; |
| procedureTForm1.Show1Click(Sender:TObject); varh:integer; s:string; begin ifListBox1.itemindex=-1thenexit; s:=Listbox1.items[ListBox1.itemindex]; h:=strtoint(copy(s,pos(':',s) 1,length(s))); ShowWindow(h,SW_SHOW); Fresh1; end; |
| procedureTForm1.Close1Click(Sender:TObject); varh:integer; s:string; begin ifListBox1.itemindex=-1thenexit; s:=Listbox1.items[ListBox1.itemindex]; h:=strtoint(copy(s,pos(':',s) 1,length(s))); PostMessage(h,WM_QUIT,0,0); Fresh1; end; |