如何用ie模式启动edge
时间: 2024-03-19 12:46:11 浏览: 158
可以使用以下代码在IE模式下启动Edge浏览器:
```cpp
#include <windows.h>
#include <Shlwapi.h>
#include <Urlmon.h>
#pragma comment(lib, "shlwapi.lib")
#pragma comment(lib, "urlmon.lib")
int main() {
CoInitialize(NULL);
// 设置注册表项
HKEY hKey;
RegOpenKeyEx(HKEY_CURRENT_USER, L"Software\\Microsoft\\Internet Explorer\\Main\\FeatureControl\\FEATURE_BROWSER_EMULATION", 0, KEY_ALL_ACCESS, &hKey);
DWORD value = 11001; // Edge浏览器版本号(11001为EdgeHTML 16版本)
RegSetValueEx(hKey, L"MicrosoftEdge.exe", 0, REG_DWORD, (BYTE*)&value, sizeof(value));
RegCloseKey(hKey);
// 启动Edge浏览器
ShellExecute(NULL, L"open", L"MicrosoftEdge.exe", L"-private -noframemerging -noFirstRun", NULL, SW_SHOWNORMAL);
CoUninitialize();
return 0;
}
```
这里使用了Windows API中的ShellExecute函数来启动Edge浏览器,并设置了命令行参数以在IE模式下启动。同时,也需要修改注册表项中的FEATURE_BROWSER_EMULATION键值,以便在Edge浏览器中启用IE模式。
阅读全文
相关推荐


















