比如注册表的Run下有个键值,我如何编程方式删除该键值?

解决方案 »

  1.   

    http://www.vckbase.com/code/downcode.asp?id=1838
    这个注册表类很好的封装了注册表的API,用起来还是很方便的。
      

  2.   

    #include "windows.h"
    #pragma comment(lib,"advapi32.lib")HKEY hRoot=HKEY_LOCAL_MACHINE;
    HKEY hSubKey;
    if(ERROR_SUCCESS==RegOpenKey(hRoot,_T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run"),&hSubKey))
    {
    if(ERROR_SUCCESS==RegDeleteValue(hSubKey,_T("Value")))
    MessageBox(NULL,_T("删除成功"),_T("消息"),MB_OK);
    RegCloseKey(hSubKey);}