Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Minimize to TNA

Posted on 1998-10-05
1
Medium Priority
?
252 Views
Last Modified: 2010-04-06
Hi,
I write a Program that usually works automatically in the Background of Win32-System. So I think, the Field in the standard Taskbar of Windows 95 etc. does only disturb the User. Now, I'm thinking about to minizime it down to a simple Icon on tha TNA. (Task Notification Area, hoping this is what I mean, the Space where usually the Win32-Clock, the Speaker-Icon and, as the Case maybe, the ICQ-Flower is) I don't know anything about Programming such Application, I wonder if it's possible to minimize the Application from a normal PullDown-Menu. After a Click on the Icon, the Program should automatically maximize itself.

Thanx :)
0
Comment
Question by:omsec
[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
1 Comment
 
LVL 1

Accepted Solution

by:
AndersWP earned 140 total points
ID: 1341798
What you want to do is not particulary difficult. You need to use the Shell_NotifyIcon API function to display an icon in TNA (or System Tray, as I believe the officiel name is).

To hide your application and in stead show an icon in the TNA, do the following:
1. Hide all your forms. This will remove your program from the main task bar.
2. Call Shell_NotifyIcon(NIM_Add,@NotifyIconData), where NotifyIconData is a record of the predefined type TNotifyIconData. This record contains information about the icon you want to show in the TNA. The fields of the record should be set as follows:

    cbSize:=Sizeof(NotifyIconData);
    Wnd:=Handle of window to receive notifications when the TNA icon is clicked
    uID:=Integer ID of your icon. This is just a number you pick.
    uFlags:=NIF_ICON Or NIF_MESSAGE Or NIF_TIP;
    uCallbackMessage:=Message ID of the message you want sent to you when the icon is clicked. Use WM_USER+somenumber less than $4000
    hIcon:=Icon.Handle;  Handle of the icon you want to be shown in the TNA
   szTip: 0-terminated string containing the hint text shown when the mouse cursor is placed on the icon.

After doing this, every time the user clicks the icon, you will receive a message to the form with the handle you passed in NotifyIconData record. The LParam parameter of the message will contain ID of the event that happened to the icon, e.g. WM_LBUTTONDOWN for a left mouseclick.

To remove the icon from the TNA, call  Shell_NotifyIcon(NIM_Delete,@NotifyIconData);

I hope this will help you. If you need it, I can send you some sample code.

Regards,
AndersWP


0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
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…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

670 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