1 Attachment(s)
Annimated systray icon...
This code allows you to have your app represented in the systray by any icon.
The following functionality is available:
- Annimated Icon
- Create, delete and edit systray icon menus at runtime.
- Tooltip text on the systray icon
- All systray mouse events are trapped and triggered.
- The systray icon DOESN'T hijack a form, it creats it's own window. more stable, and easier code.
Think that's it.
WOOOOF
Re: Annimated systray icon...
I have tried to add icon on the menu in system tray but is not working, does anyone how know how to write that to show icon on the menu!
Re: Annimated systray icon...
do a search on here. there are many ways to get an icon into a menu, but iy's not the easiest thing.
Woka
Re: Annimated systray icon...
woka, how easy would it be to use this app to access a text file on form load, using inet control. if the app version is higher in the text file, to show the popup notification, if not, then to not show it. similar to the way msn informs of new "updates available" for their software.
Re: Annimated systray icon...
Well if you look in my sig the code for MSN popups is already written, again just some dlls you can add to your app.
Then in your form load event, or where ever do something like:
Code:
Dim intAppVersion As Integer
Dim intNewVersion As Integer
'Get app and new version numbers
If intNewVersion > intAppVersion Then
'code to show popup
End If
This will have nothing to do with the systray component what so ever and must be coded seperatly using my popup message component.
Woka
Re: Annimated systray icon...
Woka,
If I wanted to compile your code into my project to make one .exe file without having to reference the dll file, how do I replace this line:
Code:
Public WithEvents mobjSysTray As vbSysTrayTools.SysTray
Compile-Error. User defined type not defined.
Re: Annimated systray icon...
This is resolved now. I took away the dll name and used the following:
Code:
Public WithEvents mobjSysTray As SysTray
Re: Annimated systray icon...
Hello...
This example is really great.
I have combined this example with my working program, but i have a problem when i try to get my program work on other computer, I get error.
I think it has something to do with library and dll, but anyway I need hellp because i can't get it out...
I have copied my exe file on other computer, and vbSysTrayTools.dll , *.exp , *.lib .
But still i get error and it says :
Run-time error '429'
Activex component can't create object
Re: Annimated systray icon...
First rule when deploying to another PC is use an installer.
You cannot simply copy files to another PC and expect them to work.
You need to register all DLLs and OCXs with windows.
You can do this manually by running the following from a cmd prompt:
To register a DLL:
RegSvr32 C:\MyPath\DllName.dll
To unregister a DLL:
Regsvr32 -u c:\MyPath\DLLName.dll
Alternatively you can learn how to use the Package and Deployment Wizard supplied with VB6. This will create an installer setup package that will install all requied files onto the target PC and register the DLLs and OCXs.
Do a search on VBF for Package and Deployment, loads of posts on how to do it.
Woof
Re: Annimated systray icon...
I tried to write regsvr32 c:\example\vbsystraytools.dll, and it was confirmed,
but the program still dont work...
It is still same error as before...
Re: Annimated systray icon...
Ok, I've manage to create package and I have some trouble with it.
One of error that i get when i try to install that package is that everytime i want to install package on other computer i get message that some files are old and need to be updated and restart computer. When i did that and i confirm the update and restart, it updates and restarts computer and after that, the same message apears and I canot get it to work or complete instalation.
Second error is on same computer that Im testing the program . I tried to install package here and I get error message that i have invalid line in setup information file ... c:\windows\setup.lst
Re: Annimated systray icon...
I tried some stuff, but noting works.
Is it maybe a problem because i have created package in windows vista and now I want to run the package in windows xp ?
I don't know what else to do ...
Re: Annimated systray icon...
The project reference to the vbSysTray project is referenced by project compatibility and not Binary compatibility.
So...for this to work you need to do the following.
1) Build the vbSysTray assembly
2) Remove the reference to the vbSysTray project from the UI project references and then add a new reference to the new vbSysTray.dll DLL assembly.
3) rebuild the UI EXE project.
4) Copy both the UI EXE and the vbSysTray DLL Assembly to the target machine
5) RegSvr32 "C:\MyFolder\vbSysTray.dll"
6) Run the UI EXE
Woof
1 Attachment(s)
Re: Annimated systray icon...
Quote:
Originally Posted by Wokawidget
Like Merri said, I don't think it's possible to place XP icons in the systray using VB6 :(
Woka
Maybe not via an Image list, but you can put XP icons on the system tray for XP & above. All you need is a valid icon handle which can be created from APIs (LoadIcon, CreateIconFromResourceEx, & others for example). A valid 32bpp icon can even be made into a stdPic via the often used PictureFromHandle function posted below if you can't lay your hands on a ready copy. Anyway, anything less than XP will attempt to display it, but obviously it won't display correctly.
Code:
Private Function PictureFromHandle(Handle As Long, picType As PictureTypeConstants) As IPicture
' Purpose: Create a standard picture object from a valid image handle
Dim lpPictDesc As PICTDESC
Dim aGUID(0 To 3) As Long
' convert memory icon to stdPicture
With lpPictDesc
.Size = Len(lpPictDesc)
.Type = picType
.hHandle = Handle
.hPal = 0
End With
'--- fill in magic IPicture GUID {7BF80980-BF32-101A-8BBB-00AA00300CAB}
aGUID(0) = &H7BF80980
aGUID(1) = &H101ABF32
aGUID(2) = &HAA00BB8B
aGUID(3) = &HAB0C3000
'--- create picture from bitmap handle
Call OleCreatePictureIndirect(lpPictDesc, aGUID(0), True, PictureFromHandle)
End Function
Example. The Heart is a 32x32 XP, alphablended icon
Attachment 68671