Page 1 of 1 1
Topic Options
#208225 - 2013-12-30 06:55 PM KixForms MenuItems
ProjectStoner Offline
Just in Town

Registered: 2013-12-24
Posts: 1
Loc: Minnesota
I need help getting the kixforms MenuItems to run programs when clicked. All that I get when run is a black box with the menus in it.

Here is my code:
 Code:
Break On
$System = CreateObject("Kixforms.System")
If Not $System
   $nul= MessageBox("KiXforms.Net Not Initiated. This Script Will Now Close.","Error",16)
   Quit()
EndIf
$nul = $System.Application.EnableVisualStyles

$Form1 = $System.Form()
$Form1.Left = 31920
$Form1.StartPosition = 0  ;FormStartPosition_Manual
$Form1.Size = $System.Size(763,687) ;(Width,Height)
$Form1.Text = "Form1"
$Form1.Top = 32218

$MainMenu = $System.MainMenu()

$File = $MainMenu.MenuItems.Add($System.MenuItem("File"))
$Exit = $File.MenuItems.Add($System.MenuItem("Exit"))
$Exit.Click = "ExitForm()"

$Install = $MainMenu.MenuItems.Add($System.MenuItem("Install and Configure Software"))
$Improvis = $Install.MenuItems.Add($System.MenuItem("Install Latest Improvis Client"))
$Improvis.Click = "ImprovisInstall()"
$Java = $Install.MenuItems.Add($System.MenuItem("Install Latest Java Client"))
$Java.Click = "InstallJava()"
$Patterson = $Install.MenuItems.Add($System.MenuItem("Install Patterson Software"))
$Patterson.Click = "PattersonInstall()"
$ManagePrinters = $MainMenu.MenuItems.Add($System.MenuItem("Manage Local Printers"))
$HP400 = $ManagePrinters.MenuItems.Add($System.MenuItem("Install HP 400 Printer"))
$HP400.Click = "HP400Install()"
$HP600 = $ManagePrinters.MenuItems.Add($System.MenuItem("Install Latest HP 600 Printer"))
$HP600.Click = "HP600Install()"
$XRAY = $ManagePrinters.MenuItems.Add($System.MenuItem("Install XRAY Printer"))
$XRAY.Click = "XRAYInstall()"
$DelEagle = $ManagePrinters.MenuItems.Add($System.MenuItem("Delete Eagle Soft Printer"))
$DelEagle.Click = "DeleteEaglesoft()"
$Misc = $Misc.MenuItems.Add($System.MenuItem("Misc System Configurations"))
$Keys = $Misc.MenuItems.Add($System.MenuItem("Update Windows/Office Keys and Activate"))
$Keys.Click = "KeysInstall()"
$Shortcut= $Misc.MenuItems.Add($System.MenuItem("Copy Shortcut To Backup Folder"))
$Shortcut.Click = "Shortcut()"
$TagExport = $Misc.MenuItems.Add($System.MenuItem("Export Service Tag and Computer Name"))
$TagExport.Click = "TagExport()"
$Description = $Misc.MenuItems.Add($System.MenuItem("Set Computer Description"))
$Description.Click = "Description()"


$Form1.Menu = $MainMenu

$PictureBox1 = $System.PictureBox()
$PictureBox1.BorderStyle = 1  ;FixedSingle
$PictureBox1.Height = 610
$PictureBox1.Left = 10
$PictureBox1.SizeMode = 1  ;StretchImage
$PictureBox1.Top = 10
$PictureBox1.Width = 730
$nul = $Form1.Controls.Add($PictureBox1)

$PictureBox1.Image = PictureBox1Image()

$Form1.Show  ;Displays the Form

While $Form1.Visible
   $Nul = Execute($Form1.DoEvents())
Loop
Exit 0





Function PictureBox1Image()
$PictureBox1Image = "
/9j/4AAQSkZJRgABAQEAAAAAAAD/2wBDAAkGBhQSERQUEhQVFBQUFxcUFRcXFxkaFxcYFxcX
FxcXGBcYGyYeFxojGhgYHy8gIycpLC0sFx4xNTAqNSYrLCn/2wBDAQkKCg4MDhgPDxcsHBwc
LCwpLCksKSwsKSwsLCksKSwsLCwpKSkpKSkpLCwpKSwsLCwpLCkpKSwpLCwsLCwpKSn/wAAR
CACxARwDASIAAhEBAxEB/8QAGwAAAwEBAQEBAAAAAAAAAAAAAgMEAQAFBgf/xAA8EAABAwID
BQYFAgUDBQEAAAABAAIRAyExQfAEElFhcYGRobHB0QUTIuHxMlIUQmKisgYzchUjgpLSB//E
ABkBAAMBAQEAAAAAAAAAAAAAAAABAgMEBf/EACgRAQEBAAIBAwIFBQAAAAAAAAABEQIhEgMx
QRTwBDJRYaETIiNicf/aAAwDAQACEQMRAD8A/FgEbWrAEbQo1LoRhqEBMAU0nELWOsuAWtap
J2+uBXQiDNaCBrlxCINXFIaCFyNrERagaVurC1N3FpYnqiC1C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byrBhkrt5LATAgsGCgqBY5yDeRIeOJQa1dYShKvDjHFAVznLAq
WtU7xeyc6QhcFK20CiqHWgkNemF6WdhgditbUsfshKwIB1KrCd/EKZiY1yiyGP5y35vNKB1Z
Hva/KMAHPK7eWO1glyqwDlZvIN5YXJ4QnuWNelkrgngVMqJprd6jDlslLxCttRMY6M+qkFRH
vnilhKHPQ/NPFK3tW9VhKMI3eQGtks30LiniTPmIHVNWQOXMRhYGJTRSQyjFXtRSDvQs3kLl
rAM3R2eyMGOLkLijhv7vCVjmt/d/aU8GFlC5F9P7v7T5rob+7+1UqQkoSU0tEfq7IPmklNT0
auCSzNYuWc9lArYnqjZguXJhjcT2LguXIAinPwXLlNNi0rlyQLrYBKeuXJwmLAuXKwxywLFy
AZTx7UzaMRrNcuS+QFiLNYuTSbR9vNaVq5SAHBaFy5MguQuXLkE12XVMOeuC5ckRL/dDkuXJ
m0ZLsly5OAupihXLkzdklFcuVQ3/2Q=="
$PictureBox1Image = $System.Bitmap.FromBase64String($PictureBox1Image)
EndFunction

