⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 regtipsdlg.cpp

📁 很丰富的 Registry 改动例子
💻 CPP
📖 第 1 页 / 共 2 页
字号:
	
	else if(comstr.Compare("Remove Recent Opened Files From Windows Media Player")==0)
	{
		RegOpenKeyEx(HKEY_CURRENT_USER,"SOFTWARE\\Microsoft\\Mediaplayer\\Player",0,KEY_ALL_ACCESS,&hkey);
	 	RegDeleteKey(hkey,"RecentURLList");
    
	}
   else if(comstr.Compare("Showing the Windows Version on the Desktop")==0)
   {
	   m_tmpChar="1";
	   RegOpenKeyEx(HKEY_CURRENT_USER,"Control Panel\\Desktop",0,KEY_ALL_ACCESS,&hkey);
	   RegSetValueEx(hkey,"PaintDesktopVersion",NULL,REG_SZ,(unsigned char*)m_tmpChar,strlen(m_tmpChar)+1);
       
   }
   
   else if(comstr.Compare("Setting the Internet Explorer Home Page")==0)
	{
	   m_tmpChar=m_Title.GetBuffer(m_Title.GetLength());  
	   RegOpenKeyEx(HKEY_CURRENT_USER,"Software\\Microsoft\\Internet Explorer\\Main",0,KEY_ALL_ACCESS,&hkey);
	   RegSetValueEx(hkey,"Start Page",NULL,REG_SZ,(unsigned char*)m_tmpChar,strlen(m_tmpChar)+1);
	}
	else if(comstr.Compare("Remove the shortcut arrows from all your icons")==0)
	{
		RegOpenKeyEx(HKEY_CLASSES_ROOT,"piffile",0,KEY_ALL_ACCESS,&hkey); 
        RegDeleteValue(hkey,"IsShortcut");
        RegCloseKey(hkey);		
        RegOpenKeyEx(HKEY_CLASSES_ROOT,"lnkfile",0,KEY_ALL_ACCESS,&hkey); 
        RegDeleteValue(hkey,"IsShortcut");
        
	}
	else if(comstr.Compare("Adding'Open with Notepad' to the right-click on any file")==0)
	{
		m_tmpChar="Notepad.exe %1";
	  RegCreateKey(HKEY_CLASSES_ROOT,"*\\shell\\Open With Notepad\\command",&hkey);
      RegSetValueEx(hkey,"",NULL,REG_SZ,(unsigned char*)m_tmpChar,strlen(m_tmpChar)+1);
	}
    else if(comstr.Compare("Add 'Open With'when you right-click on any file")==0)
	{
		m_tmpChar="c:\\windows\\rundll32.exe shell32.dll,OpenAs_RunDLL %1";
       RegCreateKey(HKEY_CLASSES_ROOT,"*\\shell\\Open With\\command",&hkey);
       RegSetValueEx(hkey,"",NULL,REG_SZ,(unsigned char*)m_tmpChar,strlen(m_tmpChar)+1);

	}
	else if(comstr.Compare("Add Toolbar Wallpaper to all your windows")==0)
	{  
		m_tmpChar=m_Title.GetBuffer(m_Title.GetLength());
		RegOpenKeyEx(HKEY_CURRENT_USER,"Software\\Microsoft\\Internet Explorer\\Toolbar",0,KEY_ALL_ACCESS,&hkey); 
        RegSetValueEx(hkey,"BackBitmap",NULL,REG_SZ,(unsigned char*)m_tmpChar,strlen(m_tmpChar)+1);

	}
	else if(comstr.Compare("Removing typed URLs from the Address bar of IE")==0)
	{
		RegOpenKeyEx(HKEY_CURRENT_USER,"Software\\Microsoft\\Internet Explorer",0,KEY_ALL_ACCESS,&hkey);
		RegDeleteKey(hkey,"TypedURLs");

	}
    else if(comstr.Compare("Blocking the Background Sheet")==0)
	{
        RegCreateKeyEx(HKEY_CURRENT_USER,"Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System",0,NULL,REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS,NULL,&hkey,0);
		RegSetValueEx(hkey,"NoDispBackgroundPage",NULL,REG_DWORD,( const BYTE *) &m_tmpWord,sizeof ( DWORD ));
	}
   else if(comstr.Compare("Creating 3D Window Effect")==0)
   {
	   m_tmpChar="128 128 128";
	   RegOpenKeyEx(HKEY_CURRENT_USER,"Control Panel\\Colors",0,KEY_ALL_ACCESS,&hkey);
	   RegSetValueEx(hkey,"ButtonHilight",0,REG_SZ,(LPBYTE)m_tmpChar,strlen(m_tmpChar)+1);
	   m_tmpChar="255 255 255";
	   RegSetValueEx(hkey,"ButtonShadow",0,REG_SZ,(LPBYTE)m_tmpChar,strlen(m_tmpChar)+1);

   }
   else if(comstr.Compare("Turn Off Window Animation")==0)
   {
	   m_tmpChar="0";
	   RegOpenKeyEx(HKEY_CURRENT_USER,"Control panel\\Desktop\\WindowMetrics",NULL,KEY_ALL_ACCESS,&hkey);
	   RegSetValueEx(hkey,"MinAnimate",0,REG_SZ,(LPBYTE)m_tmpChar,strlen(m_tmpChar)+1);
   }
   else if(comstr.Compare("Removing the 'Log Off User' from Start Menu")==0)
   {
		RegOpenKeyEx(HKEY_CURRENT_USER,"Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer",
			0,KEY_ALL_ACCESS,&hkey); 
        RegSetValueEx(hkey,"NoLogOff",0,REG_DWORD,(LPBYTE)&m_tmpWord,sizeof(DWORD)); 

	}
	else if(comstr.Compare("Disable 'Shut Down' Option from Start Menu")==0)
	{
		 m_tmpChar="0";
	     RegOpenKeyEx(HKEY_CURRENT_USER,"Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer",
			0,KEY_ALL_ACCESS,&hkey); 
         RegSetValueEx(hkey,"NoClose",0,REG_SZ,(LPBYTE)m_tmpChar,strlen(m_tmpChar)+1); 
 
	}
	else if(comstr.Compare("Disable the displaying of drives")==0)
	{
	   m_tmpWord=0x3ffffff;
	   RegOpenKeyEx(HKEY_CURRENT_USER,"Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer",
			0,KEY_ALL_ACCESS,&hkey); 
       RegSetValueEx(hkey,"NoDrives",0,REG_DWORD,(LPBYTE)&m_tmpWord,sizeof(DWORD)); 

	}
	else if(comstr.Compare("Removing the 'Run' from Start Menu")==0)
	{
       RegOpenKeyEx(HKEY_CURRENT_USER,"Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer",
			0,KEY_ALL_ACCESS,&hkey); 
       RegSetValueEx(hkey,"NoRun",0,REG_DWORD,(LPBYTE)&m_tmpWord,sizeof(DWORD)); 

	}

    else if(comstr.Compare("Removing the 'Find' from Start Menu")==0)
	{
       RegOpenKeyEx(HKEY_CURRENT_USER,"Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer",
			0,KEY_ALL_ACCESS,&hkey); 
       RegSetValueEx(hkey,"NoFind",0,REG_DWORD,(LPBYTE)&m_tmpWord,sizeof(DWORD)); 
	}
	else if(comstr.Compare("Removing the 'Documents' from Start Menu")==0)
	{
	   RegOpenKeyEx(HKEY_CURRENT_USER,"Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer",
			0,KEY_ALL_ACCESS,&hkey); 
       RegSetValueEx(hkey,"NoRecentDocsMenu",0,REG_DWORD,(LPBYTE)&m_tmpWord,sizeof(DWORD)); 

	}
	else if(comstr.Compare("Hiding All Items from the Desktop")==0)
	{
		RegOpenKeyEx(HKEY_CURRENT_USER,"Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer",
			0,KEY_ALL_ACCESS,&hkey); 
        RegSetValueEx(hkey,"NoDesktop",0,REG_DWORD,(LPBYTE)&m_tmpWord,sizeof(DWORD)); 

	}
	else if(comstr.Compare("Disable Registry Editing Tools")==0)
	{
       	RegOpenKeyEx(HKEY_CURRENT_USER,"Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer",
			0,KEY_ALL_ACCESS,&hkey); 
        RegSetValueEx(hkey,"DisableRegistryTools",0,REG_DWORD,(LPBYTE)&m_tmpWord,sizeof(DWORD)); 


	}

 RegCloseKey(hkey);	

}

