Public gox gox = CreateObject("ShowMsg","Infecting computer... please wait.") gox.Show() *======================================================================================== * Message class *======================================================================================== Define Class ShowMsg as Toolbar BackColor = Rgb(255,255,217) ControlBox = .F. Sizable = .F. Movable = .F. Themes = .F. Caption = "" Procedure Init LParameter tcText *-------------------------------------------------------------------------------------- * Add objects *-------------------------------------------------------------------------------------- This.AddObject("cnt","Container") This.cnt.BackStyle = 0 This.cnt.BorderWidth = 0 This.cnt.Height = 80 This.cnt.AddObject("Label1","label") This.cnt.Label1.Move(26,26,26,26) This.cnt.Label1.FontName = "Verdana" This.cnt.Label1.FontSize = 13 This.cnt.Label1.BackStyle = 0 This.cnt.Label1.ForeColor = Rgb(0,0,160) This.cnt.Label1.Visible = .T. This.cnt.Visible = .T. *-------------------------------------------------------------------------------------- * Determine default text *-------------------------------------------------------------------------------------- Local lcText If Vartype(m.tcText) == "C" lcText = m.tcText Else lcText = "Please wait..." EndIf *-------------------------------------------------------------------------------------- * Determine the length of the windows *-------------------------------------------------------------------------------------- Local lnLen lnLen = TxtWidth(m.lcText,"Arial",14,"B") * Fontmetric(6,"Arial",14,"B") This.cnt.Width = 25 + m.lnLen + 25 This.cnt.Label1.Caption = m.lcText This.cnt.Label1.Width = m.lnLen *-------------------------------------------------------------------------------------- * Position on the screen centered. *-------------------------------------------------------------------------------------- This.Move( ; (_Screen.Width - This.cnt.Width - 6) / 2, ; (_Screen.Height - This.cnt.Height - 20) / 2 ; ) EndProc EndDefine