Solved

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

Posted on 1998-06-18
5
158 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

726 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