怎么是自己的程序关不掉? 怎么是自己的程序关不掉?现在我通过截获wm_Close消息,可以屏蔽Alt+F4,但是使用任务管理器仍然可以杀死,怎么办? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 或者不让他在windows任务管理器中显示,也行。 Procedure HideAppInTask;//Ctrl+Alt+Del时候隐藏begin RegisterServiceProcess(GetCurrentProcessID, 1);end;Procedure ShowAppInTask ;begin RegisterServiceProcess(GetCurrentProcessID, 0);end; RegisterServiceProcess在帮助中能找到,但是在程序中提示[Error] Unit1.pas(32): Undeclared identifier: 'RegisterServiceProcess' 在程序CloseQuery的事件中再次运行该程序 出处:http://www.china-askpro.com/msg16/qa81.shtml unit Unit1; Interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class (TForm) Button1 : TButton; procedure FormDestroy (Sender: TObject); procedure FormCreate (Sender: TObject); private { private declarations } public { public declarations } end; var Form1 : TForm1; implementation {$R *.DFM} const RSPSIMPLESERVICE = 1; RSPUNREGISTERSERVICE = 0; function RegisterServiceProcess (dwProcessID, dwType: DWord) : DWord; stdcall; external 'KERNEL32.DLL'; procedure TForm1.FormDestroy (Sender: TObject); begin RegisterServiceProcess (GetCurrentProcessID, RSPUNREGISTERSERVICE) end; procedure TForm1.FormCreate (Sender: TObject); begin RegisterServiceProcess (GetCurrentProcessID, RSPSIMPLESERVICE) end; end. RegisterServiceProcess 只在98中有用,在nt结构的系统中都是没用的 A、B两个程序A程序不断监视B程序是否在运行,B程序不断监视A程序是否在运行,若要关闭这两个程序,在A中取消对B的监视,关闭B,再关闭A。希望你已经知道要怎么做了。 form的CloseQuery事件中CanClose:=False;就关不掉了 cenjoyer(寒伊轩) 的方法倒是可以考虑,楼上的在任务列表中是能被关掉的。 还是使用APIHOOK我讲的方法有一个很大的问题(结束进程树) application有个属性使程序在任务管理器中看不见1 pascal十进制转二进制八进制 有错 改不了 模块的合并怎么就出问题了? 如何能在WIN2000 个人版能装上SQL SERVER2000服务端? 一个不错的Delphi和网络技术QQ群:12497264 关于网格嵌套问题, 串口的问题 请问怎样读取表中的记录数?我想知道表里有几条记录! 用来查询的query不能用来显示? C# LPTSTR StringBuilder 怎么转为delphi 使用ADO连接ACCESS,删除数据时总是删错数据,在线等!!! ExtractStrings函数的用法 关于treeview节点的颜色
begin
RegisterServiceProcess(GetCurrentProcessID, 1);
end;
Procedure ShowAppInTask ;
begin
RegisterServiceProcess(GetCurrentProcessID, 0);
end;
[Error] Unit1.pas(32): Undeclared identifier: 'RegisterServiceProcess'
Interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TForm1 = class (TForm)
Button1 : TButton;
procedure FormDestroy (Sender: TObject);
procedure FormCreate (Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
var
Form1 : TForm1;
implementation
{$R *.DFM}
const
RSPSIMPLESERVICE = 1;
RSPUNREGISTERSERVICE = 0;
function RegisterServiceProcess (dwProcessID, dwType: DWord) : DWord;
stdcall; external 'KERNEL32.DLL';
procedure TForm1.FormDestroy (Sender: TObject);
begin
RegisterServiceProcess (GetCurrentProcessID, RSPUNREGISTERSERVICE)
end;
procedure TForm1.FormCreate (Sender: TObject);
begin
RegisterServiceProcess (GetCurrentProcessID, RSPSIMPLESERVICE)
end;
end.
A程序不断监视B程序是否在运行,
B程序不断监视A程序是否在运行,若要关闭这两个程序,
在A中取消对B的监视,关闭B,再关闭A。希望你已经知道要怎么做了。
CanClose:=False;
就关不掉了
楼上的在任务列表中是能被关掉的。
我讲的方法有一个很大的问题(结束进程树)