#89724 - 2002-11-26 06:23 PM
Kixforms: ShowInTaskBar and running forms from the system tray
|
Shawn
Administrator
   
Registered: 1999-08-13
Posts: 8611
|
Just opening-up a new thread to start talking about hiding forms from the taskbar and running forms from the system tray.
Firstly though, because the ShowInTaskBar property is a key player in providing this support, thought I would recap the current methods for hiding a form from the taskbar.
After reviewing the literature and searching various development forums, there seems to be two strategies folks use to hide windows from the taskbar.
1) ITaskBarList 2) Hidden Parent
ITaskBarList (ShowInTaskBar)
ShowInTaskBar utilizes a COM interface called ITaskBarList that can be used to enumerate, add, delete items from the taskbar. However, this property was only half-baked in the current release because I couldn't seem to get it to work properly. Then when talking with the bbChecker bunch, suddenly realized that in order to remove a form from the taskbar, it had to already be in the taskbar (a chicken-egg thingy). Armed with this realization, can now go back into the code and re-implement properly. In the short-term, this would seem to be the most sensible way to implement it in ones script.
code:
; ; Method One - ShowInTaskBar ; Break On $Form = CreateObject("Kixtart.Form") $Form.Show(2) ; Minimized $Form.ShowInTaskBar = False $Form.Show While $Form.Visible $=Execute($Form.DoEvents) Loop Exit 1
According to MSDN, there are dependencies on the ITaskBarList COM interface. Heres the details of that but based on some of my testing, not convinced that its accurate. Im running Windows NT4 with IE 4.2 and it doesn't work as expected:
quote:
Minimum DLL Version shell32.dll version 4.71 or later Custom Implementation No Inherits from IUnknown Header shobjidl.h Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0
Although I must say - it does provide a very cool effect in that the form starts from the tray, then maximixes to the normal state.
HIDDEN PARENT
Think Chris broadcasted this strategy first but its used by quite a few Windows apps. It involves first creating a hidden parent form, then creating a child popup form and using that as the main form. Here's an exmaple of that:
code:
; ; Method Two ; Break On $Hide = CreateObject("Kixtart.Form") $Form = CreateObject("Kixtart.Form") $Form.Center $Form.Show While $Form.Visible $=Execute($Form.DoEvents) Loop Exit 1
In terms of running from the system tray, well start by cleaning up ShowInTaskBar a little bit, also will make the WindowState property a read-writeable property to conform more with visual basic dotnet. A writeable WindowState property can be used as a heads-up startup mode for the form ...
|
|
Top
|
|
|
|
#89726 - 2002-11-26 07:18 PM
Re: Kixforms: ShowInTaskBar and running forms from the system tray
|
Chris S.
MM club member
   
Registered: 2002-03-18
Posts: 2368
Loc: Earth
|
I'd be a little leary of adding a function that requires an OS update. Even if I'm a big fan of the 4.71 shell.
|
|
Top
|
|
|
|
#89733 - 2002-11-26 11:22 PM
Re: Kixforms: ShowInTaskBar and running forms from the system tray
|
Jochen
KiX Supporter
   
Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
|
|
|
Top
|
|
|
|
#89737 - 2002-11-27 06:32 AM
Re: Kixforms: ShowInTaskBar and running forms from the system tray
|
Shawn
Administrator
   
Registered: 1999-08-13
Posts: 8611
|
Well, well, well ... finally you Euro-dudes are alive and awake eh ? Leaving us North American boys to mind the store while you go nodding off - lol
The ThreeState property changes the valid return values from the CheckBox.Value like this:
Without ThreeState:
0 - Unchecked 1 - Checked
With ThreeState
0 - Unchecked 1 - Checked 2 - Undefined
-Shawn
|
|
Top
|
|
|
|
#89739 - 2002-11-27 06:39 AM
Re: Kixforms: ShowInTaskBar and running forms from the system tray
|
NTDOC
Administrator
   
Registered: 2000-07-28
Posts: 11631
Loc: CA
|
Hey... you finally going to put that ThreeState option in this build? I asked for that a month ago Boss.
Thanks again for all your continued hard work on this Shawn.
|
|
Top
|
|
|
|
Moderator: Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart
|
0 registered
and 764 anonymous users online.
|
|
|