更改开机默认不显示explorer.exe,直接启动自己写的EXE程序方法

时间:2023-03-09 19:13:10
更改开机默认不显示explorer.exe,直接启动自己写的EXE程序方法

原文:更改开机默认不显示explorer.exe,直接启动自己写的EXE程序方法

更改开机默认不显示explorer.exe,直接启动自己写的EXE程序的函数:

bool UpdateWinlogon(CString _cstrReg)

{
CRegKey key;
CString cstrKeyPath = "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon";
CString cstrKeyName = "Shell";

if(key.Open(HKEY_LOCAL_MACHINE, cstrKeyPath, 

  KEY_SET_VALUE|KEY_WOW64_64KEY) != ERROR_SUCCESS)

{
return false;
}
if(key.SetStringValue(cstrKeyName, _cstrReg,REG_SZ) != ERROR_SUCCESS)
{
return false;
}
key.Close();
return true;
}