Skip to content

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

Merged
prokopyl merged 20 commits into
masterfrom
hwnd_wrapper
May 27, 2026
Merged

Win32: Introduce safe wrapper for window creation process and lifecycle#259
prokopyl merged 20 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
@prokopyl prokopyl force-pushed the hwnd_wrapper branch 2 times, most recently from 3a2fe37 to 4d80b11 Compare May 25, 2026 22:26
Comment thread src/wrappers/win32/window/proc.rs Outdated
@prokopyl prokopyl merged commit 68c627d into master May 27, 2026
14 checks passed
@prokopyl prokopyl deleted the hwnd_wrapper branch May 27, 2026 00:05
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.

2 participants