[−][src]Trait win_win::WindowProc
A Rust wrapper for the winapi "window procedure".
See the Microsoft documentation on Window Procedures for more information. The details of
the window procedure are up to the application, though this wrapper does a bit of lifetime
management for the trait object, dropping it on WM_NCDESTROY
.
The window procedure will only be called from the message loop of the thread on which it was
created, which is why there is no Sync
or Send
bound on the trait object. However, it is
definitely possible for it to be called reentrantly, which is a primary reason the method is
&self
. Common ways to observe reentrant calls include:
-
Calling
DestroyWindow
. -
Calling
SendMessage
. -
Calling a synchronous dialog, including a file dialog.
Required methods
fn window_proc(
&self,
hwnd: HWND,
msg: UINT,
wparam: WPARAM,
lparam: LPARAM
) -> Option<LRESULT>
&self,
hwnd: HWND,
msg: UINT,
wparam: WPARAM,
lparam: LPARAM
) -> Option<LRESULT>
The Rust-side implementation of the window procedure.
When return value is None
, DefWindowProc
is called.