Link to home
Start Free TrialLog in
Avatar of scce
scce

asked on

CFrameWnd icon doesn't appear in Taskbar

I've created a setup-style program with the background screen-filling wnd derived from CFrameWnd (MFC 2.5).  The icon and text doesn't appear in the taskbar under Windows 95 although it appears correctly in the Task-switcher (ALT-TAB).

What's going on here? Normal 16-bit MFC apps with CFrameWnd frames normally appear in the taskbar.  What is it that makes a top-level window appear or not?
ASKER CERTIFIED SOLUTION
Avatar of AVaulin
AVaulin
Flag of Ukraine image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Sorry, AVaulin. I found some 16-bit applications whose frame windows do not have WS_CAPTION style (no title bars) still appear in the taskbar. I do not know the exact reason.

I said about WS_CAPTION but may be WS_SYSMENU is what I must say. I recently wrote program. MainFrame has only WS_VISIBLE and WS_BORDER styles. Only window text appear in TaskBar (icon appear with text only if ALT-TAB pressed).
Avatar of scce
scce

ASKER

It seems to be a combination of WS_SYSMENU and WS_CAPTION styles, I've just tried it.  Now I've just got to try and remove the caption without removing the taskbar button!

Thanks both for your help.
A taskbar button is placed on the taskbar whenever an application creates a unowned primary window. To ensure that the window button is placed on the taskbar, create the window by calling CreateWindowEx and include the WS_EX_APPWINDOW style. To prevent the window button from being placed on the taskbar, create the window by calling CreateWindowEx and include the WS_EX_TOOLWINDOW style. As an alternative, you can create a hidden window and make it the owner of your primary window.The window button typically contains the application icon and title. However, if the application does not contain a window menu,the window button is created without the icon.
To remove application from task switcher you have to hide the window.
Avatar of scce

ASKER

Thanks Lizer,

I'll try that and see where I get to.  I was faced with the choice of either no taskbar button or having a meaningless caption bar at the top of my setup screen background.

It sounds lilke you've given me the answer I needed.


There are no WS_EX_APPWINDOW and WS_EX_TOOLWINDOW styles in 16-bit SDK.
Avatar of scce

ASKER

I found them in the Visual C++ 4.0 header files and just used the WS_EX_APPWINDOW style as a manifest constant.  It works fine as a 16-bit app under Windows 95 (I assume the style is ignored by Windows 3.1 as undefined, though I haven't tried that yet).  In any case it's irrelevant to 16-bit Windows, with no taskbar.  Thanks again, Lizer.