#3471 - 2000-07-14 06:34 PM
Re: Help : Keyboard handle with OLE ??!!??
|
Jochen
KiX Supporter
   
Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
|
SHAWN, what are the haps my friend, nice to have you back !!! Were You Holiday-strucked or something ???? Hope that it was nothing harmful...Funny, but if i work with IOleControl in my test script and make a pure display of the $kbh variable it returns the last pressed key. On the other side i am not able to wrap it around the execution of code .... Anyway here it is : lets make a competition of it (who browses his copy of msdn fastest gets the honeypot)  code:
Break on DIM $count,$kbh $output="Ho Ho Ho!" AT(2,30)"hit 'ESC' to quit" $kbh = OLEGetObject (1,"IOleControl") IF @error > 0 COLOR r+/n AT(3,10)"Keyboard handle failed, please contact Author" ELSE ;do your job, script ENDIF DO WHILE $count < 256 $count = $count + 1 COLOR b+/n BIG AT(7,4)"$output" sleep 1 AT(7,3)" " sleep 1UNTIL ;place here the proper line of code LOOP SMALL COLOR n/n AT(24,10)"Keyboard handle 'ESC' OK! --- 'ANYKEY' to quit ...." AT(25,0) GET $x EXIT
Jochen P.S.: or was it the 2-week Diablo II Test round ????? [This message has been edited by jpols (edited 14 July 2000).]
_________________________
|
|
Top
|
|
|
|
#3472 - 2000-07-14 06:44 PM
Re: Help : Keyboard handle with OLE ??!!??
|
Shawn
Administrator
   
Registered: 1999-08-13
Posts: 8611
|
Jochen:I thought maybe a variation of the script in this thread: http://kixtart.org/board/Forum2/HTML/000543.html might serve your purpose.
I noticed that you had commented on this thread ! Is this what piqued your interest on this subject ?
code:
break on ?"Hit any key to cancel ..."
while $key = " "
sleep 1
$=sendkeys(" ")
get $key
?"Doing work..."
loop
exit
Shawn. [CODE]
|
|
Top
|
|
|
|
#3473 - 2000-07-14 07:11 PM
Re: Help : Keyboard handle with OLE ??!!??
|
Shawn
Administrator
   
Registered: 1999-08-13
Posts: 8611
|
Jochen:Sorry pal - I didn't see your post there and thought maybe you had gone home or something. It works ??? Can't wait to try it out - good call when you decided to use olegetobject instead of olecreateobject !!! I guess IOleControl does have an Automation interface after all ! There are two ways to access components - through the standard COM Vtable interface and through Automation. Components that implement both have what's called a "Dual Interface". Scripting languages like KiX usually support only Automation because it's dynamic and works at "runtime". Vtable COM is something thats built at compile time. The bottom-line is that Automation is (relatively) slow compared to Vtable COM! I've actually seen some stats and can dig them up if anyone's interested! YES !!! - I've been playing some SERIOUS Diablo II !!! My wrist and upper shoulders are killing me - this is what is known as "Diablo Syndrome". I'm a little disapointed in some the changes they've made with Version 2 - and I still think there are some serious performance issues - but generally - it rocks ! Can't wait to try your script out though ! Shawn.
[This message has been edited by Shawn (edited 14 July 2000).]
|
|
Top
|
|
|
|
#3474 - 2000-07-14 07:20 PM
Re: Help : Keyboard handle with OLE ??!!??
|
Jochen
KiX Supporter
   
Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
|
ooops, another sample of replying without reading (shame),ehhhm ja , i thought of something like this... i am about to write a script for my company that installs remote control software on a single client in the productive envronment, and to make this one safe (in case our operators face an error in the earlier input) i wanted to implement a 'fallback' while installation on remote ... So hitting escape will , in the finished scipt , delete the registry entries made SO FAR , delete the already pushed sub-scripts ,reboot the client etc. Thanks for giving this hint , shure i can use this Good night & thanks its been a long day and i want ot go home now....(GMT+1) Jochen
_________________________
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
1 registered
(Allen)
and 271 anonymous users online.
|
|
|