473,322 Members | 1,703 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Help need with icon

Hi, i have the following code that places an icon in the system tray. However when i run the program, the icon appears but then dissapears straight away as soon as my mouse touches it. can anyone help me to stop this?


thank you!!!

Expand|Select|Wrap|Line Numbers
  1.  
  2. __fastcall TForm1::TForm1(TComponent* Owner)
  3.         : TForm(Owner)
  4. {
  5.  
  6. Form1->Handle;
  7.  
  8.        HWND hWnd;
  9.  
  10.   NOTIFYICONDATA nid = {0};
  11.  
  12.     nid.cbSize         = sizeof(nid);
  13.     nid.uID            = 100;
  14.     nid.uFlags         = NIF_ICON;
  15.     nid.hIcon          = LoadIcon(NULL,IDI_ASTERISK);
  16.     nid.hWnd = Form1;
  17.     // Add the notification to the tray.
  18.     Shell_NotifyIcon(NIM_ADD, &nid);
  19.  
  20.  
  21.  
  22. }
  23.  
  24.  
Jan 20 '08 #1
1 1175

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: One Handed Man [ OHM ] | last post by:
If this is duplicated, I'm sorry because I cant find the original post I made today Anyway . . Now its my turn to ask a question I want to develop an app which will run in the system tray....
3
by: Tony Lugg | last post by:
I have an application with a document management form. When users add documents to the form, I call the API function SHGetFileInfo to get the associated large and small icons for the file. These...
5
by: SStory | last post by:
Hi all, I really needed to get the icons associated with each file that I want to show in a listview. I used the follow modified code sniplets found on the internet. I have left in...
2
by: SStory | last post by:
Here is the situation. I want to display Icons, Type of file etc from a file extension. Upon initial program load I may only need icons for certain files. But other operations will require...
14
by: Brett Sinclair | last post by:
Hello everybody I'm still on the learning curve here...and from what I read, I created inherited datagrid class so I could have icons, combobox...etc in the columns of my datagrid. The grid...
2
by: Arvi | last post by:
Hello, Im quite new to c# windows application. i need to write a application which stays on the systray and listens to the SQL Table. (when the value is inserted as 0 - done thru Dataset and...
2
by: shakthi | last post by:
hi, Am trying to create a dialog box in MFC that has two buttons and an edit control.When i click button1,a dialog box that displays all the files in the system is displayed.when i select a...
0
by: =?Utf-8?B?cnViZW4=?= | last post by:
Hi developers, Maybe this will sound silly, but I need help placing an icon in a menu when setup is build in .Net through a setup project. Really what I need is indicate the help icon (html help...
0
by: =?Utf-8?B?cnViZW4=?= | last post by:
Hi developers, Maybe this will sound silly, but I need help placing an icon in a menu when setup is build in .Net through a setup project. Really what I need is indicate the help icon (html help...
1
by: Jay | last post by:
Hello, Not sure if this is the group to post this or not, but I need some help. I'm working on a website and they want to add the little icon that is to the left of the "http://www............."...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.