// create the window hidden; reveal it only after the page is painted
options.hide_window = 1; // do not show on create
HWND mh = (HWND)get_window_hwnd(create_webview_window(...));
if (mh) ShowWindow(mh, SW_HIDE); // belt and suspenders
// fired on WEBVIEW_DID_FINISH_LOAD -- the first and ONLY show
void OnWebViewLoad(uint32_t win_id) {
HWND h = (HWND)get_window_hwnd(win_id);
if (h) ShowWindow(h, SW_SHOW); // no more white flash
}
.app {
border-radius: 12px;
overflow: hidden; /* does NOT clip backdrop-filter layers */
clip-path: inset(0 round 12px); /* THIS one actually clips them */
}
// terminate only the msedgewebview2.exe children whose parent == me
void KillWebView2Children() {
DWORD self = GetCurrentProcessId();
// for each msedgewebview2.exe in the snapshot:
PROCESS_BASIC_INFORMATION pbi = {0};
NtQueryInformationProcess(hChild, ProcessBasicInformation,
&pbi, sizeof(pbi), NULL);
if ((DWORD)(ULONG_PTR)pbi.InheritedFromUniqueProcessId == self) {
TerminateProcess(hChild, 0); // mine, kill it
}
}
// actually enable HTTP/2 on the native WinHTTP request
DWORD flag = WINHTTP_PROTOCOL_FLAG_HTTP2;
WinHttpSetOption(hRequest, WINHTTP_OPTION_ENABLE_HTTP_PROTOCOL,
&flag, sizeof(flag));
// after sending: read back what was REALLY negotiated, report it to the UI
DWORD used = 0, len = sizeof(used);
WinHttpQueryOption(hRequest, WINHTTP_OPTION_HTTP_PROTOCOL_USED, &used, &len);
// used & WINHTTP_PROTOCOL_FLAG_HTTP2 -> show "HTTP/2" in the metrics