To Another_eYes:<br>让我明白很多了,太感谢了,前几天我一直在纳闷这是什么回事呢?<br><br>还有一个问题:<br>我在用EnumThreadWindows枚举窗口句柄时的问题:<br><br>function Nokia_EnumWindowsFunc(Handle: THandle;lparam: Longint) : boolean ; stdcall; //回调函数<br>var<br> title:array[0..254] of Char;<br>begin<br> Nokia_winhandlenum := Nokia_winhandlenum + 1;<br> Nokia_winhandles[Nokia_winhandlenum].handle := handle;<br> try<br> if GetWindowText(Handle,title,250) <> 0 then<br> Nokia_winhandles[Nokia_winhandlenum].title := title;<br> except;<br> end;<br> Result :=True; <br>end;<br><br>procedure TForm1.Button2Click(Sender: TObject);<br>var<br> sdhfilename:String;<br>begin<br> lct_sinfo :TSTARTUPINFO;<br> lct_pinfo :TPROCESSINFORMATION;<br> lct_sinfo.cb := Sizeof(StartupInfo);<br> lct_sinfo.lpReserved := 0;<br> lct_sinfo.lpDesktop := 0;<br> lct_sinfo.dwX:=0;<br> lct_sinfo.dwY:=0;<br> lct_sinfo.dwXSize:=800;<br> lct_sinfo.dwYSize:=800;<br> lct_sinfo.dwFlags := STARTF_USEPOSITION or STARTF_USESIZE;<br> lct_sinfo.cbReserved2 := 0;<br> lct_sinfo.lpReserved2 := 0;<br> LockWindowUpdate(GetDesktopWindow());<br> sdhfilename := 'c:/Project1.exe';<br> if not CreateProcess(nil,<br> pchar(sdhfilename),<br> nil,<br> nil,<br> false,<br> HIGH_PRIORITY_CLASS,<br> nil, <br> nil,<br> lct_sinfo,<br> lct_pinfo) then<br> begin<br> exit;<br> end ;<br> LockWindowUpdate(0);<br> Sleep(1000);<br> Nokia_winhandlenum := 0;<br> EnumThreadWindows(lct_pinfo.dwThreadId,@Nokia_EnumWindowsFunc,0); //枚举启动<br>//的窗口句柄。<br>end;<br><br>但用上面的函数我枚举出来的窗口句柄有很多个,我查看了一下,有7,8个,我启动的就是一个窗口,怎么有这么多的窗口句柄呢?<br><br>