Implemented SDL_WINDOW_SKIP_TASKBAR on Windows
authorSam Lantinga <slouken@libsdl.org>
Fri, 16 Jun 2017 09:10:13 -0700
changeset 11100e99cf4079ace
parent 11099 8b902bfc616c
child 11101 0d7498130972
Implemented SDL_WINDOW_SKIP_TASKBAR on Windows
src/video/windows/SDL_windowswindow.c
     1.1 --- a/src/video/windows/SDL_windowswindow.c	Thu Jun 15 23:30:50 2017 +0200
     1.2 +++ b/src/video/windows/SDL_windowswindow.c	Fri Jun 16 09:10:13 2017 -0700
     1.3 @@ -91,7 +91,7 @@
     1.4      int w, h;
     1.5  
     1.6      /* Figure out what the window area will be */
     1.7 -    if (SDL_ShouldAllowTopmost() && ((window->flags & (SDL_WINDOW_FULLSCREEN|SDL_WINDOW_INPUT_FOCUS)) == (SDL_WINDOW_FULLSCREEN|SDL_WINDOW_INPUT_FOCUS) || window->flags & SDL_WINDOW_ALWAYS_ON_TOP)) {
     1.8 +    if (SDL_ShouldAllowTopmost() && ((window->flags & (SDL_WINDOW_FULLSCREEN|SDL_WINDOW_INPUT_FOCUS)) == (SDL_WINDOW_FULLSCREEN|SDL_WINDOW_INPUT_FOCUS) || (window->flags & SDL_WINDOW_ALWAYS_ON_TOP))) {
     1.9          top = HWND_TOPMOST;
    1.10      } else {
    1.11          top = HWND_NOTOPMOST;
    1.12 @@ -268,12 +268,16 @@
    1.13  int
    1.14  WIN_CreateWindow(_THIS, SDL_Window * window)
    1.15  {
    1.16 -    HWND hwnd;
    1.17 +    HWND hwnd, parent = NULL;
    1.18      RECT rect;
    1.19      DWORD style = STYLE_BASIC;
    1.20      int x, y;
    1.21      int w, h;
    1.22  
    1.23 +    if (window->flags & SDL_WINDOW_SKIP_TASKBAR) {
    1.24 +        parent = CreateWindow(SDL_Appname, TEXT(""), STYLE_BASIC, 0, 0, 32, 32, NULL, NULL, SDL_Instance, NULL);
    1.25 +    }
    1.26 +
    1.27      style |= GetWindowStyle(window);
    1.28  
    1.29      /* Figure out what the window area will be */
    1.30 @@ -288,7 +292,7 @@
    1.31      h = (rect.bottom - rect.top);
    1.32  
    1.33      hwnd =
    1.34 -        CreateWindow(SDL_Appname, TEXT(""), style, x, y, w, h, NULL, NULL,
    1.35 +        CreateWindow(SDL_Appname, TEXT(""), style, x, y, w, h, parent, NULL,
    1.36                       SDL_Instance, NULL);
    1.37      if (!hwnd) {
    1.38          return WIN_SetError("Couldn't create window");