Solved

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

Posted on 1998-06-18
5
159 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

Industry Leaders: 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

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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

705 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