两个问题(大虾级问题)如果您是大虾的话,请回答。谢谢。(20分)

  • 主题发起人 主题发起人 Delphi1998
  • 开始时间 开始时间
D

Delphi1998

Unregistered / Unconfirmed
GUEST, unregistred user!
1.如何在我的程序运行期间禁止其它我指定的程序的运行。<br>&nbsp; 例如:禁止Regedit注册表和Winmine.exe程序的运行<br><br>2.如何Kill自己在内存中的进程当进行“关闭所有程序并以其他用户身份登 &nbsp; 录”操作后?<br>&nbsp; <br>谢谢各位大虾。
 
禁止Regedit注册表和Winmine.exe程序的运行.<br>1.检查要禁止运行的程序有没有运行,if 有 then kill(postmessage) it ! <br>2.检查REGEDIT.EXE和WINMINE.EXE文件xxxx:xxxx出是否写入特定的信息,<br>&nbsp;if false then 将写入一些(在xxxx:xxxx写入内容)<br>3.退出时再还原xxxx:xxxx处的内容.<br>&lt;big&gt;&lt;big&gt;如何Kill自己在内存中的进程当进行“关闭所有程序并以其他用户身份登录”操作后&lt;/big&gt;&lt;/big&gt;<br>var han:HWND;<br>begin <br>&nbsp; &nbsp;Han:=FindWindow('TForm1','Form1');<br>&nbsp; &nbsp;if Han &lt;&gt; 0 then <br>&nbsp; &nbsp;begin <br>&nbsp; &nbsp; ShowMessage(Han,WM_QUIT,0,0); &nbsp;<br>&nbsp; &nbsp;end;<br>end;<br>
 
<br>在介绍一种&lt;big&gt;&lt;big&gt;&lt;Font color=red&gt;kill&lt;/big&gt;&lt;/big&gt;&lt;/font&gt;方法:<br>var &nbsp;pTask &nbsp; : PTaskEntry; &nbsp;<br>&nbsp; &nbsp; &nbsp;Task &nbsp; &nbsp;: Bool; &nbsp;<br>&nbsp; &nbsp; &nbsp;ThisTask: THANDLE;<br>begin<br>&nbsp; &nbsp;GetMem (pTask, SizeOf (TTaskEntry)); &nbsp;<br>&nbsp; &nbsp;pTask^.dwSize := SizeOf (TTaskEntry);<br>&nbsp; &nbsp;Task := TaskFirst (pTask); &nbsp;<br>&nbsp; &nbsp;while Task do &nbsp;<br>&nbsp; &nbsp;begin<br>&nbsp; &nbsp; &nbsp;if pTask^.hInst = hInstance then &nbsp; &nbsp; &nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp;ThisTask := pTask^.hTask &nbsp; &nbsp;<br>&nbsp; &nbsp; &nbsp;else<br>&nbsp; &nbsp; &nbsp; &nbsp;TerminateApp (pTask^.hTask, NO_UAE_BOX); &nbsp; &nbsp;<br>&nbsp; &nbsp; &nbsp;Task := TaskNext (pTask);<br>&nbsp; &nbsp;end; &nbsp;<br>&nbsp; &nbsp;TerminateApp (ThisTask, NO_UAE_BOX);<br>end;<br>
 
斑竹:<br>&nbsp; &nbsp;您好!<br>&nbsp; &nbsp;不知道为什么论坛上不去,请帮我将帖子贴在"....大虾的问题....."<br>好象是问如何在一个程序运行的时候防止regedit.exe一类程序运行的帖子<br><br>var &nbsp;pTask &nbsp; : PTaskEntry; <br>&nbsp; &nbsp; &nbsp;Task &nbsp; &nbsp;: Bool; &nbsp;<br>&nbsp; &nbsp; &nbsp;ThisTask: THANDLE;<br>begin <br>&nbsp; GetMem (pTask, SizeOf (TTaskEntry)); &nbsp;<br>&nbsp; pTask^.dwSize := SizeOf(TTaskEntry); &nbsp;<br>&nbsp; Task := TaskFirst (pTask);<br>&nbsp; while Task do &nbsp;<br>&nbsp; begin &nbsp; &nbsp;<br>&nbsp; &nbsp; &nbsp;if pTask^.hInst = hInstance then &nbsp; &nbsp; &nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp;ThisTask :=pTask^.hTask &nbsp; &nbsp;<br>&nbsp; &nbsp; &nbsp;else &nbsp; &nbsp; &nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp;TerminateApp (pTask^.hTask, NO_UAE_BOX); &nbsp; &nbsp;<br>&nbsp; &nbsp; &nbsp;Task := TaskNext (pTask); &nbsp; <br>&nbsp; end; &nbsp;<br>&nbsp; TerminateApp (ThisTask, NO_UAE_BOX);<br>end;<br>&nbsp; <br>唐晓锋<br>98/11/24
 
&lt;font color=blue&gt;谢谢斑竹!&lt;/font&gt;我又能上来了!
 
TerminateApp是那里定义的?
 
PTaskEntry,TerminateApp,TaskFirst,TaskNext是那里定义的?程序编译出错.
 
这个例子是刚刚从什么地方拉回来的*_-
 
还有人吗?
 
DELPHHI1998:<br>抱歉,这个例子还没通过!你能用了吗?<br>能用的时候别忘了通知我!谢谢!<br>安老方法做应该可以,要我帮忙通知我&lt;a href="mailto:xfang@shtdu.edu.cn"&gt;xftang@shtdu.edu.cn&lt;/a&gt;<br>
 
大虾级的问题就值这么点分!*_?
 
因为是大虾,所以不会计较分数的多少。<br><br>还有人吗?
 
实际上这些答案都只是终止这些程序,要想不让这些程序运行,必须做一个系统钩子,进行过滤.
 
又是钩子,你有例子吗?<br>&lt;A HREF="MAILTO:XFTANG@SHTDU.EDU.CN"&gt;XFTANG@SHTDU.EDU.CN&lt;/A&gt;<br>谢谢!<br>
 
接受答案了.
 
后退
顶部