LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

how to make a graph like windows Task manger in systray

Hello,
I'd like to make something like windows Task manger icon in systray. It show the CPU usage in a simple gragh.
For doing that I think only I should change my icon in a timer event with SetTrayIconAttr (, ATTR_TRAY_ICOFILE,). I want to use a ring picture and load all the images to it.
Unfortunately, SetTrayIconAttr()  only accept  a path for it's icon and can't use GetCtrlBitmap() and load my selected bmp(from ring) to systray.
It is important beacuse I want to encapsulate my images to my source code not live them in Hard disk.
Accesing to hard disk is also slow.

Is it possible to add a function SetCtrlBitmap() for loading icon for systray?

Thanks a lot.

0 Kudos
Message 1 of 4
(3,376 Views)
Hello naderus,
 
One way to solve this is to create an array of paths to your images.  You can then use the InstallSysTrayIcon function and pass an index to the desired image's path.  By using the strings inside the array it will reference a specific path that will allow you to display the appropriate graph based upon the condition of the system.  The array will be indexed, allowing for the correct picture selection.
A_Ryan
AES
National Instruments
0 Kudos
Message 2 of 4
(3,346 Views)

Hi,

Thanks for help. I did this method but still two problem exist.

1- I can't embedded the pictures in my code and distribute them.(like the one I mention with picture ring )

2- The disk access are really slow and time consuming if I load image in my uir and use them with bmp handle it's more efficient.

 

Thanks. 

0 Kudos
Message 3 of 4
(3,330 Views)
naderus,
 
Based upon the parameters of the SetTrayIconAttr() it appears as though this can only accept a path (can not accept a handle).  It does not look like you can use a ring control in this case.  If you would like to decrease the load time you can do two things:
1.  Change the file type to a .ico file
2.  Save the picture in a smaller resolution
 
Both of these should help decrease the load time.  If you can avoid using the SetTrayIconAttr(), and instead load them onto the uir then you could use a picture ring control.
A_Ryan
AES
National Instruments
0 Kudos
Message 4 of 4
(3,295 Views)