When a client program embeds a WebBrowser control, the Web page is opened by default using IE7 compatibility mode. However, IE7 has a lot of new features not supported, resulting in the inability to display properly, so you need to force the use of a higher version of IE kernel to load, render.
1 voidChangeregedit (Constwchar_t*pexename)2 {3 if(NULL = =pexename)4 return ;5TCHAR szversion[ -] = {0}; 6DWORD dwsize = -; 7 HKEY HKEY;8 //get the IE version First9 if(Error_success = = RegOpenKeyEx (HKEY_LOCAL_MACHINE, TEXT ("software\\microsoft\\internet Explorer"),0, Key_read, &HKey))Ten { One //first read the location of the IE11 ADWORD dwieversion =0; - if(Error_success = = RegQueryValueEx (HKey, L"svcversion",0, NULL, (LPBYTE) szversion, &dwsize)) - { theTCHAR *pos = _TCSCHR (szversion, TEXT ('.')); - if(POS) -Dwieversion =_ttoi (szversion); - } + if(Dwieversion = =0 ) -{//read the location of the low version of IE + if(Error_success = = (HKey, L"Version",0, NULL, (LPBYTE) szversion, &dwsize)) A { atTCHAR *pos = _TCSCHR (szversion, TEXT ('.')); - if(NULL = =POS) - { - RegCloseKey (HKey); - return ; - } in*pos =0; -Dwieversion =_ttoi (szversion); to } + } - RegCloseKey (HKey); the Switch(dwieversion) * { $ Case One: Dwieversion =11001; Break;Panax Notoginseng Case Ten: Dwieversion =10001; Break; - Case 9: Dwieversion =9999; Break; the Case 8: Dwieversion =8888; Break; + default:return ; A } the //set the IE version used by the application + if(Error_success = = RegOpenKeyEx (HKEY_LOCAL_MACHINE, L"software\\microsoft\\internet explorer\\main\\featurecontrol\\feature_browser_emulation",0, Key_write, &HKey)) - { $dwsize =sizeof(dwieversion); $RegSetValueEx (HKey, Pexename,0, REG_DWORD, (LPBYTE) &dwieversion, dwsize); - RegCloseKey (HKey); - } the } -}
Reprint: http://blog.csdn.net/mfcing/article/details/50460433
Load embedded pages with the highest version of the IE kernel installed with Windows (reprint)