Header
PowerPoint tips, hints and tutorials that will change your presentations for ever!

INDEX

 

Jigsaws
Sounds
Video
Custom Shows
vba code
NaviSlides
Games for teachers
Bullets
Triggers
Security
Flash Cards
Multiple Instances
PowerPoint 2007
Mail Merge
Random events
Animation
Hyperlinks
Set spellcheck language


Home buttonTutorial buttonContact buttonProducts button


Vba to Change the System Cursor

This is code for competent users. It makes changes to the standard arrow cursor SYSTEM WIDE not just in PowerPoint. If you don't understand where the cursors are stored or the path to your standard arrow cursor then we suggest you don't mess!

Use at your own risk! We suggest you add a button at the end of your presentation that resets the cursor.

 

Usually restarting your PC will get you back to normal but we don't guarantee this.

The code changes the standard arrow cursor to a cursor stored in the custom path and then sets the boolean flag to false so that running again should change to the path stored for the standard cursor. Make sure this path is correct for your PC. It is not necessarily the same as the one here!

'API Declarations - Don't mess with these at all!
Public Declare Function CopyIcon Lib "user32" _
(ByVal hIcon As Long) As Long

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

Public Declare Function SetSystemCursor Lib "user32" _
(ByVal hcur As Long, ByVal id As Long) As Long

Public Declare Function GetCursor Lib "user32" () As Long

'Constant and variables
Public Const lOCR_NORMAL As Long = 32512
Private b_Custom As Boolean 'Custom cursor yes / no


Sub change_cur()

If b_Custom = False Then
'Change to path to custom cursor
ChangeCursor "C:\Windows\cursors\move_l.cur"
b_Custom = True
Else
'path to normal arrow (this depends on OS and display scheme)
'this is medium size arrow make sure you know the path to your normal arrow!
ChangeCursor "C:\Windows\cursors\arrow_m.cur"
b_Custom = False
End If


End Sub

Private Sub ChangeCursor(sCursPath As String)

Dim lCursor As Long
lCursor = LoadCursorFromFile(sCursPath)
SetSystemCursor lCursor, lOCR_NORMAL

End Sub

Sub reset_Cur
b_Custom = True
Call change_cur
End Sub

 
 

Back to the Index Page

POWERPOINT BLOG

Articles on your favourite sport

Free Microsoft PowerPoint Advice, help and tutorials, Template Links
This website is sponsored by Technology Trish Ltd
© Technology Trish 2007
Registered in England and Wales No.5780175
PowerPoint® is a registered trademark of the Microsoft Corporation