Solved

How can I make an Icon at the TaskBar? ie. the volume control!

Posted on 1998-06-18
5
157 Views
Last Modified: 2011-09-20
I'm making an app that i need to put an icon at the Windows TaskBar, but i don't think how to do.
0
Comment
Question by:chuckwicked
  • 2
  • 2
5 Comments
 
LVL 5

Expert Comment

by:ronit051397
ID: 1353702
You mean on the system tray?
0
 
LVL 1

Expert Comment

by:Greedy
ID: 1353703
if you want to associate an icon with the application go to
Project | Options then click on the Application tab and press the load icon button.

if you want to add the icon to the system try I sugest you get a component called ASTrayIcon it is based on the RxLibraries and is available from DSP (http://sunsite.icm.edu.pl/delphi/) Or tell me this is what you want and I'll give you the source.

if you want to create an entry in the start menu you can copy a shortcut into a directory under <\Windows\Start Menu>

0
 
LVL 1

Expert Comment

by:Greedy
ID: 1353704
oh BTW the system tray is that little bevel on the right side of the start bar and it usualy has a clock in it.
0
 
LVL 3

Expert Comment

by:Matvey
ID: 1353705
Yes, there are lot's of components that put an icon to the system tray.

The best is to look at torry.rimini.com -easy to find there what you need...
0
 
LVL 5

Accepted Solution

by:
ronit051397 earned 100 total points
ID: 1353706
   Place 3 buttons for Add, Delete and modify the Icon in the TaskBar.
    Place a Popup menu with some items and write the following code:

    uses ShellAPI;
    .
    var IconData :TNotifyIconData;
    ..
    procedure TForm1.bbAddClick(Sender: TObject);
    begin
      with IconData DO
      begin
        cbSize := SizeOf(IconData);
        uFlags := NIF_ICON OR NIF_TIP OR NIF_MESSAGE;
        uID := 0;
        Wnd := Handle;
        szTip := 'This is my Application'+#0;
        hIcon := Application.Icon.Handle;
        uCallBackMessage := WM_USER+$10;
      end;
      if Shell_NotifyIcon(NIM_ADD,@IconData) then MessageBeep(0);
    end;

    procedure TForm1.bbModifyClick(Sender: TObject);
    begin
      with IconData do
      begin
        szTip := 'app is modified'+#0;
        hIcon := LoadIcon(0,IDI_ASTERISK);
      end;
      if Shell_NotifyIcon(NIM_MODIFY,@IconData) then MessageBeep(0);
    end;

    procedure TForm1.bbDeleteClick(Sender: TObject);
    begin
      if Shell_NotifyIcon(NIM_DELETE,@IconData) then MessageBeep(0);
    end;

    procedure TForm1.WndProc(var MyMessage: TMessage);
    var CursorPos: TPoint;
    begin
      IF MyMessage.Msg = WM_USER+$10 THEN
      CASE MyMessage.LParam OF
      WM_RBUTTONUP :
      BEGIN
        GetCursorPos(CursorPos);
        PopupMenu1.Popup(CursorPos.X, CursorPos.Y);
      END;
      WM_LBUTTONDBLCLK :
      ShowMessage('This is my application');
      END;
      INHERITED WndProc(MyMessage);
    end;
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Delphi Dbf export problem to a Visual Foxpro application 6 189
Create Database on Android via Delphi dbExpress 3 90
Delphi 2 59
Delphi: making a BW image transparent 10 38
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question