如何使程序运行时,按“ctrl+alt+del”在程序列表框中不显示该程序的名称(100分)

  • 主题发起人 主题发起人 fxb2000
  • 开始时间 开始时间
F

fxb2000

Unregistered / Unconfirmed
GUEST, unregistred user!
如何使程序运行时,按“ctrl+alt+del”在程序列表框中不显示该程序的名称
 
(C++ Builder 的代码)<br>把你的应用程序从CTRL-ALT-DEL对话框中隐藏的一个简单办法是去应用程序的标题。如果一个程序的主窗口没以标题,Windows95不把它放到CTRL-ALT-DEL对话框中。清除标题属性的最好地方是在WinMain函数里。<br><br>WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)<br>{<br>&nbsp; &nbsp; try<br>&nbsp; &nbsp; {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Application-&gt;Title = " ";<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Application-&gt;Initialize();<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Application-&gt;CreateForm(__classid(TForm1), &amp;Form1);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Application-&gt;Run();<br>&nbsp; &nbsp; }<br>&nbsp; &nbsp; catch (Exception &amp;exception)<br>&nbsp; &nbsp; {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Application-&gt;ShowException(&amp;exception);<br>&nbsp; &nbsp; }<br>&nbsp; &nbsp; return 0;<br>}<br>另一种方法是:调用RegisterServiceProcess API 函数将程序注册成为一个服务模式程序。 RegisterServiceProcess是一个在Kernel32.dll里相关但无正式文件的函数。在MS SDK头文件里没有该函数的原型说明,但在Borland import libraries for C++ Builder里能找到。很显然,这个函数的主要目的是创建一个服务模式程序。之所以说很显然,是因为MSDN里实质上对这个函数没有说什么。<br><br>下面的例子代码演示了在Windows95/98下怎样通过使用RegisterServiceProcess来把你的程序从CTRL-ALT-DEL对话框中隐藏起来。<br><br>//------------Header file------------------------------<br>typedef DWORD (__stdcall *pRegFunction)(DWORD, DWORD);<br>&nbsp;<br>class TForm1 : public TForm<br>{<br>__published:<br>&nbsp; &nbsp; TButton *Button1;<br>private:<br>&nbsp; &nbsp; HINSTANCE hKernelLib;<br>&nbsp; &nbsp; pRegFunction RegisterServiceProcess;<br>public:<br>&nbsp; &nbsp; __fastcall TForm1(TComponent* Owner);<br>&nbsp; &nbsp; __fastcall ~TForm1();<br>};<br>&nbsp;<br>&nbsp;<br>//-----------CPP file------------------------------<br>#include "Unit1.h"<br>&nbsp;<br>#define RSP_SIMPLE_SERVICE &nbsp; &nbsp; 1<br>#define RSP_UNREGISTER_SERVICE 0<br>&nbsp;<br>__fastcall TForm1::TForm1(TComponent* Owner)<br>&nbsp; &nbsp; : TForm(Owner)<br>{<br>&nbsp; &nbsp; hKernelLib = LoadLibrary("kernel32.dll");<br>&nbsp; &nbsp; if(hKernelLib)<br>&nbsp; &nbsp; {<br>&nbsp; &nbsp; &nbsp; &nbsp; RegisterServiceProcess =<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (pRegFunction)GetProcAddress(hKernelLib,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"RegisterServiceProcess");<br>&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; if(RegisterServiceProcess)<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; RegisterServiceProcess(GetCurrentProcessId(),<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;RSP_SIMPLE_SERVICE);<br>&nbsp; &nbsp; }<br>}<br>&nbsp;<br>__fastcall TForm1::~TForm1()<br>{<br>&nbsp; &nbsp; if(hKernelLib)<br>&nbsp; &nbsp; {<br>&nbsp; &nbsp; &nbsp; &nbsp; if(RegisterServiceProcess)<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; RegisterServiceProcess(GetCurrentProcessId(),<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;RSP_UNREGISTER_SERVICE);<br>&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; FreeLibrary(hKernelLib);<br>&nbsp; &nbsp; }<br>}<br>//-------------------------------------------------<br>注: windows NT下没有RegisterServiceProcess函数。<br>
 
能不能给出DELPHI原代码,谢谢!
 
到已答问题集中找<br>(只对95)<br>THE FOLLOWING IS WHAT I ANSWERED BEFORE<br><br>-------------------------------------------<br><br>试试如下代码:<br><br>&nbsp; &nbsp; &nbsp; &nbsp;CONST <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;RSP_SIMPLE_SERVICE=1;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;UNRSP_SIMPLE_SERVICE=0;<br><br>&nbsp; &nbsp; &nbsp; FUNCTION REGISTERSERVICEPROCESS(DWPROCESSID:DWORD;DWTYPE:DWORD):DWORD;STDCALL &nbsp; &nbsp;<br><br>在IMPLEMENTATION 加入<br>&nbsp; &nbsp; &nbsp; FUNCTION REGISTERSERVICEPROCESS;EXTERNAL 'KERNEL32.DLL' NAME 'REGISTERSERVICEPROCESS';<br><br><br>调用过程如下:<br>注册设备:<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;REGISTERSERVICEPROCESS(0,RSP_SIMPLE_SERVICE);<br>注销设备:<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;REGISTERSERVICEPROCESS(O,UNRSP_SIIMPLE_SERVICE);<br><br>函数原形可用VC的HELP.<br><br>你出错的原因是:NULL<br><br><br>
 
在<br>Application.Initialize;<br>之前加一句<br>Application.Title:='';<br>即可
 
去vcl.vclxx.com<br>这两天刚有个新控件可以办到。<br>以前好象还有个plantom什么的也可以
 
lha.fencer的办法是不行的
 
我使用了“深度历险”中的HSAPP。PAS,但是出现以下错误信息:<br>{uses<br>&nbsp; Windows, Messages, Classes, Controls, Forms, dsgnintf;}<br>在运行时说“dsgnintf.dcu”未找到,为什么?应如何处理?<br>“dsgnintf.dcu”代表什么?谢谢各位大虾!!!
 
Why you do not try what I told you.<br>I've done it before.<br>
 
在IMPLEMENTATION 加入 &nbsp; &nbsp; &nbsp;<br>const<br>&nbsp; RSPSIMPLESERVICE = 1;<br>&nbsp; RSPUNREGISTERSERVICE = 0;<br>function RegisterServiceProcess (dwProcessID, dwType: DWord) : DWord;<br>&nbsp; &nbsp; &nbsp;stdcall; external 'KERNEL32.DLL';<br>在MainForm的FormCreate下加入<br>RegisterServiceProcess (GetCurrentProcessID, RSPSIMPLESERVICE);<br>在FormDestroy中加入<br>RegisterServiceProcess (GetCurrentProcessID, RSPUNREGISTERSERVICE);<br><br>此外,在Application.Run之前加一句<br>Application.ShowMainForm:=false;就连你的主窗口也不显示了,还怕别人找到你<br>的程序?
 
你确认不行么?我是刚刚实验过的。
 
接受答案了.
 
后退
顶部