mirror of
https://github.com/webui-dev/webui
synced 2025-03-28 21:13:17 +00:00
hwnd check before use
This commit is contained in:
parent
361237669b
commit
25c7e3f16c
13
src/webui.c
13
src/webui.c
@ -11351,13 +11351,6 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved) {
|
||||
NULL, NULL, GetModuleHandle(NULL), NULL
|
||||
);
|
||||
|
||||
{ // window size correction
|
||||
RECT rc;
|
||||
GetClientRect(win->webView->hwnd, &rc);
|
||||
win->webView->width = rc.right - rc.left;
|
||||
win->webView->height = rc.bottom - rc.top;
|
||||
}
|
||||
|
||||
if (!win->webView->hwnd) {
|
||||
_webui_wv_free(win->webView);
|
||||
win->webView = NULL;
|
||||
@ -11365,6 +11358,12 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved) {
|
||||
WEBUI_THREAD_RETURN
|
||||
}
|
||||
|
||||
// window size correction
|
||||
RECT rc;
|
||||
GetClientRect(win->webView->hwnd, &rc);
|
||||
win->webView->width = rc.right - rc.left;
|
||||
win->webView->height = rc.bottom - rc.top;
|
||||
|
||||
SetWindowLongPtr(win->webView->hwnd, GWLP_USERDATA, (LONG_PTR)win);
|
||||
ShowWindow(win->webView->hwnd, SW_SHOW);
|
||||
static CreateCoreWebView2EnvironmentWithOptionsFunc createEnv = NULL;
|
||||
|
Loading…
x
Reference in New Issue
Block a user