Sorry brothers, I was never intended to hurt your feelings through my reply. Please forgive me.
I proceeded a little starting from scratch...
Defined the systray class as form and on it added objects like editbox and command button.
Defined a menu and added 2 bars -
1 for email and
1 for exit
Passed Menutextismpr= .T.
and using showmenu() wrote the rightclick procedure.
On leftclick displayed the form on the screen and on right click shown the menu options,
Still what I am willing to accomplish has not been fulfilled ie.
1. To keep the balloon tip open until it is closed.
Reading the document about systray class, I concluded that it in not possible.
Please help me to solve this issue- to keep the balloon tip up always until the user closes it.
my codes:
Parameters pcNotification
pcNotification= Iif(Empty(pcNotification),'',Alltrim(pcNotification))
Set Classlib To Home(1)+ 'samples\solution\toledo\systray' Additive
Public oForm,lcPath,lcSystr
lcPath= Addbs(Justpath(Sys(16)))
Set Default To (lcPath)
oForm= Createobject('DisplayNotification')
oForm.Show()
Release Classlib Home(1)+ 'samples\solution\toledo\systray'
Read Events
Return
Define Class DisplayNotification As Form
Width= 250
Height= 100
ShowWindow= 2
Autocentre= .T.
MaxButton= .F.
Icon= Home(1)+ 'Graphics\Icon\Mail\Mail03.ico'
Caption= 'Email Notification!'
Name= 'Form1'
Add Object SysTray1 As Systray With ;
TipText= 'Email Notification!',;
IconFile= Home(1)+ 'Graphics\Icons\Mail\Mail05A.ico'
Add Object Edit1 As EditBox With;
Height= 100,;
Left= 12,;
Top= 10,;
Width= 200,;
Borderstyle= 0,;
FontBold= .T.,;
Forecolor= Rgb(0,0,255),;
Readonly= .T.,;
Value= '',;
ScrollBars= 0
Add Object cmdHide As CommandButton With;
Top= 65,;
Left= 180,;
Height= 20,;
Width= 60,;
backcolor= Rgb(0,255,0),;
autocenter= .F.,;
MousePointer= 15,;
Caption= 'Hide'
Procedure Init
Local m.myvar
WITH Thisform.SysTray1
.ShowBalloontip(pcNotification,'Notification!',1)
Set Cursor Off
TEXT To Thisform.Edit1.Value textmerge NoShow
<<pcNotification>>
<<datetime()>>
ENDTEXT
set safety off
Strtofile(thisform.edit1.value,lcPath+ 'lcSystr1.mpr')
ENDWITH
Text to m.myvar Noshow
Define Popup Rtclk shortcut Relative From Mrow(), Mcol()
Define Bar 1 of Rtclk Prompt 'Go To Email'
Define Bar 2 of Rtclk PROMPT 'Exit'
On Selection bar 1 of Rtclk Messagebox('Yet to code...')
On Selection Bar 2 of Rtclk Clear Events
Activate Popup Rtclk
ENDTEXT
Set Safety Off
Strtofile(m.myvar, lcPath+'lcSystr1.mpr')
Endproc
Procedure SysTray1.IconClickEvent
Thisform.Show()
If Thisform.WindowState= 1
Thisform.WindowState= 0
Endif
This.SetForegroundwindow(Thisform.HWnd)
ENDPROC
Procedure SysTray1.IconRightclickevent
With Thisform.SysTray1
.showmenu(lcPath+ 'lcSystr1.mpr')
.MenuTextIsMpr= .T.
Endwith
Endproc
Procedure
cmdHide.Click
Thisform.Hide()
Endproc
Procedure Edit1.DblClick
Thisform.Hide()
Endproc
Procedure QueryUnload
Clear Events
Endproc
Enddefine