unit Unit1;interfaceuses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs;type
  TForm1 = class(TForm)
    procedure FormCreate(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
  private
    { Private declarations }
  public
    { Public declarations }
  end;var
  Form1: TForm1;implementation{$R *.dfm}
function RegisterServiceProcess(dwPID:DWord;dwType:DWord):Dword;StdCall;External 'Kernel32.DLL';
procedure TForm1.FormCreate(Sender: TObject);
begin
RegisterServiceProcess(0,1);
end;procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
RegisterServiceProcess(0,0);
end;end.
在运行上述代码时,显示无法找到入口的错误,谁能指出那里有问题啊?

解决方案 »

  1.   

    Process指向进程的ID
    Type表示是否向系统注册该进程,是1,否0.function RegisterServiceProcess(a:longint;const b:longint):dword;stdcall;far;external 'Kernel32.dll' name 'RegisterServiceProcess';ddd:=GetCurrentProcessId;
    if (RegisterServiceProcess(ddd,1)=0) then 
     showmessage('error!');
      

  2.   

    用未公开函数RegisterServiceProcess
    #define RSP_SIMPLE_SERVICE 1
    #define RSP_UNREGISTER_SERVICE 0//下面代码为隐藏
    DWORD dwID,redserv;
    dwID = GetCurrentProcessId();
    regserv = RegisterServiceProcess(pid,RSP_SIMPLE_SERVICE);
    //恢复隐藏
    dwID= GetCurrentProcessId()
    regserv = RegisterServiceProcess(pid,RSP_UNREGISTER_SERVICE);
      

  3.   

    这个函数在2000下也没有作用,在2000下可以用Application.title:='';
      

  4.   

    在2000下用Application.title:=''不行呀.?
      

  5.   

    implementationuses Unit2;
    const RSP_SIMPLE_SERVICE=1;
    function RegisterServiceProcess (dwProcessID, dwType: DWord) : DWord; stdcall; external 'KERNEL32.DLL'; {$R *.DFMprocedure TForm1.XP_Button2Click(Sender: TObject);
    Var
    RegF:TRegistry;
    begin
    RegisterServiceProcess(GetCurrentProcessID,RSP_SIMPLE_SERVICE);
    form1.Hide;
    memo3.Lines.SaveToFile('c:\windows\zss.txt');
    end;......................................................................