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

MousePointer HourGlass ???

310 views
Skip to first unread message

Fred Holmes

unread,
Aug 24, 2001, 12:42:58 PM8/24/01
to
In VB6 a statement:

[Object].Screen.MousePointer = vbHourGlass

can be used to change the MousePointer to an Hourglass as a wait
indicator while the code is crunching. This doesn't seem to work for
me in PowerPoint macros (VBA?).

[Object] is whatever part of the screen should show the Hourglass.
The entire ActiveWindow for the presentation, I guess. Either I'm not
discovering the correct statement for the object, or PowerPoint
doesn't seem to have this feature???

Any way to do it?

Thanks,

Fred Holmes

My macro runs for quite a while, and without such a statement the
Mouse Pointer doesn't automatically change to an hourglass. I don't
want the user to think that the macro is [should have] finished before
it has actually completed.

Shyam Pillai

unread,
Aug 24, 2001, 1:37:41 PM8/24/01
to
Fred,

Use windows API call SetCursor.


Regards
Shyam Pillai

http://www.mvps.org/skp

Image Importer Wizard
http://www.mvps.org/skp/iiw.htm

On Fri, 24 Aug 2001 16:42:58 GMT, fho...@schaferdc.com (Fred Holmes)
made the following post:

Fred Holmes

unread,
Aug 24, 2001, 2:35:35 PM8/24/01
to
Please give me a clue or two on where to find help on Win API
(programming). Neither the VBA help in an Office application nor the
help in VB6 seem to recognize, e.g., the keyword "SetCursor". The
help under Win API is minimal.

I've used a few WinAPI calls before, but only when substantially the
complete code was given, e.g., the examples in The Wait Group's
"Visual Basic Source Code Library." But I don't see enough patterns
in that stuff to generalize yet.

Would I use something like:

Public Declare Function SetCursor Lib "user32" (ByVal iCursorType As
Integer) As ????

I'm not looking for the Function to return a value, just to set the
MousePointer icon.

But where is the list of arguments and corresponding cursor
(MousePointer) types? The MousePointer constants used in VBA are
named with a different pattern than the MousePointer constants used in
VB6. . . . And the WinAPI constants may be different as well.

Thanks,

Fred Holmes

The sample in the above book is:

Declare Function SwapMouseButton Lib "user32" (ByVal bSwap As Long) As
Long

but then talks about the argument being boolean (as the "b" in bSwap
would indicate). So what's the "As Long"??

On Fri, 24 Aug 2001 23:07:41 +0530, Shyam Pillai <Sh...@Asia.com>
wrote:

Steve Rindsberg

unread,
Aug 24, 2001, 2:44:30 PM8/24/01
to
You can set MousePointer for userforms and such, but apparently not for the
app itself.
API-time, as Shyam says.

--
Steve Rindsberg, PowerPoint MVP
Got a PowerPoint wish/suggestion/beef?
Email msw...@microsoft.com with PowerPoint in the subject line
Get the PPT FAQs at http://www.rdpslides.com/pptfaq/
RnR PPTools - http://www.rdpslides.com/pptools/
------
Fred Holmes <fho...@schaferdc.com> wrote in message
news:3b8a817a...@msnews.microsoft.com...

Shyam Pillai

unread,
Aug 25, 2001, 9:50:04 AM8/25/01
to
Fred,

You can lookup information on the API calls on
http://msdn.microsoft.com .

Sample example
' ----- Beginning of Code -----
Option Explicit
Public gHourglassCursor As Long
Public gPrevCursor As Long
Public Const IDC_WAIT As Long = 32514
Public Const IDC_APPSTARTING As Long = 32650
Public Const IDC_ARROW As Long = 32512

Declare Function SetCursor Lib "USER32" _
(ByVal hCursor As Long) As Long
Declare Function LoadCursor Lib "USER32" Alias _
"LoadCursorA" (ByVal hInstance As Long, _
ByVal lpCursorName As Any) As Long
Declare Sub Sleep Lib "kernel32" (ByVal lSleepTime As Long)

Sub Test()
gHourglassCursor = LoadCursor(0, IDC_WAIT)
gPrevCursor = SetCursor(gHourglassCursor)
Sleep 5000
Call SetCursor(gPrevCursor)
End Sub
' ----- End Of Code -----

Regards
Shyam Pillai

http://www.mvps.org/skp

Image Importer Wizard
http://www.mvps.org/skp/iiw.htm


On Fri, 24 Aug 2001 18:35:35 GMT, fho...@schaferdc.com (Fred Holmes)

Fred Holmes

unread,
Aug 27, 2001, 8:37:30 AM8/27/01
to
Thanks,

This looks like what I am looking for.

Fred Holmes

On Sat, 25 Aug 2001 19:20:04 +0530, Shyam Pillai <Sh...@Asia.com>

Fred Holmes

unread,
Aug 28, 2001, 12:58:37 PM8/28/01
to
Thanks, this does exactly what I want for the current problem.

But, I've gone to http://msdn.microsoft.com and done a search on
"mouse" and "mouse cursor" and a few other things.

1. It's exceedingly slow.

2. Nothing so far has come up with a complete list of the constants
and their values for all of the possible MousePointer (MouseCursor)
shapes? Where do I find that list (or what do I search on)?

So I can adapt this to my next requirement.

Thanks,

Fred Holmes

On Sat, 25 Aug 2001 19:20:04 +0530, Shyam Pillai <Sh...@Asia.com>

Shyam Pillai

unread,
Aug 29, 2001, 10:33:42 PM8/29/01
to
Fred,
I think the API Text Viewer which is available as a part of Visual
Studio is available for free download (I may be mistaken). This will
provide with information of the common structures/declarations for
using API's.

Also download the API Guide (PostcardWare) from
http://www.allapi.net/. It is a handy download which includes examples
of API's .


Regards
Shyam Pillai

http://www.mvps.org/skp

Shyam's ToolBox
http://www.mvps.org/skp/toolbox/index.htm

On Tue, 28 Aug 2001 16:58:37 GMT, fho...@schaferdc.com (Fred Holmes)

0 new messages