//Register System service so as to hide it from the users!
//Retrieve the RegisterServiceProcess function pointer from kernel32.dll
CString strPath;
GetSystemDirectory(strPath.GetBuffer(MAX_PATH),MAX_PATH);
strPath.ReleaseBuffer();
strPath+="\\kernel32.dll";
SetDlgItemText(IDC_STATIC,strPath);
hInstance=LoadLibrary(strPath);
VERIFY(hInstance!=NULL);
CString m_strName="RegisterServiceProcess";
lpfn=GetProcAddress(hInstance,(LPCSTR)m_strName);
VERIFY(lpfn!=NULL);
// (*lpfn)(GetCurrentProcessId(),1);When Running,Windows tell me that lpfn==NULL! Why?MSDN seems to tell me
call this function this way!
//Retrieve the RegisterServiceProcess function pointer from kernel32.dll
CString strPath;
GetSystemDirectory(strPath.GetBuffer(MAX_PATH),MAX_PATH);
strPath.ReleaseBuffer();
strPath+="\\kernel32.dll";
SetDlgItemText(IDC_STATIC,strPath);
hInstance=LoadLibrary(strPath);
VERIFY(hInstance!=NULL);
CString m_strName="RegisterServiceProcess";
lpfn=GetProcAddress(hInstance,(LPCSTR)m_strName);
VERIFY(lpfn!=NULL);
// (*lpfn)(GetCurrentProcessId(),1);When Running,Windows tell me that lpfn==NULL! Why?MSDN seems to tell me
call this function this way!
解决方案 »
- listbox控件的左键选中某项是什么消息?
- MCI如何控制mp3播放的次数?
- 关于图像移位,咨询一下。
- 关于The window name "XXXXX" passed to HH_GET_WIN_TYPE has not been specified的问题
- 运算符重载时,为什么必须重载为成员函数或友元?
- iis6中关于isapi filter的问题。
- IShellUIHelper接口的ImportExportFavorites的问题
- C++Primer看完了能看懂源代码嘛?
- VC++用Hough变换检测直线?
- MFC中如何对一个结构体数组(结构体成员是一个int型数据和5个CString类成员)进行文件读写操作?
- 简单问题:如何用SDK方式获得主窗口的句柄?
- 怎么用vc 设置.............
RegisterServiceProcess in in kernel32.dll,use GetProcAddress to get
the function pointer and then call it!
In Win2000 and WinXP,kernel32.dll is situated in c:\windows\system32.So why do you say "RegisterServiceProcess" can't be called in XP?
Looking for your detailed explanation!Thank you for participating!!
Maybe you get the point!However,in my knowledge, "RegisterServiceProcess" could prevent your program
dispeared in the being-on program group when the user press
"DEL+ALT+Shift".If this function couldn't be used in Window XP,then
Are there any function or routine to substitute this function in
WinXP?
Welcoming for more dicussing!When this question is solved,all
the participaters would get s!Thank you for attentions!