Break Off
$System= CreateObject("Kixtart.System")
If Not $System
$nul= MessageBox("KiXforms Classic Not Installed This Script Will Now Close.","Error",16)
Quit()
EndIf
$form1 = $System.Form()
$Form1.FormBorderStyle = 1
$Form1.MaximizeBox = 0 ;False
$Form1.MinimizeBox = 0 ;False
$Form1.ControlBox = -1 ;True
$Form1.StartPosition = 1 ;FormStartPosition_CenterScreen
$Form1.Size = $System.Size(625,260) ;(Width,Height)
$Form1.Text = "MSL"
$button1 = $form1.Controls.ToolButton()
$button1.Text = "Yes"
$button1.OnClick = "ExitingToDeskTop()"
$button1.Location = $System.Point(100, 200)
$button2 = $form1.Controls.ToolButton()
$button2.Text = "No"
$button2.OnClick = "ExitingApp()"
$button2.Location = $System.Point(400, 200)
;$Label1 = $form1.Label()
$Label1 = $form1.Controls.Add("Label")
$Label1.BorderStyle = 0 ;FixedSingle
$Label1.Font = $System.Font("Microsoft Sans Serif",14.25,1) ;Bold
$Label1.Left = 10
$Label1.Text = "Test text 1"
;$Label1.Text = LoadIniPolicy()
$Label1.Top = 10
$Label1.Width = 600
$Label1.Height = 150
;$Label2 = $form1.Label()
$Label2 = $form1.Controls.Add("Label")
$Label2.BorderStyle = 0 ;FixedSingle
$Label2.Font = $System.Font("Microsoft Sans Serif",14.25,1) ;Bold
$Label2.ForeColor = $System.Color.FromName("Red")
$Label2.Left = 10
$Label2.Text = "Test text 2"
;$Label2.Text = $strmsg2
$Label2.Top = 150
$Label2.Width = 600
$Label2.Height = 50
$button1.default = true
$button2.cancel = true
$Form1.Show()
$Form1.SetFocus()
$Form1.OnDeactivate = "RegainFocus()"
While $Form1.Visible
$Nul = Execute($Form1.DoEvents)
Loop
Exit 0
;*************************************** REGAINS FOCUS ON FORM IF CLICKED OFF **********************************
Function RegainFocus()
$Form1.WindowState = 1
$Form1.WindowState = 0
EndFunction
;*************************************************************************************************************************
;*************************************** QUIT APPLICATION AND SHUT DOWN PC **********************************
Function ExitingApp()
$= $System.MessageBox.Show("shutting you down")
$Form1.Hide()
Endfunction
;*************************************************************************************************************************
;*************************************** QUIT APPLICATION GIVE USER ACCESS **********************************
Function ExitingToDeskTop()
$= $System.MessageBox.Show("Continue to Desktop ...")
$Form1.Hide()
Endfunction
;*************************************************************************************************************************