Help: Hiding dialog window from taskbar. How?
Nikhil Kothari -- nkothari@ics.uci.edu
Sunday, December 01, 1996
Hi everyone,
I am trying to hide my dialog's icon and title from the
taskbar.
I know that WS_EX_TOOLWINDOW will do it, but I
need a system menu and the 3 caption buttons (max., min.
& close). So I think this possibility is ruled out.
By the way I am using MFC, but any windows SDK/
API should also be ok.
[
for mfc-l list:
Environment: VC++ 4.2b, Windows 95
]
Thanks in advance,
=======================================
Nikhil Kothari
Information and Computer Science,
University of California, Irvine
=======================================
Andrew Dalgleish -- andrewd@axonet.com.au
Tuesday, December 03, 1996
----------
From: Nikhil Kothari[SMTP:nkothari@ics.uci.edu]
Sent: Monday, December 02, 1996 08:37
To: MFC Listserv
Subject: Help: Hiding dialog window from taskbar. How?
Hi everyone,
I am trying to hide my dialog's icon and title from the
taskbar.
Windows which are hidden or have a parent don't show in the task bar.
Create yourself a hidden window, and make your dialog a child of that.
Mike B. has an example on his web page.
Andrew Dalgleish
David Lowndes -- David.Lowndes@bj.co.uk
Tuesday, December 03, 1996
> I am trying to hide my dialog's icon and title from the taskbar.
<
The method employed by Mike Blaszczak's stealth example is the only
method I've found to work well. That makes an invisible top level
window the owner of the main frame window. It has one minor drawback
in that the taskbar's Minimize All facility doesn't work, but I think
that you might be able to make it work with a little more code.
You can find Mike's sample stealth.zip at:
http://www.nwlink.com:88/~mikeblas/samples/index.htm.
Dave
Mike Blaszczak -- mikeblas@nwlink.com
Wednesday, December 04, 1996
[Mini-digest: 3 responses]
At 14:36 12/1/96 -0800, Nikhil Kothari wrote:
>Environment: VC++ 4.2b, Windows 95
> I am trying to hide my dialog's icon and title from the
>taskbar.
> I know that WS_EX_TOOLWINDOW will do it, but I
>need a system menu and the 3 caption buttons (max., min.
>& close). So I think this possibility is ruled out.
>
> By the way I am using MFC, but any windows SDK/
>API should also be ok.
Your question, like many on this list, doens't provide enough
background information for a direct answer.
Is "your dialog" just the main window of your dialog-based
application? If so, you'll need to give it a parent that is
a hidden window. A window wont show up in the task bar if it
is hidden, and a window won't show up in the task bar if its
parent is not NULL.
If your dialog is a popup dialog that your application produces,
you just need to properly set the parent of the dialog.
.B ekiM
http://www.nwlink.com/~mikeblas/ <-- trip report central!
95 Honda VFR-750F / 88 Yamaha FZ-700 (damaged) / 94 Mazda RX-7
Serial #00050! / AMA - HRC - VFROC / Wang Dang Wankel
I am bored of this talk. It is time now for the dancing!
These words are my own - I do not speak on behalf of Microsoft.
-----From: "John Addis"
An arguably less kludgey way to do this follows. Assume that hwnd is the
handle of the window you wish to remove from the taskbar. I don't take
credit for this but I also don't remember where I found it. It does work
under NT 4.0 as well.
static const TCHAR szTrayClass[] = _T("Shell_TrayWnd");
static const TCHAR szTaskClass[] = _T("MSTaskSwWClass");
// Get the taskbar's window handle
HWND hwTray = ::FindWindowEx(NULL, NULL, szTrayClass, NULL);
HWND hwTask = ::FindWindowEx(hwTray, NULL, szTaskClass, NULL);
ASSERT( NULL != hwTask );
// Get id of the shell's hook message
UINT nMsg = ::RegisterWindowMessage( _T("SHELLHOOK") );
ASSERT( NULL != nMsg );
// Fake destruction of the window
::PostMessage(hwTask, nMsg, HSHELL_WINDOWDESTROYED, (LPARAM)hwnd);
-john
----------
> From: Andrew Dalgleish
> To: 'MFC Listserv' ; 'Nikhil Kothari'
> Subject: RE: Help: Hiding dialog window from taskbar. How?
> Date: Monday, December 02, 1996 5:49 PM
>
>
>
> ----------
> From: Nikhil Kothari[SMTP:nkothari@ics.uci.edu]
> Sent: Monday, December 02, 1996 08:37
> To: MFC Listserv
> Subject: Help: Hiding dialog window from taskbar. How?
>
> Hi everyone,
>
> I am trying to hide my dialog's icon and title from the
> taskbar.
>
> Windows which are hidden or have a parent don't show in the task bar.
> Create yourself a hidden window, and make your dialog a child of that.
>
> Mike B. has an example on his web page.
>
> Andrew Dalgleish
-----From: David Little
Hiding the main frame will effectively hide the icon from the taskbar, =
but an icon will still appear when the user presses to =
task-switch. Hide the mainframe in the InitInstance after the =
CMainFrame is created using ShowWindow(SW_HIDE);
----------
From: David Lowndes[SMTP:David.Lowndes@bj.co.uk]
Sent: Tuesday, December 03, 1996 3:35 AM
To: 'mfc-l@netcom.com'
Subject: RE: Help: Hiding dialog window from taskbar. How?
> I am trying to hide my dialog's icon and title from the taskbar.
<
The method employed by Mike Blaszczak's stealth example is the only=20
method I've found to work well. That makes an invisible top level=20
window the owner of the main frame window. It has one minor drawback=20
in that the taskbar's Minimize All facility doesn't work, but I think=20
that you might be able to make it work with a little more code.
You can find Mike's sample stealth.zip at:=20
http://www.nwlink.com:88/~mikeblas/samples/index.htm.
Dave
| Вернуться в корень Архива
|