Originally posted by: Paolo Vernazza
I used Dominik Filipp's method to have a dialog without taskbar icon, but I've a problem:
Pressing alt+tab in the task list my program has a standard icon; I tryed inserting
dMainFrameOwner.SetIcon(::LoadIcon(NULL,MAKEINTRESOURCE(IDR_MAINFRAME)),TRUE);
in the CMyApp::InitInstance() function but I didn't get any result
Originally posted by: Dominik Filipp
BOOL CShowHideApp::InitInstance()
// set the dialog as a parent of CMainFrame window
m_pMainWnd = &dlg
return FALSE;
... Another discussion is the system tray logic. Warren Young in the previous comment writes that it seems to be difficult to collect both taskbar and system tray logic meaningfully together using my design-pattern. Actually, it doesn't. In the project example below I achieved the same goal as Warren did and, moreover, I'm still able to dynamically show/hide the taskbar button from within the CDialog application.
The problem of the latest discussion is that it's a bit out of scope of this article. Problems described earlier concerns the system tray logic and not the taskbar behavior itself as written in my article. Warren writes:
To clarify all these problems I've prepared the project considering our discussion. It's available on:
After arrival from my long-term project journey I've noticed a hot discussion about taskbar-system tray behavior in CDialog-based application. In fact the situation in these application is similar to the frame-based appplications. The only difference is to put the initialization code of dynamic-showing/hiding-of-taskbar-button into the InitInstance() method instead of PreCreateWindow() as seen here:
{
// Create the main owner invisible window.
// dMainFrameOwner - CDialog object mapped to the resource dialog template...,
// could be any type of window; this, however, is a quick solution.
CDialog dMainFrameOwner;
BOOL bOwnerCreated = dMainFrameOwner.Create(IDD_FRAMEOWNER);
if (bOwnerCreated) dMainFrameOwner.ShowWindow(SW_HIDE);
CShowHideDlg dlg(bOwnerCreated ? &dMainFrameOwner : NULL);
dlg.DoModal();
}
"Instead of all that trickery with invisible "owner" windows and twiddling style bits, we just hide the main dialog when we get minimized."
But how does all this concern taskbar button logic being discussed here? If we are able to solve a particular problem bypassing the taskbar 'overhead' not necessary there, then it's OK. But this is not the case. The mentioned citation can, however, be confusing for those trying to implement the taskbar behavior in the sense mentioned here. Actually, this is not a trickery but the legal guidelines described in MSDN as well. The only trickery concerns dynamic showing/hiding of the taskbar button at application runtime. Another way (as I know) is only to use the appropriate COM interface.
Originally posted by: B. Keele
When I minimize the application I have no problems on
I tried to get a pointer to the ITaskbarList and dynamically
Thanks.
I know this is an old discussion but in my own dialog based
application, I only want to hide the application button on
the task bar when the application is minimized and I don't
want the application invisible to the Alt-Tab window.
putting the icon into the system tray but I also want the
taskbar button to disappear and that is proving difficult.
add and remove the application from the list but I can't
even get the compiler to recognize the ITaskbarList
interface name. Am I missing a header file or am I just
going about it the wrong way?
Originally posted by: David
Hi,
probably can you help me with my problem.
I want to change Window Styles so that there are only
MINIMIZEBOX and MAXIMIZEBOX, without SYSTEMMENU and
CLOSE Button.
Disabling WS_SYSMENU causes automatically desabling
of all Buttons (WS_MINIMIZEBOX, WS_MAXIMIZEBOX and Close Button too).
For a worst case SYSMENU can remain but how desable the
close Button?
Is there a tricky approach that allows to solve my problem?
Thanking forward for your help,
David
ReplyOriginally posted by: Ciprian Pavel
Hiding from taskbar is interesting ,but wouldn't be more beautiful if the program hides like NetBus or SoftIce?
In Win98 when you press Ctrl+Alt+Del or in WinNT with TaskManager you can see it?
Can you give me an answer about this?
Originally posted by: Marc Schneider
I have a Dialogbased Appl. in which I want to hide the button in the taskbar ( beside the START button ) !
PreCreateWnd is not executed in a Dialogbased Appl. !
Thanks
Marc
Hi,
How can I make this ?
Originally posted by: NoTears PIG
I can't understand the variable m_MainFrameOwner.
Is it defined in CMainFrame? and what's type?
Please tell me about this. Would you like to give me
this project total?
Thanks.
Originally posted by: bob lind
Like this:
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
If you would like to simply remove the taskbar button and
never want to restore it you can set the extended style to
include WS_EX_TOOLWINDOW in the precreate call.
{
cs.dwExStyle |= WS_EX_TOOLWINDOW;
Originally posted by: Oscar
Thank's for this.
One comment for somebody who will try to make app without showing it on taskbar based on the modal dialog
(Dialog based appliacation) creating some hidden Wnd as a mainWnd and then DoModal to show the DLG. It
doesn't shut down on NT if you shutting down system - it is hanging unless you close it manually. I guess
this is because if you have Modal dialog and it is not the main app NT expect you to first close the Modal
dialog. However on 95/98 it shuts down fine.
So if your app is based on a dialog and you want it invisible on the task bar and the app will be running
all the time until you close WinNT don't do DoModal for the dialog..you will get a lot of complains from
customers....
Just let you know.
Reply