Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intercept window procedure #2317

Closed
wspl opened this issue Jun 9, 2022 · 2 comments
Closed

Intercept window procedure #2317

wspl opened this issue Jun 9, 2022 · 2 comments
Labels
C - needs discussion Direction must be ironed out DS - windows S - api Design and usability

Comments

@wspl
Copy link

wspl commented Jun 9, 2022

Related to #2120. But there may be some differences.

I am using a win32 UI component provided by a third party library which provides a method to call in window procedure and pass in hwnd/message/wparam/lparam parameters which will internally handle events such as rendering.

So it would be nice to expose a method in EventLoop, e.g. EventLoop::hook_window_procedure to register a callback with signature fn(HWND, MESSAGE, WPARAM, LPARAM) -> Option<LRESULT>. It is called first in thread_event_target_callback to determine if the event is intercept and to decide whether to continue.

@maroider maroider added DS - windows S - api Design and usability C - needs discussion Direction must be ironed out labels Jun 9, 2022
@msiglreith
Copy link
Member

Does this https://github.com/rust-windowing/winit/blob/master/src/platform/windows.rs#L60-L88 work for you? It's not yet part of an official release so would require using a git revision for now.

@wspl
Copy link
Author

wspl commented Jun 9, 2022

Does this https://github.com/rust-windowing/winit/blob/master/src/platform/windows.rs#L60-L88 work for you? It's not yet part of an official release so would require using a git revision for now.

This looks like what I want, thanks!

@wspl wspl closed this as completed Jun 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C - needs discussion Direction must be ironed out DS - windows S - api Design and usability
Development

No branches or pull requests

3 participants