Functions for Kixlib32Kixlib32 is a DLL snapin written by Shawn <?email?>
Be sure to visit http://kixtart.org for all of your KixTart needs.
To install
1. Create c:\Kixlib32
2. Place kixlib32.dll in c:\Kixlib32
3. run the following from a command line.
regsvr32 c:\Kixlib32\kixlib32.dll
You will need administrator access to install this on NT/2000
computers.
*(you can place the dll file in any folder of your choice be sure
to modify instructions to suit)
------------------------------------------------------------------
GetTickCount
Returns the number of milliseconds that have elapsed since the
system was started.
$kixlib=olecreateobject("kixlib32.library")
if @error <> 0
? "You must have kixlib32 installed"
exit
endif
$tick=val(olecallfunc($kixlib,"GetTickCount"))
? "Current tickcount=$tick"
-------------------------------------------------------------------
KBHit
Returns a 1 if a key on the keyboard is currently being pressed.
$kixlib=olecreateobject("kixlib32.library")
if @error <> 0
? "You must have kixlib32 installed"
exit
endif
? "Press Q to quit"
while 1
if olecallfunc($kixlib,"kbhit") = 1
get $key
if $key <> "q"
? "You pressed $key"
else
exit
endif
endif
loop
-------------------------------------------------------------------
SetConsoleCursorVisible
This will set the dos cursor visible or invisible.
Please note: if script is ended while cursor is invisible, cursor
will remain invisible
$kixlib=olecreateobject("kixlib32.library")
if @error <> 0
? "You must have kixlib32 installed"
exit
endif
?"Enter string with cursor visible >" gets $s
$nul=olecallfunc($kixlib,"SetConsoleCursorVisible","s","0")
?"Enter string with cursor Invisible >" gets $s
$nul=olecallfunc($kixlib,"SetConsoleCursorVisible","s","1")
?"Enter string with cursor visible >" gets $s
------------------------------------------------------------------
Sleep
This will sleep for x number of milliseconds
$kixlib=olecreateobject("kixlib32.library")
if @error <> 0
? "You must have kixlib32 installed"
exit
endif
$nul=olecallfunc($kixlib,"sleep","s","90") ;this will sleep for 90 milliseconds