On Tue, 25 Aug 1998 13:33:15 +0100, "Paul McCusker"
Quote:
>Hello
>In windows 95, you have your task bar with your start button and
>applications etc at the bottom of the screen. You also have the icon box
>with background applications and your clock etc at the right of the task
>bar.
>Can anybody point me in the direction of some information on how to have an
>application running in this icon box rather than on the main task bar.
>I am trying to implement a application manager whereas you log into it at
>boot-time and then it sits there until you are ready to start up one of it's
>component applications.
Hi,
It is painfully easy to implement just such the feature you are after.
You only need to use one function, Shell_NotifyIcon.
To use it, you need to have a NOTIFYICONDATA structure, as outlined
below:
Type NOTIFYICONDATA
cbSize As Long
hwnd As Long
uID As Long
uFlags As Long
uCallbackMessage As Long
hIcon As Long
szTip As String * 64
End Type
cbSize
The size of the structure,
hwnd
Handle of the window that receives notification messages
uID
Application-defined identifier of the taskbar icon
(p.s. Your program can have more than one icon in the tray)
uFlags
Set of flags that indicate which other members have valid info
NIF_ICON - the icon is valid (hIcon)
NIF_MESSAGE - the callback message is valid (uCallbackMessage)
NIF_TIP - the tooltip is valid (szTip)
uCallbackMessage
Application-defined message identifier
hIcon
Handle of icon to be displayed in system tray
szTip
String containing a tooltip that is displayed after a certain time
So, you fill in this structure and pass if to Shell_NotifyIcon along
with the action you want to perform. This can be one of three actions:
NIM_ADD
Adds an icon to the tray
NIM_DELETE
Deletes an icon from the tray
NIM_MODIFY
Modifies the properties of an icon
Unfortunatly, this isn't the most straigtfoward thing in the world due
to the way VB works (it's alot easier in VC++), but it can be done (I
have done it).
I've whipped up a quick application that does this, and I'll email the
source to you. (I don't know what version of VB your using. I'll
assume 5.0).
I hope this helps,
Michael Priestman
(remove those spaces for a valid email address!)