Page 1 of 1 1
Topic Options
#89724 - 2002-11-26 06:23 PM Kixforms: ShowInTaskBar and running forms from the system tray
Shawn Administrator Offline
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
#89725 - 2002-11-26 07:13 PM Re: Kixforms: ShowInTaskBar and running forms from the system tray
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
shawn, did you check your shell32.dll version?
it updates only with IE4.0 and with integrated shell selected...
_________________________
!

download KiXnet

Top
#89726 - 2002-11-26 07:18 PM Re: Kixforms: ShowInTaskBar and running forms from the system tray
Chris S. Offline
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. [Wink]
Top
#89727 - 2002-11-26 07:25 PM Re: Kixforms: ShowInTaskBar and running forms from the system tray
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Just checked and I have the 4.00 shell, so I guess that option wasn't included in our old IE 4.2 package. Yeah, I wasn't happy with the dependency either so will try for an alternate method to hide from taskbar.
Top
#89728 - 2002-11-26 07:32 PM Re: Kixforms: ShowInTaskBar and running forms from the system tray
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
the hidden parent method may need a rework as it does not work the same way as hiding from taskbar.
the child form still gets the focus and in checkers case, that is not wanted result.
_________________________
!

download KiXnet

Top
#89729 - 2002-11-26 07:42 PM Re: Kixforms: ShowInTaskBar and running forms from the system tray
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
well, I think this "running from the system tray excerise" will be a good opportunity to revisit any issues surrounding windowstate, focus and activation while having multiple forms displayed.
Top
#89730 - 2002-11-26 11:14 PM Re: Kixforms: ShowInTaskBar and running forms from the system tray
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
... me didn't even knew that there was a ShowInTaskBar property [Eek!]
_________________________



Top
#89731 - 2002-11-26 11:18 PM Re: Kixforms: ShowInTaskBar and running forms from the system tray
MightyR1 Offline
MM club member
*****

Registered: 1999-09-09
Posts: 1264
Loc: The Netherlands
Me did: http://www.kixforms.freeuk.com/Docs/Properties/showintaskbar.htm

Didn't get any wiser from this...
_________________________
Greetz,
Patrick Rutten

- We'll either find a way or make one...
- Knowledge is power; knowing how to find it is more powerful...
- Problems don't exist; they are challenges...

Top
#89732 - 2002-11-26 11:19 PM Re: Kixforms: ShowInTaskBar and running forms from the system tray
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
jochen, you have the problem of not scrolling the typelibs by yourself.

from kixforms there are some things to be found not even documented.
_________________________
!

download KiXnet

Top
#89733 - 2002-11-26 11:22 PM Re: Kixforms: ShowInTaskBar and running forms from the system tray
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Actually I have it open in a Type Lib viewer ...

eh, what the heck is ThreeState ??? [Eek!]

[Big Grin]

J.
_________________________



Top
#89734 - 2002-11-26 11:42 PM Re: Kixforms: ShowInTaskBar and running forms from the system tray
rclarke Offline
Starting to like KiXtart
*****

Registered: 2001-06-08
Posts: 178
Loc: Oxfordshire, United Kingdom.
ThreeState is an new property planned for manipulating the CheckBox object. When complete, it will permit a checkbox to display the third 'undetermined state', namely a tick on a grey background (but unlike a disabled checkbox, it is still operable).

Rod.

[ 26. November 2002, 23:45: Message edited by: rclarke ]

Top
#89735 - 2002-11-26 11:46 PM Re: Kixforms: ShowInTaskBar and running forms from the system tray
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Here we go :

code:
break on cls

$frm = createobject("kixtart.form")
$frm.caption = "ThreeState"
$chk = $frm.CheckBox("Hello",10,10,100,20)
$chk.ThreeState = true
$frm.Show

while $frm.visible
$=execute($frm.Doevents)
loop

quit

_________________________



Top
#89736 - 2002-11-27 06:26 AM Re: Kixforms: ShowInTaskBar and running forms from the system tray
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
mm...
wonder, should the special state be clickable...
_________________________
!

download KiXnet

Top
#89737 - 2002-11-27 06:32 AM Re: Kixforms: ShowInTaskBar and running forms from the system tray
Shawn Administrator Offline
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 [Wink]

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
#89738 - 2002-11-27 06:39 AM Re: Kixforms: ShowInTaskBar and running forms from the system tray
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
yes...
but you know the installers, or msdn.
when it's undefined, it's childs are defined...

so, could it reversed in that way, that can one disable the clicking to that state but still script it there?
_________________________
!

download KiXnet

Top
#89739 - 2002-11-27 06:39 AM Re: Kixforms: ShowInTaskBar and running forms from the system tray
NTDOC Administrator Offline
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. [Big Grin]

Thanks again for all your continued hard work on this Shawn.

Top
#89740 - 2002-11-27 06:42 AM Re: Kixforms: ShowInTaskBar and running forms from the system tray
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
well, ok.
it's only a matter of:
code:
$frm = createobject("kixtart.form")
$frm.caption = "ThreeState"
$chk = $frm.CheckBox("Hello",10,10,100,20)
$chk.ThreeState = true
$frm.Show
$chk.onclick="if $$chk.value=2 $$chk.value=0 endif"
while $frm.visible
$=execute($frm.Doevents)
loop

_________________________
!

download KiXnet

Top
Page 1 of 1 1


Moderator:  Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 764 anonymous users online.
Newest Members
ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder, M_Moore
17887 Registered Users

Generated in 0.146 seconds in which 0.106 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org