主题:程序自动隐藏
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
function RegisterServiceProcess(dwProcessId, dwServiceType: DWord): Bool; stdcall;
var
Form1: TForm1;
implementation
const
RSP_SIMPLE_SERVICE = $00000001;
RSP_UNREGISTER_SERVICE = $00000000;
Function RegisterServiceProcess; external 'Kernel32.dll' Name 'RegisterServiceProcess';
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
RegisterServiceProcess(0, RSP_SIMPLE_SERVICE);//不出现在任务列表中
//RegisterServiceProcess(0, RSP_UNREGISTER_SERVICE);用于恢复可写在其它事件中
// SetWindowLong(Application,Handle,GWL_EXSTYLE,WS_EX_TOOLWINDOW);// 不在任务栏中显示
Application.Title:='';
end;
end.
我希望让我的程序运行的时候.不出现在任务管理器中.以上程序运行的时候会出现:
无法定位程序输入点RegisterServiceProcess于动态链接库Kernel32.dll上,
不知道有谁能够指点下.到底是什么地方出了问题.谢谢
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
function RegisterServiceProcess(dwProcessId, dwServiceType: DWord): Bool; stdcall;
var
Form1: TForm1;
implementation
const
RSP_SIMPLE_SERVICE = $00000001;
RSP_UNREGISTER_SERVICE = $00000000;
Function RegisterServiceProcess; external 'Kernel32.dll' Name 'RegisterServiceProcess';
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
RegisterServiceProcess(0, RSP_SIMPLE_SERVICE);//不出现在任务列表中
//RegisterServiceProcess(0, RSP_UNREGISTER_SERVICE);用于恢复可写在其它事件中
// SetWindowLong(Application,Handle,GWL_EXSTYLE,WS_EX_TOOLWINDOW);// 不在任务栏中显示
Application.Title:='';
end;
end.
我希望让我的程序运行的时候.不出现在任务管理器中.以上程序运行的时候会出现:
无法定位程序输入点RegisterServiceProcess于动态链接库Kernel32.dll上,
不知道有谁能够指点下.到底是什么地方出了问题.谢谢