关于进程的显示,请大家帮帮我(100分)

  • 主题发起人 主题发起人 colacoca
  • 开始时间 开始时间
C

colacoca

Unregistered / Unconfirmed
GUEST, unregistred user!
用:<br>procedure Tform1.ProcessList(); &nbsp; &nbsp;//察看进程的过程<br>var<br>&nbsp; lppe: TProcessEntry32;<br>&nbsp; found : boolean;<br>&nbsp; Hand : THandle;<br>begin<br>&nbsp; &nbsp; &nbsp; &nbsp; ListBox1.Items.Clear;<br>&nbsp; &nbsp; &nbsp; &nbsp; Hand := CreateToolhelp32Snapshot(TH32CS_SNAPALL,0);<br>&nbsp; &nbsp; &nbsp; &nbsp; found := Process32First(Hand,lppe);<br>&nbsp; &nbsp; &nbsp; &nbsp; while found do<br>&nbsp; &nbsp; &nbsp; &nbsp; begin<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ListBox1.Items.Add(StrPas(lppe.szExeFile));//列出所有进程。<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; found := Process32Next(Hand,lppe);<br>&nbsp; &nbsp; &nbsp; &nbsp; end;<br>end;<br>可以在程序中显示进程<br>但是现在出了一个问题,如果是服务端被客户端调用上面的过程的话,则显示不了进程,为什么???怎么解决?????<br>具体例子:<br>客户段发送请求: &nbsp;ClientSocket1.Socket.SendText('A');<br>服务端接到请求,并对请求进行处理:<br>procedure TForm1.ServerSocket1ClientRead(Sender: TObject;<br>&nbsp; Socket: TCustomWinSocket);<br>var<br>Data: &nbsp;String;<br>begin<br>&nbsp; &nbsp; &nbsp; &nbsp; Data:=Socket.ReceiveText;<br>&nbsp; &nbsp; &nbsp; &nbsp; Edit1.Text:='收到字符:'+Data;<br>&nbsp; &nbsp; &nbsp; &nbsp; ProcessList(); &nbsp;//调用察看进程的过程<br>end;<br><br>进程没有在listbox1中显示,但是在服务端直接用Button调用,进程则能在listbox1中显示:<br>procedure TForm1.Button1Click(Sender: TObject);<br>begin<br>&nbsp; &nbsp; &nbsp; &nbsp; ProcessList(); &nbsp;//调用察看进程的过程<br>end;<br><br>请大家帮我解决一下.
 
如果对这个问题感兴趣,我可以发例子给你,共357k<br><br>请大家帮帮我!
 
要列线程
 
我也正在做类型的工具,请发一份给我好吗!<br>thanks<br>Alan.hu@netease.com
 
我对此很感兴趣,请发一份给我,我们共同研究<br>谢谢<br>sunlin@cy4.dq.cnpc.com.cn
 
我编译时出错,不认识TProcessEntry32类型,请问应加上那些units?<br>sunlin@cy4.dq.cnpc.com.cn<br>&nbsp;
 
我要:woho@Yesky.com
 
uses TlHelp32;
 
请给我一份关于进程的显示,谢谢<br>yjh@tomore.com
 
我也要一份,谢谢<br><br>lql@1000box.com
 
我也要一份,谢谢<br><br>xzl@swufe.edu.cn
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
后退
顶部