?
Solved

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

Posted on 1998-06-18
5
Medium Priority
?
160 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 400 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

Independent Software Vendors: 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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses
Course of the Month7 days, 21 hours left to enroll

765 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