确定Windows和windows系统目录
有两个SDK函数可以完成该功能。GetWindowsDirectory和GetSystemDirectory,下例说明了如何使用这两个函数:
TCHAR szDir [MAX_PATH];
//Get the full path of the windows directory.
:: GetWindowsDirectory (szDir, MAX_PATH);
TRACE ("Windows directory %s/n", szDir);
//Get the full path of the windows system directory.
:: GetSystemDirectory (szDir, MAX_PATH);
TRACE ("Windows system directory %s/n", szDir);
**********************************************************************************
让程序从CTRL+ATL+DEL消失
使用Win32 API函数RegisterServiceProcess这里我们使用了汇编。
#i nclude <windows.h>
HINSTANCE hLibrary;