Menu

process Windows message loop events with twapi

2025-11-16
2025-11-19
  • Denis Laroche

    Denis Laroche - 2025-11-16

    Hi,

    Google AI engine returned an article describing how to use proc twapi::set_window_proc to process events but that procedure doesn't exist. I looked at all the twapi packages and I couldn't find anything equivalent.

    Is there a way to capture the events from a window with twapi?

    Thanks in advannce.

     
  • Ashok P. Nadkarni

    There is no official exposed framework, in part because, handling of window events is tricky and susceptible to user error and I don't want to land up supporting functionality that is hard for the user to get right.

    Having said that, you can see the implementation of register_hotkey as an example of how windows messages are handled. Note that is not intended for hooking arbitrary window but only messages received by a special internal use twapi window.

    If you are more specific about which windows messages you want to process, I might be able to suggest other options.

     
  • Denis Laroche

    Denis Laroche - 2025-11-19

    ok thanks

    I finally did the event handling in the C part of the application

     

Anonymous
Anonymous

Add attachments
Cancel