Solved

get the current mouse cursor type

Posted on 2016-10-01
5
27 Views
Last Modified: 2016-11-09
I am setting up a custom application i would like to get the user current mouse type,before changing it to a custom cursor type so i can restore it when the application closes.
0
Comment
Question by:Svgmassive
  • 2
5 Comments
 
LVL 33

Accepted Solution

by:
ste5an earned 334 total points
ID: 41824935
Use Screen.MousePointer. E.g.

Public Sub YourMethod()

  Dim OldMousePointer As Long
 
  OldMousePointer = Screen.MousePointer
  Screen.MousePointer = ccHourglass
  'some code
  Screen.MousePointer = OldMousePointer

End Sub

Open in new window


with either a reference on MSComctLib or

Public Enum MousePointerConstants

  'Default
  ccDefault = 0  '&H0

  'Arrow mouse pointer
  ccArrow = 1  '&H1

  'Cross mouse pointer
  ccCross = 2  '&H2

  'I-Beam mouse pointer
  ccIBeam = 3  '&H3

  'Icon mouse pointer
  ccIcon = 4  '&H4

  'Size mouse pointer
  ccSize = 5  '&H5

  'Size NE SW mouse pointer
  ccSizeNESW = 6  '&H6

  'Size N S mouse pointer
  ccSizeNS = 7  '&H7

  'Size NW SE mouse pointer
  ccSizeNWSE = 8  '&H8

  'Size W E mouse pointer
  ccSizeEW = 9  '&H9

  'Up arrow mouse pointer
  ccUpArrow = 10  '&HA

  'Hourglass mouse pointer
  ccHourglass = 11  '&HB

  'No drop mouse pointer
  ccNoDrop = 12  '&HC

  'Arrow and Hourglass mouse pointer
  ccArrowHourglass = 13  '&HD

  'Arrow and Question mark mouse pointer
  ccArrowQuestion = 14  '&HE

  'Size all mouse pointer
  ccSizeAll = 15  '&HF

  'Custom mouse pointer icon specified by the MouseIcon property
  ccCustom = 99  '&H63
End Enum

Open in new window

1
 
LVL 19

Assisted Solution

by:crystal (strive4peace) - Microsoft MVP, Access
crystal (strive4peace) - Microsoft MVP, Access earned 166 total points
ID: 41824937
The Mouse Pointer is controlled by Windows so APIs can be used to change it.

Displaying a custom Mouse icon by Terry Kreft
http://access.mvps.org/access/api/api0044.htm

Here is a page on MSDN that discusses the cursor.
https://msdn.microsoft.com/en-us/library/windows/desktop/ms648379(v=vs.85).aspx

Use the GetCursor function to find out about the cursor before you change anything.
0
 

Author Comment

by:Svgmassive
ID: 41824989
OldMousePointer = Screen.MousePointer is returning Zero.not working
0
 
LVL 33

Assisted Solution

by:ste5an
ste5an earned 334 total points
ID: 41824993
It is. It just means that the current pointer, accessed by reading Screen.MousePointer, is ccDefault = 0. Thus the normal arrow pointer.
1

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now