Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Change the Mouse Pointer

Posted on 1999-07-22
1
Medium Priority
?
192 Views
Last Modified: 2010-04-30
How can I set the 'Normal Select' Mouse Pointer of Windows NT, not just my program, to an .ANI file that I created.  I want to be able to change it with my program and exit.  Then run the program again to change it back to the default pointer.  Any ideas?

Thanks!
0
Comment
Question by:jfunderb
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 

Accepted Solution

by:
frogman_j earned 400 total points
ID: 1526775
To change the mouse pointers you need to edit the registry. The path in the registry is:

HKEY_CURRENT_USER\Control Panel\Cursors

Take a look with Regedit to see what I mean. Here is a chunk I got from the help files that came with Visual Studio 6. I has the stuff you need to edit the registry.

' *********************************************************
' Registry Module for Visual Basic for Applications under Windows 95
' Declarations and Control Module
' *********************************************************
Option Explicit
' **********************************************
' Declare the specific key path for your
' application's settings in the registry.
' **********************************************
Public Const AppReg = "MyAppName"
Private Const REG_APP_KEYS_PATH = "Software\MYApps\" & AppReg
' **********************************************
' Specify constants to specific branches in the
' registry.
' **********************************************
Global Const HKEY_CLASSES_ROOT = &H80000000
Global Const HKEY_CURRENT_USER = &H80000001
Global Const HKEY_LOCAL_MACHINE = &H80000002
Global Const HKEY_USERS = &H80000003
Private Const ERROR_SUCCESS = 0&
Private Const ERROR_NO_MORE_ITEMS = 259&
' **********************************************
' Specify constants to registry data types.
' These are declared Public for outside module
' usage in the GetAppRegValue() function.
' **********************************************
Public Const REG_NONE = 0
Public Const REG_SZ = 1
Public Const REG_EXPAND_SZ = 2
Public Const REG_BINARY = 3
Public Const REG_DWORD = 4
Public Const REG_DWORD_LITTLE_ENDIAN = 4
Public Const REG_DWORD_BIG_ENDIAN = 5
Public Const REG_LINK = 6
Public Const REG_MULTI_SZ = 7
Public Const REG_RESOURCE_LIST = 8
' **********************************************
' Specify constants to registry action types.
' **********************************************
Private Const REG_OPTION_NON_VOLATILE = 0
Private Const KEY_QUERY_VALUE = &H1
Private Const KEY_SET_VALUE = &H2
Private Const KEY_CREATE_SUB_KEY = &H4
Private Const KEY_ENUMERATE_SUB_KEYS = &H8
Private Const KEY_NOTIFY = &H10
Private Const KEY_CREATE_LINK = &H20
Private Const SYNCHRONIZE = &H100000
Private Const STANDARD_RIGHTS_ALL = &H1F0000
Private Const KEY_ALL_ACCESS = ((STANDARD_RIGHTS_ALL Or KEY_QUERY_VALUE Or _
   KEY_SET_VALUE Or KEY_CREATE_SUB_KEY Or KEY_ENUMERATE_SUB_KEYS Or _
   KEY_NOTIFY Or KEY_CREATE_LINK) And (Not SYNCHRONIZE))
' **********************************************
' Security mask attributes for Windows NT (SAM).
' **********************************************
Type SECURITY_ATTRIBUTES
   nLength As Long
   lpSecurityDescriptor As Long
   bInheritHandle As Boolean
End Type
Declare Function RegCreateKey Lib "advapi32" Alias "RegCreateKeyA" _
   (ByVal hKey As Long, _
    ByVal lpszSubKey As String, _
    phkResult As Long) _
    As Long
Declare Function RegCreateKeyEx Lib "advapi32.dll" Alias "RegCreateKeyExA" _
   (ByVal hKey As Long, _
    ByVal lpSubKey As String, _
    ByVal Reserved As Long, _
    ByVal lpClass As String, _
    ByVal dwOptions As Long, _
    ByVal samDesired As Long, _
    lpSecurityAttributes As Any, _
    phkResult As Long, lpdwDisposition As Long) _
    As Long
   
Declare Function RegDeleteKey Lib "advapi32.dll" Alias "RegDeleteKeyA" _
   (ByVal hKey As Long, _
    ByVal lpSubKey As String) _
    As Long
   
Declare Function RegDeleteValue Lib "advapi32.dll" Alias "RegDeleteValueA" _
   (ByVal hKey As Long, _
    ByVal lpValueName As String) _
    As Long
   
Declare Function RegCloseKey Lib "advapi32.dll" _
   (ByVal hKey As Long) _
    As Long
Declare Function RegEnumKeyEx Lib "advapi32" Alias "RegEnumKeyA" _
   (ByVal hKey As Long, _
    ByVal iSubKey As Long, _
    ByVal lpszName As String, _
    ByVal cchName As Long) _
    As Long
   
Declare Function RegOpenKeyEx Lib "advapi32" Alias "RegOpenKeyExA" _
   (ByVal hKey As Long, _
    ByVal lpszSubKey As String, _
    ByVal ulOptions As Long, _
    ByVal samDesired As Long, _
    phkResult As Long) _
    As Long
   
Declare Function RegQueryValueEx Lib "advapi32" Alias "RegQueryValueExA" _
   (ByVal hKey As Long, _
    ByVal lpszValueName As String, _
    ByVal dwReserved As Long, _
    lpdwType As Long, _
    lpbData As Any, _
    cbData As Long) _
    As Long
   
Declare Function RegSetValueEx Lib "advapi32" Alias "RegSetValueExA" _
   (ByVal hKey As Long, _
    ByVal lpszValueName As String, _
    ByVal dwReserved As Long, _
    ByVal fdwType As Long, _
    lpbData As Any, _
    ByVal cbData As Long) _
    As Long
Declare Function RegSetStringEx Lib "advapi32" Alias "RegSetValueExA" _
   (ByVal hKey As Long, _
    ByVal lpszValueName As String, _
    ByVal dwReserved As Long, _
    ByVal fdwType As Long, _
    lpbData As String, _
    ByVal cbData As Long) _
    As Long
Declare Function GetCurrentProcessId Lib "Kernel32" () As Long
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

715 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