Function ExitForm()
		Quit ()
EndFunction

Function ImprovisInstall()

$ Shell "\\adpispc-jbsiede\E\Improvis.bat"

EndFunction

Function InstallJava()

$ Shell "\\adpispc-jbsiede\E\JavaUP.bat"

EndFunction

Function InstallPatterson()

$ Shell "\\adpispc-jbsiede\E\Patterson.bat"

EndFunction

Function HP400Install()

$ Shell "\\adpispc-jbsiede\E\Printers\Printer225.bat"

EndFunction

Function HP600Install()

$ Shell "\\adpispc-jbsiede\E\Printers\Printer226.bat"

EndFunction

Function XRAYInstall()

$ Shell "\\Adpispc-jbsiede\E\Printers\6520Printer.bat"

EndFunction

Function DeleteEagleSoft()

$ shell "\\ADPISPC-JBSIEDE\E\DEL-PRINTER.BAT"

EndFunction


Function KeysInstall()

$Form.Messagebox("Please Click OK On Any Boxes That Popup.","Activating Windows/Office",0)
$ Shell "\\adpispc-jbsiede\E\Activate-Windows-Office.bat"


EndFunction


Function Shortcut()

$ Shell "\\adpispc-jbsiede\E\BackupShortcut.bat"

EndFunction

Function TagExport()

Break on




; Date...
$MyDate=@DATE

; Time...
$MyTime=@TIME

; NetBIOS Name...
$MyDomain=AMDPI.LOCAL
$CPUName= @HostName



; IP Address...
$IP1 = LTRIM(SUBSTR(@IPADDRESS0, 1, 3))
$IP2 = LTRIM(SUBSTR(@IPADDRESS0, 5, 3))
$IP3 = LTRIM(SUBSTR(@IPADDRESS0, 9, 3))
$IP4 = LTRIM(SUBSTR(@IPADDRESS0, 13, 3))
; Then we build a valid IP address from the 4 octets, again seperated by dots...
$MyIP=$IP1 + "." + $IP2 + "." + $IP3 + "." + $IP4

; MAC Address...
$MyMAC="@address"

;Service Tag...

 ? "--> Service Tag Check"
$strComputer = "."
$objWMIService = GetObject("winmgmts:\\"+ $strComputer + "\root\cimv2")
$colItems = $objWMIService.ExecQuery("Select * from Win32_BIOS")
For Each $objItem in $colItems
	$ServiceTag = $objItem.SerialNumber


 
; Operating System Version...
If @INWIN = 1
   $OS="@producttype, @csd"
endif


; Operating System Language...
$OSLangCode = LTRIM(SUBSTR(@SYSLANG, 1, 4))
$OSLangName = LTRIM(SUBSTR(@SYSLANG, 5, 15))



; Writing information to Screen...
cls
?
? "[Created]"
? "Date=" + $MyDate
? "Time=" + $MyTime
?
? "[Network]"
? "Domain=" + $MyDomain
? "Computer Name=" + $CPUName
? "IP Address=" + $MyIP
? "MAC Address=" + $MyMAC
? "Service Tag=" + $ServiceTag
?
? "[Windows]"
? "OS Version=" + $OS
? "Language Code=" + $OSLangCode
? "Language Name=" + $OSLangName
?


