我将你的代码略加修改(请先启动'记事本'),我试验过了,没问题:<br>procedure TForm1.Button1Click(Sender: TObject);<br>var<br> H:HWND;<br>begin<br> H:=FINDWINDOW(NIL,'未定标题 - 记事本');<br> IF H=0<br> THEN Showmessage('Can''t find!')<br> //shellexecute(handle,nil,pchar(INI.ReadString('TOOLS','SJJZ','')),nil,nil,0)<br> ELSE BEGIN<br> H:=FINDWINDOW(NIL,'未定标题 - 记事本');<br> SHOWWINDOW(H,SW_Hide);<br> SHOWWINDOW(H,SW_ShowDefault);<br> END;<br>end;<br>