Board index » delphi » System Tray, how to place application icons there?

System Tray, how to place application icons there?

I cannot use this function, something must be missing.
What units are in the uses clause for this to work?

I can't find the declarations for TNotifyIconData for example.

(I am using Delphi4).

/Bo

On Sun, 27 Feb 2000 12:39:30 GMT, "Jorge Luis De Armas Garca"

Quote
<jldear...@yahoo.com> wrote:
>You can use this functions

>const
>   WM_NOTIFYSTATUSICON = WM_USER+1;

>// AddIconToTaskBar - adds an icon to the taskbar status area.
>// Returns TRUE if successful or FALSE otherwise.
>// hwnd - handle of the window to receive callback messages
>// ID - identifier of the icon
>// Icon - handle of the icon to add
>// Tip - ToolTip text
>function AddIconToTaskBar(      hwnd: HWnd; ID: Cardinal; Icon: HIcon;
>                          const Tip: string): Boolean;
>var
>  NID : TNotifyIconData;
>begin
>  with NID do begin
>    cbSize := SizeOf(TNotifyIconData);
>    Wnd := hwnd;
>    uID := ID;
>    uFlags := NIF_MESSAGE or NIF_ICON or NIF_TIP;
>    uCallbackMessage := WM_NOTIFYSTATUSICON;
>    hIcon := Icon;
>    StrPLCopy(szTip, Tip, SizeOf(szTip))
>  end;
>  Result := Shell_NotifyIcon(NIM_ADD, @NID);
>end;

>// DeleteIconFromTaskBar - deletes an icon from the taskbar
>//     status area.
>// Returns TRUE if successful or FALSE otherwise.
>// hwnd - handle of the window that added the icon
>// ID - identifier of the icon to delete
>function DeleteIconFromTaskBar(hwnd: HWnd; ID: Cardinal): Boolean;
>var
>  NID : TNotifyIconData;
>begin
>  with NID do begin
>    cbSize := SizeOf(TNotifyIconData);
>    Wnd := hwnd;
>    uID := ID;
>  end;
>  Result := Shell_NotifyIcon(NIM_DELETE, @NID);
>end;

>Also you must catch WM_NOTIFYSTATUSICON message in order to response to
>mouse events.

>JL

>Bo Berglund <bo.bergl...@telia.com> escribi en el mensaje de noticias
>38b8fbc0.274010...@nntpserver.swip.net...
>> Probably asked before but I cannot find any reference to how to do it.
>> I want to make my (normally invisible) application display an icon on
>> the system tray so that users can access a setup menu and some other
>> info from this.
>> I have seen many applications that do this, for example PGP,
>> RealPlayer, Windows Volume control etc. But in Delphi4 help there is
>> no reference to the system tray that I can find.

>> Anyone that has any info please email as well as post your help.

>> TIA

>> Bo Berglund
>> Software developer in Sweden
>> bo.bergl...@telia.com

>> PGP: My public key is available at the following locations:
>> Idap://certserver.pgp.com
>> http://pgpkeys.mit.edu:11371

Bo Berglund
Software developer in Sweden
bo.bergl...@telia.com

PGP: My public key is available at the following locations:
Idap://certserver.pgp.com
http://pgpkeys.mit.edu:11371

 

Re:System Tray, how to place application icons there?


For those who haven't found it here is a rundown on the system tray:

http://www.mlink.net/~paradox/Delphi/trayicon.html

/Bo

On Sun, 27 Feb 2000 10:30:26 GMT, bo.bergl...@telia.com (Bo Berglund)
wrote:

Quote
>Probably asked before but I cannot find any reference to how to do it.
>I want to make my (normally invisible) application display an icon on
>the system tray so that users can access a setup menu and some other
>info from this.
>I have seen many applications that do this, for example PGP,
>RealPlayer, Windows Volume control etc. But in Delphi4 help there is
>no reference to the system tray that I can find.

>Anyone that has any info please email as well as post your help.

>TIA

>Bo Berglund
>Software developer in Sweden
>bo.bergl...@telia.com

>PGP: My public key is available at the following locations:
>Idap://certserver.pgp.com
>http://pgpkeys.mit.edu:11371

Bo Berglund
Software developer in Sweden
bo.bergl...@telia.com

PGP: My public key is available at the following locations:
Idap://certserver.pgp.com
http://pgpkeys.mit.edu:11371

Re:System Tray, how to place application icons there?


theres more than one free component (with source) that shows you how to
add an icon to the system tray at the delphi super page
http://delphi.icm.edu.pl/

Sent via Deja.com http://www.deja.com/
Before you buy.

Other Threads