---
name: "SDL_WindowsMessageHook"
section: "3type"
platform: "linux"
package: "libsdl3-doc"
version: "3.2.10+ds-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/SDL_WindowsMessageHook"
---

# SDL\_WindowsMessageHook(3type)

A callback to be used with SDL\_SetWindowsMessageHook .

## NAME

SDL\_WindowsMessageHook - A callback to be used with  **SDL\_SetWindowsMessageHook** .

## HEADER FILE

Defined in SDL3/SDL\_system.h

## SYNOPSIS

```
#include "SDL3/SDL.h"
```

**typedef bool (SDLCALL \*SDL\_WindowsMessageHook)(void \*userdata, MSG \*msg);**

## DESCRIPTION

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

As this is processing a message directly from the Windows event loop, this callback should do the minimum required work and return quickly.

## FUNCTION PARAMETERS

- *userdata*

  the app-defined pointer provided to  **SDL\_SetWindowsMessageHook** .

- *msg*

  a pointer to a Win32 event structure to process.

## RETURN VALUE

Returns true to let event continue on, false to drop it.

## THREAD SAFETY

This may only be called (by SDL) from the thread handling the Windows event loop.

## AVAILABILITY

This datatype is available since SDL 3.2.0.

## SEE ALSO

**•**(3), [**SDL\_SetWindowsMessageHook**(3)](/SDL_SetWindowsMessageHook/3.md), **•**(3), [**SDL\_HINT\_WINDOWS\_ENABLE\_MESSAGELOOP**(3)](/SDL_HINT_WINDOWS_ENABLE_MESSAGELOOP/3.md)
