<br>如果你不想自己的程序被从Ctrl+Alt+Del弹出的窗口中强行关闭,<br><br>介绍一个Windows未公布的API函数给你:<br><br>RegisterServiceProcess(ProcessID:Long,Type:Long)<br><br>该函数存在于Kernel32.dll中.<br><br>Process指向进程的ID,Type表示是否向系统注册该进程,是1,否0.<br><br>/////////////////////////////////////////////////////////////////////////////<br><br>function RegisterServiceProcess(a:longint;const b:longint):dword;stdcall;far;external 'Kernel32.dll' name 'RegisterServiceProcess';<br><br>ddd:=GetCurrentProcessId;<br><br>if (RegisterServiceProcess(ddd,1)=0) then<br><br>showmessage('error!');<br><br>////////////////////////////////////////////////////////////////////////////<br><br>用未公开函数RegisterServiceProcess<br><br>#define RSP_SIMPLE_SERVICE 1<br><br>#define RSP_UNREGISTER_SERVICE 0<br><br>//下面代码为隐藏<br><br>DWORD dwID,redserv;<br><br>dwID = GetCurrentProcessId();<br><br>regserv = RegisterServiceProcess(pid,RSP_SIMPLE_SERVICE);<br><br>//恢复隐藏<br><br>dwID= GetCurrentProcessId()<br><br>regserv = RegisterServiceProcess(pid,RSP_UNREGISTER_SERVICE);<br><br> <br> <br>