Solved

Set Window's Mouse Pointer dynamically

Posted on 2002-07-30
9
176 Views
Last Modified: 2010-05-01
Hi,

How can i set the Window's Mouse Pointer dynamically (Not Screen.MouseIcon or Form.MouseIcon)?

That's go to Control Panel, then select "Mouse", go to "Pointers" and change the "Normal Select" pointer. How can i achieve that?

I want to change the Mouse Pointer when a process is started, and i want it to change back to Default when the process is finished.

Thank you.
0
Comment
Question by:trowa
9 Comments
 
LVL 4

Accepted Solution

by:
TigerZhao earned 50 total points
ID: 7187536
1. Active Mouse Control Panel, use
shell "rundll32.exe shell32.dll,Control_RunDLL main.cpl",vbNormalFocus  

2. Because Window is a multi-process system, it's bad habit to do what your want.
0
 
LVL 2

Expert Comment

by:manojanand
ID: 7188022
You can use the API call

Public Declare Function SetCursorPos Lib "user32" Alias "SetCursorPos" (ByVal x As Long, ByVal y As Long) As Long

on formload get the cursor position using

Public Declare Function GetCursorPos Lib "user32" Alias "GetCursorPos" (lpPoint As POINTAPI) As Long



then move the cursor to the desired location using setcursor position

then  when u unload the form set the old cursor position
0
 

Author Comment

by:trowa
ID: 7192780
No, i just want to change the Mouse Cursor, i think both of the comments are not answering the question.
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 

Author Comment

by:trowa
ID: 7204863
Any other comments?
0
 
LVL 33

Expert Comment

by:hongjun
ID: 7226353
Not sure if this is the one you want. Simply add a command button named "Command1".

Private Sub Command1_Click()
    Me.MousePointer = vbNormal
End Sub

Private Sub Form_Load()
    Me.MousePointer = vbHourglass
End Sub


hongjun
0
 
LVL 33

Expert Comment

by:hongjun
ID: 7226356
some more constants

vbDefault 0 (Default) Shape determined by the object.
vbArrow 1 Arrow.
vbCrosshair 2 Cross (crosshair pointer).
vbIbeam 3 I beam.
vbIconPointer 4 Icon (small square within a square).
vbSizePointer 5 Size (four-pointed arrow pointing north, south, east, and west).
vbSizeNESW 6 Size NE SW (double arrow pointing northeast and southwest).
vbSizeNS 7 Size N S (double arrow pointing north and south).
vbSizeNWSE 8 Size NW SE (double arrow pointing northwest and southeast).
vbSizeWE 9 Size W E (double arrow pointing west and east).
vbUpArrow 10 Up Arrow.
vbHourglass 11 Hourglass (wait).
vbNoDrop 12 No Drop.
vbArrowHourglass 13 Arrow and hourglass.
vbArrowQuestion 14 Arrow and question mark.
vbSizeAll 15 Size all.
vbCustom 99 Custom icon specified by the MouseIcon property.



hongjun
0
 

Author Comment

by:trowa
ID: 7235465
Hi hongjun,

the Me.MousePointer is only work for a single application, right? At the moment, i hope i can change the System MousePointer.

Similarly go to Control Panel, then select "Mouse", go to "Pointers" and change the "Normal Select" pointer.

i want to do this for my research application, that's is:

Change the MousePointer when the Main Program Window is minimized, then restore the MousePointer when the Main Program Window is restored.

TQ
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 8049106
Hi trowa,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept TigerZhao's comment(s) as an answer.

trowa, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 

Expert Comment

by:SpideyMod
ID: 8095934
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Copy a row 12 64
How to make an ADE file by code? 11 94
VB6 ListBox Question 4 48
add criteria to query in VB, Access 2003 2 8
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

839 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