15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


Q: How to create an application without the taskbar button

ANTONISAMY A MIEL -- antony@cauchy.miel.mot.com
Monday, July 15, 1996

Env: Visual C++ 4.0 on Windows 95

How do I create a SDI application that does not have a taskbar button.
This is easy for dialog based applications as their is a windows style
that does not display dialog based application on the task bar or
when we do a ALT-TAB. Trying to use the same style for an SDI application
does not work.

Can we really remove an application from appearing on the task bar or
in the ALT-TAB list.

Thanks in advance.

regards & bye
- Antony

--------------------------------------------------------------------------------
Antonisamy A.                           Phone : +91 (80) 5598615
Motorola India Electronics Ltd.           Fax : +91 (80) 5598660
"The Senate"                           E-Mail : antony@miel.mot.com
No 33A, Ulsoor Road,
Bangalore - 560 042.

              o    o    o    o    o    o    o    o
               \_o, \_o, \_o, \_o, \_o, \_o, \_o, \_o,
           _____\/)__\/)__\/)__\/)__\/)__\/)__\/)__\/)_____
        ~~~~~~~~~o~~~~o~~~~o~~~~o~~~~o~~~~o~~~~o~~~~o~~~~~~~~~
   
--------------------------------------------------------------------------------




David.Lowndes@bj.co.uk
Thursday, July 18, 1996

[Mini-digest: 2 responses]

> How do I create a SDI application that does not have a taskbar button.
This is easy for dialog based applications as their is a windows style
that does not display dialog based application on the task bar or
when we do a ALT-TAB. Trying to use the same style for an SDI application
does not work.

Can we really remove an application from appearing on the task bar or
in the ALT-TAB list.
<

Anthony,

If your application needs a visible window, I don't know how to keep it
off the Alt+Tab list, but you can stop an application appearing on the
taskbar by having its top level window hidden and implementing the UI
as a child window.

Dave Lowndes
-----From: Shankar Venkataraman 

Hi Antony,

You may consider creating a dummy hidden window as the parent window of 
your application and having all other windows as its children. The shell
does not create
 a taskbar button if the application's main window is hidden.

Shankar

----------------------------------------------------------------------------
--------------
Small things make perfection, but perfection is no small thing.
 
Romance comes and goes, Friendship lasts forever.....
     Find a friend to be romantic with & it will last for eternity
----------------------------------------------------------------------------
--------------
Shankar Venkataraman		Snail Mail : 
Ph : (415)-926-5963 (Work)		38025, Heritage Common, #160
        (510)-794-0624 (Home)		Fremont, CA 94536





ANTONISAMY A MIEL -- antony@cauchy.miel.mot.com
Monday, July 22, 1996

> Hi Antony,
> 
> You may consider creating a dummy hidden window as the parent window of 
> your application and having all other windows as its children. The shell
> does not create
> a taskbar button if the application's main window is hidden.
>
> Shankar

	What is the easiest way of doing this in a MFC based SDI application.
	i.e. Can I still use Appwizard to generate the SDI application and
	modify it to create a dummy invisible window that is not visible in
	the Task Bar.
	If you have some code samples, pass it on to me.

	Thanks for you time,

	Antony
	antony@miel.mot.com 



Kostya Sebov -- sebov@is.kiev.ua
Wednesday, July 24, 1996

[Mini-digest: 3 responses]

I'm sorry I'm answering not the original question but I felt the necessity to
reply.


>   [Mini-digest: 2 responses]
>
>   > How do I create a SDI application that does not have a taskbar button.
>   This is easy for dialog based applications as their is a windows style
>   that does not display dialog based application on the task bar or
>   when we do a ALT-TAB. Trying to use the same style for an SDI application
>   does not work.
>
>   Can we really remove an application from appearing on the task bar or
>   in the ALT-TAB list.
>   <
>

The following CMainFrame::PrecreateWindow overridable code in your SDI app
will hide the window from the TaskBar as well as Alt-Tab list inclusion.

BOOL CMainFrame::PreCreateWindow( CREATESTRUCT& cs )
{
    cs.dwExStyle &= ~WS_EX_APPWINDOW;
    cs.dwExStyle |=  WS_EX_TOOLWINDOW;

    //TODO: Extra cs modification -- if necessary.


    return CFrameWnd::PreCreateWindow(cs);
}

Sincerely,
--- 
Kostya Sebov. 
----------------------------------------------------------------------------
Tel: (38 044) 266-6387 | Fax: (38 044) 266-6195 | E-mail: sebov@is.kiev.ua
-----From: David Noble 

You might try using the WS_EX_TOOLWINDOW style. A tool window does not =
appear in the task bar or in the window that appears when the user =
presses ALT+TAB. However, I'm not sure how this will affect your choice =
of window border. A tool window has a title bar that is shorter than a =
normal title bar, and the window title is drawn using a smaller font.
-----From: "Mike Blaszczak" 

>> Hi Antony,
>> You may consider creating a dummy hidden window as the parent window of 
>> your application and having all other windows as its children. The shell
[...]
>> Shankar

This is bad advice.  If the parent window of your application is hidden, the 
rest of your application's windows will be hidden, too, unless you carefully 
juggle window coordinates.  Remember that a window, if it has WS_CHILD, is 
positioned relative to its parent.  Certainly, you don't want to override 
everything in CFrameWnd that assumes the coordinates going by are relative to 
some arbitrary hidden window instead of relative to the desktop!

You should, instead, specify an _owner_ window for your main frame.  This is 
very different than a parent. If you don't understand the difference, please 
read up on it because it is a very fundamental issue that is necessary for a 
developer to understand the way Microsoft Windows works.

 > What is the easiest way of doing this in a MFC based SDI application.

I'd start by having a few beers.  Then, I'd go on to overriding 
PreCreateWindow() of my CMainFrame.

> i.e. Can I still use Appwizard to generate the SDI application and
	> modify it to create a dummy invisible window that is not visible in
	> the Task Bar.

D'accord!

 > If you have some code samples, pass it on to me.

Please see the samples off of my home page at http://www.nwlink.com/~mikeblas. 
 There's one called STEALTH.ZIP.

>	antony@miel.mot.com 

Please send me a digital cellphone.  Thanks in advance.

.B ekiM





| Вернуться в корень Архива |