有如下的代码:implementation
function RegisterServiceProcess(dwProcessID, dwType: Integer): Integer; stdcall; external 'KERNEL32.DLL';
{$R *.DFM}procedure TForm1.FormCreate(Sender: TObject);
begin
RegisterServiceProcess(GetCurrentProcessID, 1);//隐藏
RegisterServiceProcess(GetCurrentProcessID, 0);//显示end;请问我在运行的时候,老是说无法定位程序输入点RegisterServiceProcess于动态库
KERNEL32。DLL上?有知道的能不能告诉我?
function RegisterServiceProcess(dwProcessID, dwType: Integer): Integer; stdcall; external 'KERNEL32.DLL';
{$R *.DFM}procedure TForm1.FormCreate(Sender: TObject);
begin
RegisterServiceProcess(GetCurrentProcessID, 1);//隐藏
RegisterServiceProcess(GetCurrentProcessID, 0);//显示end;请问我在运行的时候,老是说无法定位程序输入点RegisterServiceProcess于动态库
KERNEL32。DLL上?有知道的能不能告诉我?
function RegisterServiceProcess(dwProcessID, dwType: Integer): Integer; stdcall; external 'KERNEL32.DLL' name 'RegisterServiceProcess'
必须要声明的。
不声明就出错。
function RegisterServiceProcess(dwProcessID, dwType: DWord) : DWord; stdcall; external 'C:\WINNT\SYSTEM32\KERNEL32.DLL';也是不行的。
function RegisterServiceProcess(dwProcessID, dwType: Integer): Integer; stdcall; external 'c:\winnt\system32\KERNEL32.DLL';参数不足,有一个地址和一个类型参数。
再说C:\WINNT\SYSTEM32
系统是能找到的。
其实也可以动态载入。
下面我写了个函数,不过没调试过。function RegisterServer(dwProcessID, dwType: Integer): Integer; stdcall;
var
DllFileName:String;
p:PChar;
HInstance:integer;
RegisterServiceProcess:function ( dwProcessID, dwType: Integer ): Integer; stdcall;
begin
DllFileName := StringOfChar( ' ', 256);
p := PChar( DllFileName);
GetSystemDirectory(p,255);
StrCat(p,'\KERNEL32.DLL');
HInstance := LoadLibrary( P );
if HInstance = 0 then
raise exception.Create('Kerner32 loading error');
@RegisterServiceProcess := GetProcAddress( HHControlInstance, 'HtmlHelpA');
if @RegisterServiceProcess = nil then
raise exception.Create('Function RegisterServiceProcess cannot loaded!');
result := RegisterServiceProcess(dwProcessID, dwType);
//dwtype=1 隐藏
end;
我用的是 WIN2K ,你们说不技WIN2K,
那么在 WIN2K 中应该怎么写?
RegisterServiceProcess 在动态库 Kernel32.dll 中是没有的,
所以会出现以上的情况! 请问 RegisterServiceProcess 在那个动态库中?
有没有知道的?
要注册一个服务,请问在 WIN 2K 中怎么写? 谢谢先!
主要的原因就是在 WIN 98 中没有这个 API 函数!
我要结了!!!