|
|
|||||||
I am VB illiterate, so I have no idea how to translate this into Kix. HELP! code:Private Declare Function BlockInput Lib "user32" (ByVal fBlock As Long) As Long [ 26 April 2002, 17:06: Message edited by: Chris S. ] |
||||||||
|
|
|||||||
Chris, I just wrapped this API in a command-line utility called block.exe, email me at stassie@sympatico.ca if you would like to get a copy: You run it like this: c:\> block "dir c:\windows" The idea being that the command-line (or kix script) gets spawned-off and run with input disabled. I tried using things like RUNDLL but it doesn't work. There are freeware ActiveX wrappers for this API as well, let me know if your interested in I'll track down the links: Here's the C code if you want to roll your own: code:-Shawn#include <windows.h> [ 28 April 2002, 19:32: Message edited by: Shawn ] |
||||||||
|
|
|||||||
Shawn, You're in good terms with the "big Guy" right? Maybe you could borrow his ear and get this added to the next version of KiX. |
||||||||
|
|
|||||||
Les, Consider it done - I just fired-off a note to Ruud about this. I don't have anymore pull than anybody else around here - but I think this would make an EXCELLENT addition to the kixtart scripting langauge. Very dangerous function though - have to handle with care - I haven't locked myself out of my system yet ( today hehee ). -Shawn |
||||||||
|
|
|||||||
Its too bad that the RUNDLL thingy didn't work. Then we could have made a UDF for it. Someone else might want to give it try, but I think the way it works is that the block is only effective for the current thread, and because RUNDLL is a program, the block goes away as soon as the first RUNDLL finishes ... I was trying stuff like this: SHELL "%COMSPEC% /C RUNDLL32.EXE USER32.DLL,BlockInput 1" ?@ERROR SHELL "%COMSPEC% /C RUNDLL32.EXE USER32.DLL,BlockInput 0" But like I said, no worky. Also tried all kinds of variations of SHELL and RUN with no joy. -Shawn |
||||||||
|
|
|||||||
Know what ya mean about locking oneself out. Back in the days of DOS we had a few tricks. One I recall was redirecting input away from CON with the MODE command. |
||||||||
|
|
|||||||
The freeware tool AutoIt has a BlockInput command On WinNT sp. 6 and Win2k+ mouse and keyboard is locked AutoIt is still able to send keystrokes to the aplication On Win98+ mouse and keyboard is locked As an example, if you have a silent install: Setup.exe -s You can make this small AutoIt script: BlockInput, on Run, Setup.exe -s BlockInput, off AutoIt can compile the script to an .exe-file, the exe-file will have a size of about 40k AutoIt can be found here: AutoIt Homepage AutoIt also have a COM (ActiveX) interface: AutoItX.dll If you register this you can use this KiX code (To make this usefull you sholud let your logonscript register it for you) $oAutoIt = CreateObject("AutoItX.Control") $oAutoIt.BlockInput("on") Shell '%COMSPEC% Start /Wait Setup.exe -s' $oAutoIt.BlockInput("off") As an extra bonus AutoIt can control the mouse (Move/Leftclick/rightclick and more) -Erik Ps. If you use AutoIt, you get locked in again when the script ends, if you make a never ending story (Bad loop) You are locked out. Be careful if you add this as a Run-Key in WinNT (Not Tested) In the tested operating systems: Win9x,WinME,Win2k and WinXP you can start in failsafe mode and renove the Run-Key from the registry if it loops. Just joking In my oppinion Win2k+ looks like Win9x with WInNT secutity (And plug'n'play) |
||||||||
|
|
|||||||
Thanks all, for your input! I think I'll go with the AutoIt solution as that allows more control within Kix scripts itself. The funny thing is that I was requesting this solution because AutoIt could do it and I thought we'd be able to do it with Kix as well (if we could figure out how to access the API layer). I had completely forgotten about AutoItX. I use AutoIt quite extensively to script automated installations, but have never used AutoItX. {EDIT} I just looked at the AutoIt homepage and noticed that a new version was released in Feb. It includes a pure DLL version of AutoIT! This should make it easier to incorporate many of AutoIt's useful functions within Kix. [ 29 April 2002, 15:00: Message edited by: Chris S. ] |