comparison win/edge.cpp @ 2127:663467f6eee4

Code cleanup: Add constants to header for dark mode, buffer sizes and Unicode support. Windows and OS/2 can both be built without Unicode support for legacy platforms and apps. Some new Windows features require Unicode (notifications, edge) and Unicode is buggy on OS/2. Can now check if Unicode is supported with the DW_FEATURE_UTF8_UNICODE feature test. Dark mode constants added DW_DARK_MODE_DISABLED/BASIC/FULL/FORCED. Win: Include dw.h in the WinToast glue for the constants, and improve safety in Edge glue.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Sun, 28 Jun 2020 20:34:25 +0000
parents f9a2fc59611c
children a8b55524b1b2
comparison
equal deleted inserted replaced
2126:97839ff3c985 2127:663467f6eee4
224 WebHost->put_IsVisible(TRUE); 224 WebHost->put_IsVisible(TRUE);
225 } 225 }
226 226
227 BOOL EdgeBrowser::Detect(LPWSTR AppID) 227 BOOL EdgeBrowser::Detect(LPWSTR AppID)
228 { 228 {
229 WCHAR tempdir[MAX_PATH+1] = {0}; 229 // Combine two buffer lengths, ".WebView2\" (10) and a NULL
230 WCHAR tempdir[MAX_PATH+_DW_APP_ID_SIZE+11] = {0};
230 231
231 GetTempPathW(MAX_PATH, tempdir); 232 GetTempPathW(MAX_PATH, tempdir);
232 wcscat(tempdir, AppID); 233 wcscat(tempdir, AppID);
233 wcscat(tempdir, L"\\"); 234 wcscat(tempdir, L".WebView2\\");
234 CreateDirectoryW(tempdir, NULL); 235 CreateDirectoryW(tempdir, NULL);
235 236
236 CreateCoreWebView2EnvironmentWithOptions(nullptr, tempdir, nullptr, 237 CreateCoreWebView2EnvironmentWithOptions(nullptr, tempdir, nullptr,
237 Callback<ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler>( 238 Callback<ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler>(
238 [this](HRESULT result, ICoreWebView2Environment* env) -> HRESULT { 239 [this](HRESULT result, ICoreWebView2Environment* env) -> HRESULT {