Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6374219
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:27:38+00:00 2026-05-25T01:27:38+00:00

I have to hide popup windows in third party library. I have implemented windows

  • 0

I have to hide popup windows in third party library.

I have implemented windows hook stuff with SetWindowsHookEx and know all the newely created hWnd(s). I listen to HSHELL_WINDOWCREATED callback and do the following:

long style= GetWindowLong(hWnd, GWL_STYLE);
style &= ~(WS_VISIBLE);    // this works - window become invisible 

style |= WS_EX_TOOLWINDOW;   // flags don't work - windows remains in taskbar
style &= ~(WS_EX_APPWINDOW); 

SetWindowLong(hWnd, GWL_STYLE, style);      

What I do wrong here to hide newely created windows in task bar?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T01:27:39+00:00Added an answer on May 25, 2026 at 1:27 am

    Before you use SetWindowLong, call ShowWindow(hWnd, SW_HIDE), then call SetWindowLong, then call ShowWindow again like ShowWindow(hWnd, SW_SHOW). So your code will look like this:

    long style= GetWindowLong(hWnd, GWL_STYLE);
    style &= ~(WS_VISIBLE);    // this works - window become invisible 
    
    style |= WS_EX_TOOLWINDOW;   // flags don't work - windows remains in taskbar
    style &= ~(WS_EX_APPWINDOW); 
    
    ShowWindow(hWnd, SW_HIDE); // hide the window
    SetWindowLong(hWnd, GWL_STYLE, style); // set the style
    ShowWindow(hWnd, SW_SHOW); // show the window for the new style to come into effect
    ShowWindow(hWnd, SW_HIDE); // hide the window so we can't see it
    

    Here is a relevant quote from Microsoft’s Website:

    To prevent the window button from being placed on the taskbar, create
    the unowned window with the WS_EX_TOOLWINDOW extended style. As an
    alternative, you can create a hidden window and make this hidden
    window the owner of your visible window.

    The Shell will remove a window’s button from the taskbar only if the
    window’s style supports visible taskbar buttons. If you want to
    dynamically change a window’s style to one that doesn’t support
    visible taskbar buttons, you must hide the window first (by calling
    ShowWindow with SW_HIDE), change the window style, and then show the
    window.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a popup with UserControl inside. I need to hide this popup and
I have created a dialog popup on click to show - I would like
I have done a hide and show of a div element, on clicking a
I have a show/hide toggle working well in multiple instances (thanks to help here
I have a requirement to hide a process in Task Manager. It is for
I have Divs show and hide (with an animation) using the following script (I
I have a div show hide function which is working fine. when I click
I have a nested function to show/hide paragraphs news-ticker-style. The problem is that when
I have this jquery script which suppose to hide/show div element base on the
I have an NSTextField that I hide when the user presses a button. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.