Select Page
Codoid Blog

Balloon Tool Tip Trick

Being a leading QA Company, we write blogs on all prominent software testing topics and tools using our real-world experience. So stay sharp by subscribing to our Newsletter.

Sometimes we need to know which is step being executed currently by QTP. Using
automatic timeout message box, we can get that information, but QTP execution is
halted until the message box timeout expires. How to display some useful runtime
information without halting the execution? The only workaround is displaying tool tip
information in Windows System Tray. Let us see how this technique is done using DOT
Net Factory.

Code

Class BalloonTooltipClass
Private oNtfy,oToolTip,oIcon,icon_Path

Private sub Class_Initialize
icon_Path="C:sample.ico"
Set
oNtfy=DotNetFactory.CreateInstance("System.Windows.Forms.NotifyIcon","System.Windo
ws.Forms")
Set oToolTip
=DotNetFactory.CreateInstance("System.Windows.Forms.ToolTipIcon","System.Windows.F
orms")
Set
oIcon=DotNetFactory.CreateInstance("System.Drawing.Icon","System.Drawing",icon_Pat
h)
End Sub

Function Show(ByVal strTitle,ByVal strContent)
oNtfy.Icon=oIcon
oNtfy.BalloonTipIcon=oToolTip.Info
oNtfy.Visible=True
oNtfy.Text = strTitle
oNtfy.BalloonTipTitle = strTitle
oNtfy.BalloonTipText=strContent
oNtfy.ShowBalloonTip(5000)
End Function

Private Sub Class_Terminate
oNtfy.Dispose()
Set oIcon =Nothing
Set oTool =Nothing
Set oNtfy=Nothing
End Sub

End Class

Public BalloonTooltip:Set BalloonTooltip=New BalloonTooltipClass

BalloonTooltip.Show "test title","test content"
wait(15)
  

Comments(0)

Submit a Comment

Your email address will not be published. Required fields are marked *

Talk to our Experts

Amazing clients who
trust us


poloatto
ABB
polaris
ooredo
stryker
mobility