; Writing information to the ini-file... 
WriteProfileString("\\adpispc-jbsiede\e\Computers\$cpuname.txt" , "Created" , "Date" , $MyDate) 
WriteProfileString("\\adpispc-jbsiede\e\Computers\$cpuname.txt" , "Created" , "Time" , $MyTime) 
WriteProfileString("\\adpispc-jbsiede\e\Computers\$cpuname.txt" , "Network" , "Domain" , $MyDomain)
WriteProfileString("\\adpispc-jbsiede\e\Computers\$cpuname.txt" , "Network" , "Computer Name" , $CPUName)  
WriteProfileString("\\adpispc-jbsiede\e\Computers\$cpuname.txt" , "Network" , "IP Address" , $MyIP) 
WriteProfileString("\\adpispc-jbsiede\e\Computers\$cpuname.txt" , "Network" , "MAC Address" , $MyMAC) 
WriteProfileString("\\adpispc-jbsiede\e\Computers\$cpuname.txt" , "Network" , "Service Tag" , $ServiceTag)
WriteProfileString("\\adpispc-jbsiede\e\Computers\$cpuname.txt" , "Windows" , "OS Version" , $OS) 
WriteProfileString("\\adpispc-jbsiede\e\Computers\$cpuname.txt" , "Windows" , "Language Code" , $OSLangCode) 
WriteProfileString("\\adpispc-jbsiede\e\Computers\$cpuname.txt" , "Windows" , "Language Name" , $OSLangName)


EndFunction

Function Description()

$ Shell "\\adpispc-jbsiede\E\SET-DESCRIPT.BAT"

EndFunction

Thanks in Advance!!!!


Edited by Glenn Barnas (2013-12-30 08:03 PM)
Edit Reason: Added code tags

Top
#208226 - 2013-12-30 08:40 PM Re: KixForms MenuItems [Re: ProjectStoner]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4401
Loc: New Jersey
Welcome to KORG!

Taking it bit by bit..
 Code:
Quit()
This is not totally valid - Quit is a command and not a function. Replace these with "Quit 0" or "Quit @ERROR" for an error termination.


 Code:
Function ImprovisInstall()
  $ Shell "\\adpispc-jbsiede\E\Improvis.bat"
EndFunction
Why is there a "$" in front of each of the Shell statements?

You should also add some error checking. Possibly consider using WshPipe to execute the command so you can colllect the STDOUT and STDERR streams, along with a valid error code. There are several of these..

Installing from a UNC path is not generally recommended, and may not even function for some install apps. Using UNC paths embeds the install path in the registry, which could be an issue during feature adds or upgrades if the original server is unavailable. Using a mapped drive is preferred, as the install path can be matched regardless of the install server.

 Code:
; IP Address...
$IP1 = LTRIM(SUBSTR(@IPADDRESS0, 1, 3))
$IP2 = LTRIM(SUBSTR(@IPADDRESS0, 5, 3))
$IP3 = LTRIM(SUBSTR(@IPADDRESS0, 9, 3))
$IP4 = LTRIM(SUBSTR(@IPADDRESS0, 13, 3))
; Then we build a valid IP address from the 4 octets, again seperated by dots...
$MyIP=$IP1 + "." + $IP2 + "." + $IP3 + "." + $IP4
Yikes!
 Code:
$MyIP = Join(Split(@IPADDRESS0, ' '), '.')
is much simpler and direct.

Then there's the Date, Time, and other lines that assign a macro value to a variable. The variables are not used except to write to an INI file. This isn't efficient.

 Code:
$OS="@producttype, @csd"
is not recommended (No Macros or Vars in Strings!). Use
 Code:
$OS = @PRODUCTTYPE + '. ' + @CSD
instead.

 Code:
$colItems = $objWMIService.ExecQuery("Select * from Win32_BIOS")
For Each $objItem in $colItems
	$ServiceTag = $objItem.SerialNumber
Where is the "Next" to close the "For"?

Finally, why is there a "Breal On" in the TagExport function? This is usually set at the start of the script and will rarely change during processing.

I don't run KF.Net, so can't actually test this further, but these issues should be resolved before moving forward. Better structure (indents, overall formatting, comments) would help, as would moving the data (command strings, UNC paths) out of the commands and into a set or array of vars at the top of the program. Embedding this data in the program becomes unmanagable after a bit.

Glenn
PS - Click Edit on your post to see how CODE tags are used to format your script code.
_________________________
Actually I am a Rocket Scientist! \:D

Top
#208227 - 2013-12-30 11:47 PM Re: KixForms MenuItems [Re: Glenn Barnas]
Henriques Offline
Fresh Scripter

Registered: 2007-09-13
Posts: 43
I think you need to use .OnClick instead of .Click
Top
#208228 - 2013-12-30 11:51 PM Re: KixForms MenuItems [Re: Glenn Barnas]
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
Try commenting out the $Form1.Left = xxxx and the $Form1.Top = xxxx lines.

When I tried running it, the settings were so high that it was off the screen somewhere...showing just the black console window with some ill defined menus.

Top
#208229 - 2013-12-30 11:52 PM Re: KixForms MenuItems [Re: ShaneEP]
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
Also...Change this line...
 Code:
$Misc = $Misc.MenuItems.Add($System.MenuItem("Misc System Configurations"))

To...
 Code:
$Misc = $MainMenu.MenuItems.Add($System.MenuItem("Misc System Configurations"))

Top
Page 1 of 1 1


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 793 anonymous users online.
Newest Members
M_Moore, BeeEm, min_seow, Audio, Hoschi
17883 Registered Users

Generated in 0.111 seconds in which 0.082 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org