Skip to content

Win32: Introduce safe wrapper for window creation process and lifecycle#259

Open
prokopyl wants to merge 16 commits into
masterfrom
hwnd_wrapper
Open

Win32: Introduce safe wrapper for window creation process and lifecycle#259
prokopyl wants to merge 16 commits into
masterfrom
hwnd_wrapper

Conversation

@prokopyl
Copy link
Copy Markdown
Member

@prokopyl prokopyl commented May 24, 2026

This PR introduces an internal safe wrapper (WindowImpl) around the Win32 window creation process and lifecycle.

This also makes it possible to properly handle messages sent to the Baseview window while processing the WM_CREATE and WM_DESTROY messages. It also makes it possible to safely send, receive and process WM_DESTROY messages during any event handler.

This means the Baseview implementation (or user implementation) can now perform non-trivial work during window creation, and any generated messages (e.g. window resizing) will not be missed by Baseview's internal handlers.

This PR also moves the initialization process from after CreateWindow is called to during the processing of the WM_CREATE message.

@prokopyl prokopyl added this to the v0.1.2 - Safer internals milestone May 25, 2026
@prokopyl prokopyl self-assigned this May 25, 2026
@prokopyl prokopyl marked this pull request as ready for review May 25, 2026 02:57
@prokopyl prokopyl changed the title Win32 Window wrapper Win32: Introduce safe wrapper for window creation process and lifecycle May 25, 2026
@prokopyl prokopyl requested a review from micahrj May 25, 2026 02:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant