sdlSetWindowsMessageHook function

void sdlSetWindowsMessageHook(
  1. Pointer<NativeFunction<SdlWindowsMessageHook>> callback,
  2. Pointer<NativeType> userdata
)

Set a callback for every Windows message, run before TranslateMessage().

The callback may modify the message, and should return true if the message should continue to be processed, or false to prevent further processing.

\param callback the SDL_WindowsMessageHook function to call. \param userdata a pointer to pass to every iteration of callback.

\since This function is available since SDL 3.1.3.

\sa SDL_WindowsMessageHook \sa SDL_HINT_WINDOWS_ENABLE_MESSAGELOOP

extern SDL_DECLSPEC void SDLCALL SDL_SetWindowsMessageHook(SDL_WindowsMessageHook callback, void *userdata)

Implementation

void sdlSetWindowsMessageHook(
    Pointer<NativeFunction<SdlWindowsMessageHook>> callback,
    Pointer<NativeType> userdata) {
  final sdlSetWindowsMessageHookLookupFunction = libSdl3.lookupFunction<
      Void Function(Pointer<NativeFunction<SdlWindowsMessageHook>> callback,
          Pointer<NativeType> userdata),
      void Function(Pointer<NativeFunction<SdlWindowsMessageHook>> callback,
          Pointer<NativeType> userdata)>('SDL_SetWindowsMessageHook');
  return sdlSetWindowsMessageHookLookupFunction(callback, userdata);
}