mr_unreliable
Wed May 16 15:14:47 CDT 2007
Servus Rolf,
It depends.
If you are talking about a script hosted by IE, then you
can use a stylesheet, and specify the hourglass cursor
like this: "cursor: wait".
If you are talking stand-alone script, then afaik you
will have to use the system api's. If you wish to set
the system cursor, then you can use the LoadCursor and
SetCursor api's. The constant for the hourglass is:
Const IDC_WAIT = 32514
Also, you must remember to set the cursor back to what
it was before you exit your script.
If you wish to set the cursor for a window, things get
a little more tricky. You will have to reset the cursor
in the window CLASS definition, not the window. This
means you have to find the window "handle", then get
the window class (GetClassName), then get the class "info"
(GetClassInfo) a typedef, and then change the window
class cursor (tWC.hCursor = hWait). I have never actually
tried this, but I suspect that you may need to "refresh"
the window to get the cursor to appear (by sending a
wm_paint).
And again, remember to reset the cursor back to what it
was, when you are done.
mfg, jw
____________________________________________________________
You got questions? WE GOT ANSWERS!!! ..(but,
no guarantee the answers will be applicable to the questions)
--- <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 of the wsh and vbscript ng's.
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> ---
R. Gruene wrote:
> Is it possible to show instead of an arrow as mouse an hourglass as in VBA,
> or something else?
>
>
> Rolf Grüne
>
>