【呵呵,应该是RegisterServiceProcess吧】 The RegisterServiceProcess function registers or unregisters a service process. A service process continues to run after the user logs off. To call RegisterServiceProcess, retrieve a function pointer using GetProcAddress on KERNEL32.DLL. Use the function pointer to call RegisterServiceProcess. 【注意,RegisterServiceProcess在2000下无效】 调用示例如下: typedef UINT (CALLBACK* LPFNDLLFUNC1)(DWORD, DWORD); ............ ............ HINSTANCE hDLL; // Handle to DLL LPFNDLLFUNC1 lpfnDllFunc1; // Function pointer
hDLL = LoadLibrary("kernel32.dll"); if (hDLL != NULL) { lpfnDllFunc1 = (LPFNDLLFUNC1)GetProcAddress(hDLL, "RegisterServiceProcess"); if (!lpfnDllFunc1) { // handle the error FreeLibrary(hDLL); // return error_num; } else { // call the function lpfnDllFunc1(a, 1); } }
To call RegisterServiceProcess, retrieve a function pointer using GetProcAddress on KERNEL32.DLL. Use the function pointer to call RegisterServiceProcess.
【注意,RegisterServiceProcess在2000下无效】
调用示例如下:
typedef UINT (CALLBACK* LPFNDLLFUNC1)(DWORD, DWORD);
............
............
HINSTANCE hDLL; // Handle to DLL
LPFNDLLFUNC1 lpfnDllFunc1; // Function pointer
hDLL = LoadLibrary("kernel32.dll");
if (hDLL != NULL)
{
lpfnDllFunc1 = (LPFNDLLFUNC1)GetProcAddress(hDLL, "RegisterServiceProcess");
if (!lpfnDllFunc1)
{
// handle the error
FreeLibrary(hDLL);
// return error_num;
}
else
{
// call the function
lpfnDllFunc1(a, 1);
}
}