PC Review Forums Newsgroups Microsoft Outlook Microsoft Outlook VBA Programming mousePointer control during Macro

Reply

mousePointer control during Macro

 
Thread Tools Rate Thread
Old 05-07-2005, 08:13 PM   #1
=?Utf-8?B?TWFyeQ==?=
Guest
 
Posts: n/a
Default mousePointer control during Macro


I have a macro that calls a DLL. A menu action calls the macro. I need to
give the user some indication that it is executing - How do I change the
mousePointer to an hourglass shape prior to calling the DLL? I searched the
help and found the mousepointer property, but it only exists for forms and
controls that are placed on them, and I am not using a form.

Any ideas
  Reply With Quote
Old 05-07-2005, 08:45 PM   #2
=?Utf-8?B?RXJpYyBMZWdhdWx0IFtNVlAgLSBPdXRsb29rXQ==
Guest
 
Posts: n/a
Default RE: mousePointer control during Macro

You have to use the Win32 API to change the mouse cursor. Here's some code I
Googled:

Public Const IDC_APPSTARTING = 32650&
Public Const IDC_ARROW = 32512&
Public Const IDC_CROSS = 32515&
Public Const IDC_IBEAM = 32513&
Public Const IDC_ICON = 32641&
Public Const IDC_NO = 32648&
Public Const IDC_SIZE = 32640&
Public Const IDC_SIZEALL = 32646&
Public Const IDC_SIZENESW = 32643&
Public Const IDC_SIZENS = 32645&
Public Const IDC_SIZENWSE = 32642&
Public Const IDC_SIZEWE = 32644&
Public Const IDC_UPARROW = 32516&
Public Const IDC_WAIT = 32514&

Declare Function LoadCursorBynum Lib "user32" Alias "LoadCursorA" _
(ByVal hInstance As Long, ByVal lpCursorName As Long) As Long

Declare Function LoadCursorFromFile Lib "user32" Alias _
"LoadCursorFromFileA" (ByVal lpFileName As String) As Long

Declare Function SetCursor Lib "user32" _
(ByVal hCursor As Long) As Long

Function MouseCursor(CursorType As Long)
Dim lngret As Long
lngret = LoadCursorBynum(0&, CursorType)
lngret = SetCursor(lngret)
End Function

Function PointM(strPathToCursor As String)
Dim lngret As Long
lngret = LoadCursorFromFile(strPathToCuÂ*rsor)
lngret = SetCursor(lngret)
End Function

--
Eric Legault - B.A, MCP, MCSD, Outlook MVP
Try Picture Attachments Wizard for Outlook! http://tinyurl.com/ckytm
Job: http://www.imaginets.com
Blog: http://blogs.officezealot.com/legault/


"Mary" wrote:

> I have a macro that calls a DLL. A menu action calls the macro. I need to
> give the user some indication that it is executing - How do I change the
> mousePointer to an hourglass shape prior to calling the DLL? I searched the
> help and found the mousepointer property, but it only exists for forms and
> controls that are placed on them, and I am not using a form.
>
> Any ideas

  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off