Page 1 of 1 1
Topic Options
#109943 - 2003-12-09 07:24 PM Kixforms
Stephen Wintle Offline
Seasoned Scripter

Registered: 2001-04-10
Posts: 444
Loc: England
Ive a kixforms question, how would I add an exit button to the following?
Code:
 SETCONSOLE("HIDE")
CLS
if @inwin = "1"
shell "%COMSPEC% /c %WINDIR%\System32\Regsvr32 /s %WINDIR%\SYSTEM\KiXFORMS.dll"
else
shell "%COMSPEC% /c %WINDIR%\System\Regsvr32 /s %WINDIR%\SYSTEM\KiXFORMS.dll"
endif

break on

$Form = createobject("KiXtart.Form")
$Form.Size = 400,200
$Form.Center
$Form.Caption="Christmas Message"
$Form.BackColor = 255,0,0
$Form.Fontsize = 8
$Form.Fontbold = 1
$Form.Show
$Form.Visable = 1



$Multi = $Form.TextBox("",55,30,190,100)
$Multi.MultiLine = True
$Multi.Scrollbars = 0
$Multi.ForeColor = 25,115,9
$Multi.caption = "Hi, " + @fullname + "." + @crlf + @crlf
+ "The ICT department wish you a " + @crlf + "very Merry Christmas and a " + @crlf
+ "Happy New Year! :-)" + @crlf

$Image = $Form.Image("\\tom\netlogon\santa.bmp",270,30,60,67)

Play File "\\harry\netlogon\chris.wav"

While $Form.Visible
$=Execute($Form.DoEvents())
Loop

Exit 1



Thanks

Steve
_________________________
Dont worry because a rival imitates you. As long as they follow in your tracks they cant pass you!

Top
#109944 - 2003-12-09 07:50 PM Re: Kixforms
NTDOC Administrator Online   content
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
Generally something like this

$Form.Hide

There are plenty of examples on the KiXforms Website though.

Also, don't forget a user needs to have at least PowerUser rights to register the DLL

KiXforms Website
http://www.kixforms.com

Top
#109945 - 2003-12-09 07:51 PM Re: Kixforms
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
Just a couple things...I REM'd out the first two lines to prevent the black console box from popping up for a second. If you are using Kix32.exe and not WKix32.exe then you may want the un-REM those lines.

I also change the $Form.Visable to $Form.Visible and moved both the $Form.Visible and $Form.Show down after the form is completed. This will prevent half of the form from showing while the other half is still loading.

Code:
 

;SETCONSOLE("HIDE")
;CLS
if @inwin = "1"
shell "%COMSPEC% /c %WINDIR%\System32\Regsvr32 /s %WINDIR%\SYSTEM\KiXFORMS.dll"
else
shell "%COMSPEC% /c %WINDIR%\System\Regsvr32 /s %WINDIR%\SYSTEM\KiXFORMS.dll"
endif

break on

$Form = createobject("KiXtart.Form")
$Form.Size = 400,200
$Form.Center
$Form.Caption="Christmas Message"
$Form.BackColor = 255,0,0
$Form.Fontsize = 8
$Form.Fontbold = 1

$Multi = $Form.TextBox("",55,30,190,100)
$Multi.MultiLine = True
$Multi.Scrollbars = 0
$Multi.ForeColor = 25,115,9
$Multi.caption = "Hi, " + @fullname + "." + @crlf + @crlf
+ "The ICT department wish you a " + @crlf + "very Merry Christmas and a " + @crlf
+ "Happy New Year! :-)" + @crlf

$Image = $Form.Image("\\tom\netlogon\santa.bmp",270,30,60,67)

$ExitButton = $Form.Controls.ToolButton("Exit",150,$Multi.Bottom+5)
$ExitButton.ForeColor = 25,115,9
$ExitButton.OnClick = "Quit()"

Play File "\\harry\netlogon\chris.wav"

$Form.Visible = 1
$Form.Show
While $Form.Visible
$=Execute($Form.DoEvents())
Loop

Exit 1



Edited by CitrixMan (2003-12-09 07:54 PM)

Top
#109946 - 2003-12-09 07:59 PM Re: Kixforms
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
What song does the chris.wav play? It may be much quicker if you play one of the songs from one of these other posts.

http://www.kixtart.org/ubbthreads/showflat.php?Cat=&Number=108277

http://www.kixtart.org/ubbthreads/showflat.php?Cat=&Board=UBB2&Number=60405


Edited by CitrixMan (2003-12-09 08:01 PM)

Top
#109947 - 2003-12-10 01:11 PM Re: Kixforms
Stephen Wintle Offline
Seasoned Scripter

Registered: 2001-04-10
Posts: 444
Loc: England
CitrixMan, ive tried using your suggestion but the form just flashes briefly with out the button..

Steve
_________________________
Dont worry because a rival imitates you. As long as they follow in your tracks they cant pass you!

Top
#109948 - 2003-12-10 03:12 PM Re: Kixforms
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Then start the script either with /d or put DEBUG ON into the first line of your script and start debugging it by stepping through it to see where it fails.
_________________________
There are two types of vessels, submarines and targets.

Top
#109949 - 2003-12-10 03:55 PM Re: Kixforms
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
Maybe you're using a old version of kixforms.dll? It works fine for me.
Top
#109950 - 2003-12-10 04:55 PM Re: Kixforms
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
Try this instead...Maybe someone else knows...But Im not sure if the script waits for the Play command to complete before proceeding or not. I moved the $Form.Show above the Play command...Maybe that will have some effect.

Code:
 
if @inwin = "1"
shell "%COMSPEC% /c %WINDIR%\System32\Regsvr32 /s %WINDIR%\SYSTEM\KiXFORMS.dll"
else
shell "%COMSPEC% /c %WINDIR%\System\Regsvr32 /s %WINDIR%\SYSTEM\KiXFORMS.dll"
endif

break on

$Form = createobject("KiXtart.Form")
$Form.Size = 400,200
$Form.Center
$Form.Caption="Christmas Message"
$Form.BackColor = 255,0,0
$Form.Fontsize = 8
$Form.Fontbold = 1

$Multi = $Form.TextBox("",55,30,190,100)
$Multi.MultiLine = True
$Multi.Scrollbars = 0
$Multi.ForeColor = 25,115,9
$Multi.caption = "Hi, " + @fullname + "." + @crlf + @crlf
+ "The ICT department wish you a " + @crlf + "very Merry Christmas and a " + @crlf
+ "Happy New Year! :-)" + @crlf

$Image = $Form.Image("\\tom\netlogon\santa.bmp",270,30,60,67)

$ExitButton = $Form.Controls.ToolButton("Exit",150,$Multi.Bottom+5)
$ExitButton.ForeColor = 25,115,9
$ExitButton.OnClick = "Quit()"

$Form.Visible = 1
$Form.Show

Play File "\\harry\netlogon\chris.wav"

While $Form.Visible
$=Execute($Form.DoEvents())
Loop

Exit 1


Top
Page 1 of 1 1


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

Who's Online
0 registered and 1471 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.059 seconds in which 0.026 seconds were spent on a total of 12 queries. Zlib compression enabled.

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