diff -r 330b415910bd -r 86d3a45dc928 ui/win32/window.c --- a/ui/win32/window.c Wed Dec 31 09:16:02 2025 +0100 +++ b/ui/win32/window.c Wed Dec 31 10:06:15 2025 +0100 @@ -29,6 +29,7 @@ #include "window.h" #include +#include "toolkit.h" #include "container.h" #include "../common/object.h" @@ -70,8 +71,16 @@ } } +UiWindow* ui_widget2window(W32Widget *widget) { + if (widget->wclass != &w32_toplevel_widget_class) { + return NULL; + } + return (UiWindow*)widget; +} + static UiObject* create_window(const char *title, bool simple) { UiObject *obj = uic_object_new_toplevel(); + obj->ctx->command_map = cxHashMapCreate(obj->ctx->allocator, sizeof(UiCommand), 64); HWND hwnd = CreateWindowExA( 0,