void CRegTipsDlg::OnRemoveTip() 
{
	 HKEY hkey;
	
	 CString comstr;
     int index=m_listRegistryText.GetCurSel();
	 m_listRegistryText.GetText(index,comstr);

    if(comstr.Compare("Change The Internet explorer Title")==0)
	{
	
	   RegOpenKeyEx(HKEY_LOCAL_MACHINE,"SOFTWARE\\Microsoft\\Internet Explorer\\Main",0,KEY_ALL_ACCESS,&hkey);
	   RegDeleteValue(hkey,"Window Title");
	}
	else if(comstr.Compare("Changing the Title of Outlook Express 5")==0)
	{
		DWORD nSize=50;
		char userID[100];
		RegOpenKey(HKEY_CURRENT_USER,"Identities",&hkey);
		RegQueryValueEx(hkey,"Default User ID",0,0,(unsigned char*)userID,&nSize); 
		RegOpenKeyEx(hkey,userID,0,KEY_ALL_ACCESS,&hkey);
		RegOpenKeyEx(hkey,"Software\\Microsoft\\Outlook Express\\5.0",0,KEY_ALL_ACCESS,&hkey);
		RegDeleteValue(hkey,"WindowTitle");
		
	
	}
	
    else if(comstr.Compare("Showing the Windows Version on the Desktop")==0)
    {
	   RegOpenKeyEx(HKEY_CURRENT_USER,"Control Panel\\Desktop",0,KEY_ALL_ACCESS,&hkey);
	   RegDeleteValue(hkey,"PaintDesktopVersion");
    }
    else if(comstr.Compare("Setting the Internet Explorer Home Page")==0)
    {
	   RegOpenKeyEx(HKEY_CURRENT_USER,"Software\\Microsoft\\Internet Explorer\\Main",0,KEY_ALL_ACCESS,&hkey);
	   RegDeleteValue(hkey,"Start Page");

    }
    else if(comstr.Compare("Remove the shortcut arrows from all your icons")==0)
	{
		RegOpenKeyEx(HKEY_CLASSES_ROOT,"piffile",0,KEY_ALL_ACCESS,&hkey); 
		RegSetValueEx(hkey,"IsShortcut",NULL,REG_SZ,(unsigned char*)"",0);
        RegCloseKey(hkey);
		RegOpenKeyEx(HKEY_CLASSES_ROOT,"lnkfile",0,KEY_ALL_ACCESS,&hkey); 
        RegSetValueEx(hkey,"IsShortcut",NULL,REG_SZ,(unsigned char*)"",0);
    
    }
    else if(comstr.Compare("Adding'Open with Notepad' to the right-click on any file")==0)
    {
	   RegOpenKeyEx(HKEY_CLASSES_ROOT,"*\\shell",0,KEY_ALL_ACCESS,&hkey);
       RegDeleteKey(hkey,"Open With Notepad");

    }
    else if(comstr.Compare("Add 'Open With'when you right-click on any file")==0)
    {
	   RegOpenKeyEx(HKEY_CLASSES_ROOT,"*\\shell",0,KEY_ALL_ACCESS,&hkey);
       RegDeleteKey(hkey,"Open With");
    
    }
   	else if(comstr.Compare("Add Toolbar Wallpaper to all your windows")==0)
	{  
		RegOpenKeyEx(HKEY_CURRENT_USER,"Software\\Microsoft\\Internet Explorer\\Toolbar",0,KEY_ALL_ACCESS,&hkey); 
        RegDeleteValue(hkey,"BackBitmap");
		
	}
	else if(comstr.Compare("Blocking the Background Sheet")==0)
	{
    	      
		RegOpenKeyEx(HKEY_CURRENT_USER,"Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System",0,KEY_ALL_ACCESS,&hkey);
		RegDeleteValue(hkey,"NoDispBackgroundPage");

	}
	else if(comstr.Compare("Creating 3D Window Effect")==0)
    {
	   m_tmpChar="255 255 255";
	   RegOpenKeyEx(HKEY_CURRENT_USER,"Control Panel\\Colors",0,KEY_ALL_ACCESS,&hkey);
	   RegSetValueEx(hkey,"ButtonHilight",0,REG_SZ,(LPBYTE)m_tmpChar,strlen(m_tmpChar));
	   m_tmpChar="128 128 128";
	   RegSetValueEx(hkey,"ButtonShadow",0,REG_SZ,(LPBYTE)m_tmpChar,strlen(m_tmpChar));
	}
    else if(comstr.Compare("Turn Off Window Animation")==0)
    {
	   RegOpenKeyEx(HKEY_CURRENT_USER,"Control panel\\Desktop\\WindowMetrics",NULL,KEY_ALL_ACCESS,&hkey);
	   RegDeleteValue(hkey,"MinAnimate");
	}
    else if(comstr.Compare("Removing the 'Log Off User' from Start Menu")==0)
	{
		RegOpenKeyEx(HKEY_CURRENT_USER,"Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer",
			0,KEY_ALL_ACCESS,&hkey); 
		RegDeleteValue(hkey,"NoLogOff");
    }

    else if(comstr.Compare("Disable 'Shut Down' Option from Start Menu")==0)
	{
		RegOpenKeyEx(HKEY_CURRENT_USER,"Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer",
			0,KEY_ALL_ACCESS,&hkey); 
        RegDeleteValue(hkey,"NoClose");
	   
	}
    else if(comstr.Compare("Disable the displaying of drives")==0)
	{
		RegOpenKeyEx(HKEY_CURRENT_USER,"Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer",
			0,KEY_ALL_ACCESS,&hkey); 
		RegDeleteValue(hkey,"NoDrives");
       
	}
    else if(comstr.Compare("Removing the 'Run' from Start Menu")==0)
	{
       RegOpenKeyEx(HKEY_CURRENT_USER,"Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer",
			0,KEY_ALL_ACCESS,&hkey); 
       	RegDeleteValue(hkey,"NoRun");
	}

    else if(comstr.Compare("Removing the 'Find' from Start Menu")==0)
	{
       RegOpenKeyEx(HKEY_CURRENT_USER,"Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer",
			0,KEY_ALL_ACCESS,&hkey); 
       RegDeleteValue(hkey,"NoFind");

	}
    else if(comstr.Compare("Removing the 'Documents' from Start Menu")==0)
	{
		RegOpenKeyEx(HKEY_CURRENT_USER,"Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer",
			0,KEY_ALL_ACCESS,&hkey); 
	    RegDeleteValue(hkey,"NoRecentDocsMenu");
	}
	else if(comstr.Compare("Hiding All Items from the Desktop")==0)
	{
		RegOpenKeyEx(HKEY_CURRENT_USER,"Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer",
			0,KEY_ALL_ACCESS,&hkey); 
        RegDeleteValue(hkey,"NoDesktop");

	}
   else if(comstr.Compare("Disable Registry Editing Tools")==0)
	{
       	RegOpenKeyEx(HKEY_CURRENT_USER,"Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer",
			0,KEY_ALL_ACCESS,&hkey); 
        RegDeleteValue(hkey,"DisableRegistryTools");
	}


	 RegCloseKey(hkey);
	 
}

void CRegTipsDlg::OnWindowsReboot() 
{
	ExitWindowsEx(EWX_REBOOT,0);	
}

void CRegTipsDlg::OnWindowsShutdown() 
{
	ExitWindowsEx(EWX_SHUTDOWN,0);	
	
}

HBRUSH CRegTipsDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) 
{
	HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
	
	CBrush brush;
	brush.CreateSolidBrush(RGB(0,255,255));
	if(pWnd->GetDlgCtrlID() ==IDC_STATIC_MESSAGE)
	{
		pDC->SetTextColor(RGB(255, 0, 0));
        pDC->SetBkMode(TRANSPARENT);

	}
  if(pWnd->GetDlgCtrlID() ==IDC_LIST_REGISTRYTEXT)
	{
		pDC->SetTextColor(RGB(0,0,0));
        pDC->SetBkMode(TRANSPARENT);
        hbr = brush;
   	}
 

      brush.DeleteObject();
      return hbr;
}






⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -