📄 52.htm
字号:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>Windows95/98下怎样隐藏应用程序不让它出现在CTRL-ALT-DEL对话框中</title>
</head>
<div><center>
<table border="0" width="640">
<tr><td align="center"><b>Windows95/98下怎样隐藏应用程序不让它出现在CTRL-ALT-DEL对话框中</b></td></tr>
<tr><td align="center"><font color="#CC9933"></font></td></tr>
<tr><td> 把你的应用程序从CTRL-ALT-DEL对话框中隐藏的一个简单办法是去应用程序的标题。如果一个程序的主窗口没以标题,Windows95不把它放到CTRL-ALT-DEL对话框中。清除标题属性的最好地方是在WinMain函数里。<br><br>WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)<br>{<br> try<br> {<br> Application->Title = "";<br> Application->Initialize();<br> Application->CreateForm(__classid(TForm1), &Form1);<br> Application->Run();<br> }<br> catch (Exception &exception)<br> {<br> Application->ShowException(&exception);<br> }<br> 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> <br>class TForm1 : public TForm<br>{<br>__published:<br> TButton *Button1;<br>private:<br> HINSTANCE hKernelLib;<br> pRegFunction RegisterServiceProcess;<br>public:<br> __fastcall TForm1(TComponent* Owner);<br> __fastcall ~TForm1();<br>};<br> <br> <br>//-----------CPP file------------------------------<br>#include "Unit1.h"<br> <br>#define RSP_SIMPLE_SERVICE 1<br>#define RSP_UNREGISTER_SERVICE 0<br> <br>__fastcall TForm1::TForm1(TComponent* Owner)<br> : TForm(Owner)<br>{<br> hKernelLib = LoadLibrary("kernel32.dll");<br> if(hKernelLib)<br> {<br> RegisterServiceProcess =<br> (pRegFunction)GetProcAddress(hKernelLib,<br> "RegisterServiceProcess");<br> <br> if(RegisterServiceProcess)<br> RegisterServiceProcess(GetCurrentProcessId(),<br> RSP_SIMPLE_SERVICE);<br> }<br>}<br> <br>__fastcall TForm1::~TForm1()<br>{<br> if(hKernelLib)<br> {<br> if(RegisterServiceProcess)<br> RegisterServiceProcess(GetCurrentProcessId(),<br> RSP_UNREGISTER_SERVICE);<br> <br> FreeLibrary(hKernelLib);<br> }<br>}<br>//-------------------------------------------------<br>注: windows NT下没有RegisterServiceProcess函数。</td></tr>
</table></center></div>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -