Hi 04nunhucks and Welcome to KiXtart.org and KiXforms,

Just a few small suggestions;

It is better to create separate Functions rather then using ‘Goto/Return’ statements.

"Kixtart.Form" has been replaced with "Kixtart.System".

Once the ‘$System’ object has been created it is a good idea to verify that it was actually created, so that if it was not created then you will know that there is a problem with the install and or functionality of KiXforms.

For the form to function you must have a loop for the doevents() of the form.

Also what ver of KiXforms are you using?
You can get the most current ver over at KiXforms.org

This is your script/form with the modifications:

Code:

;***************************************************************
;***************************************************************
;**
;** Network Login
;** Netlogon.kix
;**
;** Dependencies:
;**
;** Kixforms.dll
;**
;** V.3.2.01 28/12/2004
;** V.3.2.02 13/01/2005 Check for and register .DLL
;** V.3.2.03 14/01/2005 Map network drives
;** V.3.2.04 15/01/2005 Log user/station details
;** V.3.2.05 26/02/2005 Fixed problem with incorrect drive mapping displayed
;** V.3.2.06 26/02/2005 Removed display name from greeting
;** V.3.2.07 20/03/2005 Added AV call for Somerset sites
;** V.3.2.08 07/04/2005 Added RegFixes section. Checkfor and install KB888254
;** V.3.2.09 24/05/2005 Split into seperate scripts
;**
$strVersion = "V.3.2.09(b)"
;**
;***************************************************************
;***************************************************************

;** Dim some global vars.

Dim $frmForm
Dim $fraBanner, $fraForm
;Dim $prgProgress
Dim $Hour

;** Set some global vars.

$LSD = @LServer + "\netlogon"
$WaitTime = 1 ;** Time to wait after each task
$DoProgressCalls = 25 ;** Maximum times DoProgress is called
$Step = 100/$DoProgressCalls ;** Increment progress bar
$Blanker = " " ;** Blank captions

;******************
;** START HERE **
;******************

CheckDLL()
DOFORM()

Call "$LSD\MapDrives.kix"

Exit 1

;**************
;**END HERE **
;**************


;*************************************************************
;** SUBS BELOW **
;*************************************************************


Function CheckDLL()

;*************************************************
;** Check that KIXFORMS.DLL is registered and **
;** copy and register if not **
;*************************************************

$ReturnCode = KeyExist("HKEY_CLASSES_ROOT\KixTart.Form\CLSID")

If $ReturnCode = 0 ;** KixForms not registered
;** Copy .DLL
$SourceFile = @LServer + "\netlogon\kixforms.dll"
$Value = ReadValue( "HKLM\System\CurrentControlset\Control\Windows", "SystemDirectory")
$Destination = ExpandEnvironmentVars( $Value )
Copy $SourceFile $Destination
;** Register .DLL silently
$CMDLine = "regsvr32 /s " + $Destination + "\kixforms.dll"
$ObjShell = CreateObject("WScript.Shell")
$ObjShell.run($CMDLine, 1, true)
;** Kill shell object
$ObjShell = nothing
EndIf
;** Wait for registration to take effect
Sleep 2

EndFunction

Function DoProgress()

$prgProgress.value = $prgProgress.value + $Step

EndFunction

Function DOFORM()

;***************
;** Main form **
;***************

Break On
$System = CreateObject("Kixtart.System")
If Not $System
$nul= MessageBox("KiXforms Not Initiated. This Script Will Now Close.","Error",16)
Quit()
EndIf

$frmForm = $System.Form()
$frmForm.Text = " system Login"
$frmForm.sysMenu = 0
$frmForm.Height = 300
$frmForm.Width = 450
$frmForm.FontName = "Verdana"
$frmForm.FontSize = 9

;*************
;** Banner **
;*************
$fraBanner = $frmForm.Controls.PictureBox()
;$fraBanner.IMAGE = "C:\my projects\NetCare3\Images\NC32SM.gif"
$fraBanner.BACKCOLOR = $frmForm.RGB(255,255,255)
$fraBanner.WIDTH = $frmForm.width - 4
$fraBanner.HEIGHT = 60
$fraBanner.LEFT = -2
$fraBanner.TOP = -2

;** Draw On the banner **
$fraBanner.FONTSIZE = 14
$fraBanner.FONTNAME = "verdana"
$fraBanner.FONTBOLD = 1
$fraBanner.FONTITALIC = 1
$fraBanner.ForeColor = $frmForm.RGB(0, 0, 192)
$fraBanner.PrintXY (10,0,"NetLogon 3.2 : Netlogon.kix")
$fraBanner.FontItalic = 0
$fraBanner.FONTSIZE = 8
$fraBanner.ForeColor = $frmForm.RGB(0,100,100)
$fraBanner.PrintXY (10,20,$strVersion + " Powered by Kixforms ")
$fraBanner.FONTSIZE = 9
$fraBanner.PrintXY (10,35,"D5PS2Z0J Systems")
$fraBanner.FONTBOLD = 0
$fraBanner.FONTSIZE = 10

;******************
;** Progress Bar **
;******************
$prgProgress = $frmForm.Controls.ProgressBar()
$prgProgress.width = $frmForm.width - 10
$prgProgress.left = 2
$prgProgress.height = 20
$prgProgress.top = 245;$frmForm.height - $prgProgress.height - 5
$prgProgress.style = 0

;****************
;** Main Frame **
;****************
$fraMain = $frmForm.Controls.PictureBox()
$fraMain.BACKCOLOR = $frmForm.RGB(255,255,255)
$fraMain.WIDTH = $frmForm.width
$fraMain.HEIGHT = 182 ;$frmForm.height - $fraBanner.height - 35
$fraMain.LEFT = -2
$fraMain.TOP = $fraBanner.Height - 5

$lblJob = $fraMain.Controls.label()
$lblJob.FONTSIZE = 10
$lblJob.top = 80
$lblJob.width = 440 ;fraMain.width - 20
$lblJob.left = 10

$lblTask = $fraMain.Controls.label()
$lblTask.FONTSIZE = 10
$lblTask.top = 120
$lblTask.width = 440 ;fraMain.width - 20
$lblTask.left = 50


;** Draw on the frame **
;** Greeting
$Hour = Val(Trim(Left(@Time,2)))
If $Hour < 12
$Greeting = "Good Morning "
Else
If $Hour < 17
$Greeting = "Good Afternoon "
Else
$Greeting = "Good Evening "
EndIf
EndIf
$fraMain.FONTSIZE = 11
$fraMain.FONTNAME = "verdana"
$fraMain.FONTBOLD = 1
$fraMain.ForeColor = $frmForm.RGB(0,100,100)
$fraMain.PrintXY (10,10,$Greeting)
$fraMain.printXY (10,40,"Please wait while your logon script executes...")

$frmForm.center
$frmForm.Show

While $frmForm.visible
$= Execute($frmForm.doevents())
Loop

EndFunction

;*******************************
;*******************************
;** END OF FILE **
;*******************************
;*******************************



Wait don't order yet,... get KiXforms Designer .NET 2.0 (Beta)
KiXforms Designer .NET 2.0 (Beta)


Edited by benny69 (2006-09-09 07:50 AM)