请问如何往注册表中写入二进制数
/*根键位置:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer
修改内容:
在右边的窗口中新建一个二进制值“NoViewContextMenu”,并设值为“01 00 00 00”。
效果:
修改后需重新启动WINDOWS,启动后,你将不能在桌面,驱动器,文件夹等地方使用鼠标右键
*/
#include<windows.h>
#include<iostream.h>
void main()
{
LPCTSTR hSubKey="Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer";
HKEY hResult=NULL;
DWORD dwDisposition=0;
long nResult=RegCreateKeyEx(HKEY_CURRENT_USER,hSubKey,0,NULL,\
REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS,NULL,&hResult,&dwDisposition);
if(nResult==ERROR_SUCCESS)
{
LPCTSTR szName="NoViewContextMenu";
LPCTSTR szValue="????????????";//应该如何写呢
long nResult=RegSetValueEx(hResult,szName,0,REG_BINARY,reinterpret_cast<CONST BYTE*>(szValue),strlen(szValue));
}
}