I've tried to get my systray app to work, but i haven't managed in 4 hours, so i'm kinda tired at it. If anyone could take a look at it, I would be grateful.
if you want any more info, just tell me:confused:
Printable View
I've tried to get my systray app to work, but i haven't managed in 4 hours, so i'm kinda tired at it. If anyone could take a look at it, I would be grateful.
if you want any more info, just tell me:confused:
So what do you want to happen? It shows the icon in the systray, if the form had an icon.
oh yeah, i was just about to write it;
first, i can't click the systray icon (neither left or right), the systray class comes from an example i downloaded, i've attached it if you want to look at it...
You will have to put a menu on your form. The systray icon will then be your form. Code the Form_Activate and Form_MouseMove events to bring up your menu. A little example is attached.
:wave:
i'll check the dl soon, but the thing is that i have a menu, but the actions which should occur when the trayicon is clicked, doesn't seem to work...
the example you submitted used the form for all code, i'm not very good at VB, so i can't make an module/class for it, which i want...:confused: :sick:
also, i doesn't seem to be able to switch the borderstyle of the form, i can't turn of borderstyle (set it to none), it still shows a border. Does anyone know how to fix this?
somehow, the menu and handling of mosue actions for the systray have gotten to work, but i still have the problem with the form having a titlebar, even when i turn it off (set borderstyle to '0 - None'). i've compiled the app, and tested on another computer, and the titlebar also shows on it, so i don't think it's my computer, but VB who's the bad guy here..
Any advices?
Here is a perfect systray example.
This doesn'r "hijack" the form for mouse movements. This creates it's own window.
This example allows you to have an animated icon in the systray, also it has the ability to add dynamic menus at runtime.
Hope this of some use.
A demo project is included.
http://www.vbforums.com/showthread.p...ka+and+systray
Woka
Damn! :( Just checked that zip file. It's my old version that DOES hijack a form. Bugger :(
Have better code at work. Sorry.
Will post that on tuesdasy.
Sorry again.
WOka
does anyone know a good systray module/class that supports tooltips, icon-changing, mouse-clicking actions and is kinda simple (so you don't have to have much code in the form that has the systray)? I've looked at PSC, but couldn't find any advanced, but still simple code...
OK...here's a rough example I have knocked up.
Systray is NEVER easy as it involves API and subclassing :(
Right this example, DOESN'T use a form for the systeay.
It creates it's own window. this is a much better way.
This example handles icon changing...to do this just change the Icon property of the sytray object.
It also handles tooltip text for you systray icon, plus ALL mouse events.
The demo app is a bit lacking, but I am sure you can change this tomscroll the icon etc. The code is there in the systray class, but I just didn't add the code into the form, you'll learn faster if you do this.
To scroll the icon do:
Where mlngIcon is the position of the icon in the image list.VB Code:
Private mlngIcon As Long Private Sub Timer1_Timer() mlngIcon = mlngIcon + 1 If mlngIcon > 10 Then mlngIcon = 1 End If Woof.Icon = mlngIcon End Sub
Setting the timer interval speeds/slows down the icon animation.
Hope this helps.
Woka
thanks, i'll try it out soon :D
U have to know that when subclassing in the VB ide, things can go wrong and when they do, VB will terminate :(
This is one of the problems with subclassing.
To get around this, what you can do is add those classes and modules to an activeX DLL, and compile the sytray code into a DLL.
This make using it way easier in VB as the VB IDE won't deal with the subclassing anymore.
When you add them to the new project you will have to set the Systray Class to be PUBLIC. Then compile.
Woka