Page 1 of 1 1
Topic Options
#3468 - 2000-07-11 01:21 PM Help : Keyboard handle with OLE ??!!??
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Hi all,

now i want to implement some keyboard handling functions to my scripts [annoying me] . So after searching my msdn libraries for several hours i found some 'IOleControl'
classes
..... but this doesn't create me a KIX- Keyboard handle....
I thought of something like that :

code:

?"Hit 'ESC' at any time to cancel"

IF OLECREATEOBJECT ("IOleControl")= 0
AT(nn,nn)"Keyboard handle failed, please contact Author"
ELSE ;do your job, script
ENDIF
DO
;....
;....paste your code here
;....
UNTIL
OLEGETOBJECT(1,"ESC","IOleControl") = 1


Has anybody already worked with it ???
knows the right syntax for that OLE thingy???
OR has anybody wrote it before with pure KIX-functionality???

Thanks for Your help in advance

Jochen

_________________________



Top
#3469 - 2000-07-14 03:54 PM Re: Help : Keyboard handle with OLE ??!!??
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
just to avoid getting out of focus
_________________________



Top
#3470 - 2000-07-14 05:41 PM Re: Help : Keyboard handle with OLE ??!!??
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Jochen my friend - howsit going ?

IOleControl isn't an automation object as such - it's a "standard interface" that an ActiveX control might implement to talk to it's container.

I'll search the MSDN for anything else that might turn the trick.

Shawn.

Top
#3471 - 2000-07-14 06:34 PM Re: Help : Keyboard handle with OLE ??!!??
Jochen Administrator Offline
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 1

UNTIL ;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 Offline
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 Offline
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 Administrator Offline
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
#3475 - 2000-07-14 07:26 PM Re: Help : Keyboard handle with OLE ??!!??
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
shawn,
and i din't saw your last reply ....

ok back to work ... lets work it out as this seems to become a standard for 'KIX-Keyboard handling'

but anyhow not today (for me)
will be back at Big Blue tomorrow

Jochen

_________________________



Top
#3476 - 2000-07-17 09:10 AM Re: Help : Keyboard handle with OLE ??!!??
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
SHAWN,
hi , here's the show so far :
over the weekend i was in clinch with the
dwFlag - "CTRLINFO_EATS_ESCAPE" ... maybe
i'm on the wrong path or it is simply 'unimplementable' .....
There MUST be a resolution to this ...
what are Your results?

best regards ...

Jochen

CARPE DIEM

_________________________



Top
#3477 - 2000-07-21 05:10 PM Re: Help : Keyboard handle with OLE ??!!??
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
ok,
i give it up,
maybe i am complete jerk , or i just didn't
get familar with the OLE stuff ....

its yours , whoever you are .....

Greets Jochen
[learns PERL for such scripts]

_________________________



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
1 registered (Allen) and 271 anonymous users online.
Newest Members
Sir_Barrington, batdk82, StuTheCoder, M_Moore, BeeEm
17886 Registered Users

Generated in 0.044 seconds in which 0.015 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