Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

modifying WS_EX_TOOLWINDOW and taskbar

Posted on 1998-12-15
8
712 Views
Last Modified: 2013-11-20
I need to have a window that can toggle between not showing
a button on the taskbar, and showing a button on the taskbar. So I change the window extended style with ModifyStyleEx and WS_EX_TOOLWINDOW. But the taskbar doesn't seem to update after I remove the WS_EX_TOOLWINDOW style. The button still exists (alltough no icon is showing) and when the program exits. It leavs a ghost button that dissapears when I press it. I'd like some tips on how to force the taskbar to comply with my window style

// everlast
0
Comment
Question by:everlast
8 Comments
 
LVL 1

Expert Comment

by:The_Brain
ID: 1326230
Did you use a wizard to get it?  
there is a possible solution, you only removed the icon.  The removing is just to update the toolbar, override the function call it yourself to repaint.  (over paint) and do it again.
i can't help more than that for now. :(


0
 
LVL 2

Expert Comment

by:wyy_cq
ID: 1326231
this is a bug of windows95,
sometime when the screen saver quit you will encounter the same thing.

there are two tips:
1 a window hides , the button on taskbar will dissapear at once.
2 add the icon to system tray , and not show the button on the taskbar at the application starts.
0
 

Expert Comment

by:needhlp1
ID: 1326232
How do you make it so it DOESN'T show in the task bar?

I don't know how to ModifyStyleEx and WS_EX_TOOLWINDOW.

0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 

Author Comment

by:everlast
ID: 1326233
wyy_cq, there has got to be a way to remove the taskbar button on the fly programmaticaly. The main problem isn't the ghost button when the program exits, but that the taskbar doesn't remove the button when I set WS_EX_TOOLWINDOW dynamicaly. When I press Alt+Tab, the program icon doesn't show(what's what I want).
So apprently, it's the taskbar that doesn't update. Maybe I can send some message to the taskbar window to force it to update?
0
 

Author Comment

by:everlast
ID: 1326234
The_brain, I'm not sure I understand your comment, what function call do you mean? I have though about drawing the caption myself and intercept the WM_NCHITTEST message to emulate. That might be the only solution.
0
 

Author Comment

by:everlast
ID: 1326235
Adjusted points to 200
0
 

Accepted Solution

by:
dagangwang earned 200 total points
ID: 1326236
1. Use FindWindow( "Shell_TrayWnd", .... to find the window ( TaskBar )  where buttons in;
2. Find your window tabctrl ID in TaskBar;
3. change   window extended style with ModifyStyleEx and WS_EX_TOOLWINDOW;
4. Use TabCtrl_DeleteItem to delete your tabctrl in TaskBar

   
0
 

Author Comment

by:everlast
ID: 1326237
thanx...  I've allready found an answer though, your answer covers my question, but fails to add a button in the taskbar when I remove the WS_EX_TOOLWINDOW style. What I realy needed to do was hide the window with ShowWindow, modify the style, the show it again.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
mixString challenge 36 130
canBalance challenge 34 96
"Black Box" Testing of Control System Software 2 69
Bartender label printing - switch on and off graphics 3 54
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

792 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question