Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

change mousepointer

343 views
Skip to first unread message

arno

unread,
Dec 2, 2005, 1:25:08 PM12/2/05
to
Is it possible to change the mousepointer using a stand-alone
VBScript?

kind regards,
arno

mr_unreliable

unread,
Dec 2, 2005, 2:08:19 PM12/2/05
to
hi Arno,

Yes it is, if you are willing to use a 3rd-party control
and call api's from script.

A demo script is attached.

cheers, jw
____________________________________________________________

You got questions? WE GOT ANSWERS!!! ..(but,
no guarantee the answers will be applicable to the questions)


Note: "mousepointer" is a vb term. You will not that the
api calls refer to the same thing as a "SystemCursor".

--- <DynaWrap Boilerplate> ---
It is possible to declare-and-call an api from script,
but you must use a third-party control to do so,
or else write one yourself.

It has already been correctly pointed out that there
is no api-capability in "pure" script.

If you are willing to use a third-party control, then
one such control, called "DynaWrap", can be found on
Guenter Born's website (note: Guenter refers to it as
"DynaCall"). Here is the link to it:

http://people.freenet.de/gborn/WSHBazaar/WSHDynaCall.htm

On that page you will find a download for the control,
plus some code samples.

Note: you may find additional sample code by searching
the archives for this ng, and the vbscript ng.

Note also: DynaWrap does have its limitations. There are
certain things it can't do. For example, you can't call
api's which take typedefs as parameters, and you can't call
api's "by ordinal". But it will work for most of the
"usual suspects".

And finally, DynaWrap doesn't work entirely as advertised.
For example, it is supposed to allow for the declaration of
several api definitions in one instance of itself. I could
never get that to work (in win9x). You will need a new
instance of DynaWrap for every api, or else re-instantiate
the object for every api. Someday I'm going to learn enough
c++ to fix that...
--- </DynaWrap Boilerplate> ---

ChangeSystemCursor.vbs.txt

mr_unreliable

unread,
Dec 2, 2005, 2:36:20 PM12/2/05
to
I just recalled that I was badly "flamed" when I posted
similar code on the winapi ng a while back.

The flamer took vociferous exception to my "setting the
cursor back" to the system arrow.

He (correctly) pointed out that not everybody uses the
system arrow as a "standard" cursor. There are all sorts
of customizations available.

If my script had been "properly" coded, it would have
saved the previous system cursor before changing it to
an hourglass, and set it back to what it was -- rather
than (wrongly) assuming it was the system arrow.

mea culpa, jw

arno

unread,
Dec 2, 2005, 3:09:15 PM12/2/05
to
jw,

Thanks for the info. Pity is isnt possible from native VBS.

Your solution is not an option for me, as it would require
distribution and installation of a 3rd party control, which is
something I am trying hard to avoid.

regards,
arno

mr_unreliable

unread,
Dec 4, 2005, 12:54:18 PM12/4/05
to
Yes, it's wise to avoid those untrustworthy and unreliable
3rd-party controls -- and stick to that ultra-reliable and
ultra-trustworthy code written in Redmond.

cheers, jw

arno wrote:
> jw,

0 new messages