locked
Transparent top level window is not hidden from taskbar on Windows 8 RRS feed

  • Question

  • I believe my problem is the same as this post on msdn.
     
    http://social.msdn.microsoft.com/Forums/en-US/windowscompatibility/thread/3fa017d4-c2b0-475b-9137-a968678393de
     
    My application creates a top level window that is transparent and non interactive. I also want this window to not be shown in the Windows taskbar.
     
    My application is written in Qt. I have examined the source code to see that we set the following flags in CreateWindowEx
     
    For normal styles WS_POPUP and extended styles WS_EX_TOOLWINDOW | WS_EX_LAYERED. On previous versions of Windows from XP to Win 7.
    My hidden window did not receive a task bar button. in Windows 8 CP it does.
     
    Is there a way to accomplish this on Windows 8 like I have been doing on previous versions of Windows?
    Is this a bug or a change in behavior in Windows 8? If so is there a work around?

    Thanks.

    Wednesday, May 9, 2012 2:57 PM

Answers

  • WS_EX_TOOLWINDOW should block the window from getting a task bar button.

    I haven't been able to reproduce this problem in a sample app, although I did see it in the application in the linked thread. I haven't been able to debug it yet to track down why it avoids the WS_EX_TOOLWINDOW check.

    A possibility might be if the window's styles are changed after it is created: the TaskBar may have already created the button and not notice further changes. If so, then calling SetWindowPos with SWP_FRAMECHANGED may fix the problem.

    --Rob

    • Marked as answer by JSmartTech Thursday, May 10, 2012 8:00 PM
    Thursday, May 10, 2012 12:11 AM

All replies

  • WS_EX_TOOLWINDOW should block the window from getting a task bar button.

    I haven't been able to reproduce this problem in a sample app, although I did see it in the application in the linked thread. I haven't been able to debug it yet to track down why it avoids the WS_EX_TOOLWINDOW check.

    A possibility might be if the window's styles are changed after it is created: the TaskBar may have already created the button and not notice further changes. If so, then calling SetWindowPos with SWP_FRAMECHANGED may fix the problem.

    --Rob

    • Marked as answer by JSmartTech Thursday, May 10, 2012 8:00 PM
    Thursday, May 10, 2012 12:11 AM
  • It seems one duplicate thread here: http://social.msdn.microsoft.com/Forums/en-US/windowscompatibility/thread/c4f9d424-11e7-45f7-b029-5cf709a0d046 Reference these both threads.

    Bob Bao [MSFT]
    MSDN Community Support | Feedback to us

    Thursday, May 10, 2012 5:05 AM
  • The suggestion to called SetWindowPos after creating the window appears to work. Thank you.

    Although I don't understand why it stopped working in Windows 8. Just for throughness I did check that we have correctly set all of the window flags after the call to CreateWindowEx using GetWindowLong.

    All of them are set. But until I make that SetWindowPos call I still see buttons on the task bar.

    Thanks again.

    Thursday, May 10, 2012 8:00 PM