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

# SDL\_RegisterApp(3)

Register a win32 window class for SDL's use.

## NAME

SDL\_RegisterApp - Register a win32 window class for SDL's use.

## HEADER FILE

Defined in SDL3/SDL\_main.h

## SYNOPSIS

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

**bool SDL\_RegisterApp(const char \*name, Uint32 style, void \*hInst);**

## DESCRIPTION

This can be called to set the application window class at startup. It is safe to call this multiple times, as long as every call is eventually paired with a call to  **SDL\_UnregisterApp** , but a second registration attempt while a previous registration is still active will be ignored, other than to increment a counter.

Most applications do not need to, and should not, call this directly; SDL will call it when initializing the video subsystem.

## FUNCTION PARAMETERS

- *name*

  the window class name, in UTF-8 encoding. If NULL, SDL currently uses " **SDL\_app** " but this isn't guaranteed.

- *style*

  the value to use in WNDCLASSEX::style. If **name** is NULL, SDL currently uses **(CS\_BYTEALIGNCLIENT**\|**CS\_OWNDC)** regardless of what is specified here.

- *hInst*

  the HINSTANCE to use in WNDCLASSEX::hInstance. If zero, SDL will use **GetModuleHandle(NULL)** instead.

## RETURN VALUE

Returns true on success or false on failure; call

**SDL\_GetError** () for more information.

## AVAILABILITY

This function is available since SDL 3.2.0.
