关闭系统菜单,是那个关闭计算机菜单么?
const int size = 1;
unsigned char dwReg[size]="";
dwReg[0]=(unsigned char)1; //Define Varible
HKEY hKEY;
HKEY hNewKey;
long ret;
// DWORD dwDisp;
LPCTSTR m_strReg = "Explorer";
LPCTSTR Rgspath = "Software\\Microsoft\\Windows\\CurrentVersion\\Policies" ;
//Open key
ret = RegOpenKeyEx(HKEY_LOCAL_MACHINE,Rgspath,0L,KEY_WRITE, &hKEY);
ret = RegCreateKeyEx(
hKEY,
m_strReg,
0,
NULL,
REG_OPTION_NON_VOLATILE,
KEY_ALL_ACCESS ,
NULL,
&hNewKey,
NULL); if(ret!=ERROR_SUCCESS)
{
RegCloseKey(hKEY);
return FALSE;
}
if(bEnableClose)
{
//Set Key
ret = RegSetValueEx(hNewKey,"NoClose",0,REG_BINARY,dwReg,size);
}
if(ret!=ERROR_SUCCESS)
{
RegCloseKey(hKEY);
return FALSE;
}
RegCloseKey(hKEY); return TRUE;
const int size = 1;
unsigned char dwReg[size]="";
dwReg[0]=(unsigned char)1; //Define Varible
HKEY hKEY;
HKEY hNewKey;
long ret;
// DWORD dwDisp;
LPCTSTR m_strReg = "Explorer";
LPCTSTR Rgspath = "Software\\Microsoft\\Windows\\CurrentVersion\\Policies" ;
//Open key
ret = RegOpenKeyEx(HKEY_LOCAL_MACHINE,Rgspath,0L,KEY_WRITE, &hKEY);
ret = RegCreateKeyEx(
hKEY,
m_strReg,
0,
NULL,
REG_OPTION_NON_VOLATILE,
KEY_ALL_ACCESS ,
NULL,
&hNewKey,
NULL); if(ret!=ERROR_SUCCESS)
{
RegCloseKey(hKEY);
return FALSE;
}
if(bEnableClose)
{
//Set Key
ret = RegSetValueEx(hNewKey,"NoClose",0,REG_BINARY,dwReg,size);
}
if(ret!=ERROR_SUCCESS)
{
RegCloseKey(hKEY);
return FALSE;
}
RegCloseKey(hKEY); return TRUE;
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货