SDL Wiki
(This is the documentation for SDL3, which is under heavy development and the API is changing! SDL2 is the current stable version!)


Register a win32 window class for SDL's use.


int SDL_RegisterApp(const char *name, Uint32 style, void *hInst);

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 0 on success or a negative error code on failure; call SDL_GetError() for more information.


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.


This function is available since SDL 3.0.0.


[ edit | delete | history | feedback | raw ]

[ front page | index | search | recent changes | git repo | offline html ]

All wiki content is licensed under Creative Commons Attribution 4.0 International (CC BY 4.0).
Wiki powered by ghwikipp.