//------------------------------------------------------------------------------
//在98下隐藏窗口,标准写法
procedure SetServiceProcess(b:Boolean);
var
RegisterServiceProcess :function (dwProcessID, dwType: DWord) : DWord; Stdcall;
DllName:string;
Buffer:array [0..127] of char;
Lib:Thandle;
begin
if fcIsNT then exit;
DllName:='KERNEL32.DLL';
strPcopy(buffer,Dllname);
Lib:=LoadLibrary(Buffer);
if Lib<>0 then
try
@RegisterServiceProcess:=GetProcAddress(Lib,'RegisterServiceProcess');
if b then
RegisterServiceProcess (GetCurrentProcessID, 1)
else
RegisterServiceProcess (GetCurrentProcessID, 0)
finally
freeLibrary(Lib);
end
else
Messagebox(0,pChar('DLL错误'),pChar('系统错误'),MB_ICONERROR);
end;