Bert Posted December 2, 2014 Posted December 2, 2014 I having to run the Adobe flash player for an app my wife uses to teach with in her classroom. I'm being asked is there a way while the player is active a custom cursor can be used. (not a windows cursor) . The current workaround is setting the cursor manually however that cursor is replacing the default one and that is not desirable. I've searched in the forum and I can't find anything that gives a simple example of what I need. Everything I find either shows you have to create a GUI and that is not what I'm looking for or I see "_WinAPI_LoadCursor() in Yashied's WinAPIEx UDF" in Example Scripts. However the download link is gone and _WinAPI_LoadCursor is not in the helpfile. Any ideas? I'm just looking for a code example that shows how to do what I need. Thanks. The Vollatran project My blog: http://www.vollysinterestingshit.com/
computergroove Posted December 3, 2014 Posted December 3, 2014 (edited) Do you know where the current cursor is now? Just make a backup and replace it with the custom one and on exit replace the cursor back to the original. If you talk it out here I will assist. If you know the location in the registry (assuming it's in there) then it will be pretty easy. Edit - Found it -> http://www.sevenforums.com/tutorials/2402-mouse-pointers-change.html its located in HKEY_CURRENT_USERControl PannelCursorsArrow Edit2 - I made a script that changed the registry value and it didnt work so I manually changed the registry key only to find that it didn't work either. Still looking.... Edited December 3, 2014 by computergroove Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html
Solution computergroove Posted December 3, 2014 Solution Posted December 3, 2014 (edited) Finally got it. #RequireAdmin #include <MsgBoxConstants.au3> #include <WinAPI.au3> #include <WinAPIsysinfoConstants.au3> #include <WindowsConstants.au3> HotKeySet("{ESC}","Terminate") HotKeySet("{F3}","ToggleCursor") Global $NewCursor Global $OriginalCursor = RegRead("HKEY_CURRENT_USER\Control Panel\Cursors", "Arrow");Read the original cursor value Global $RegKeyCursor1= "HKEY_CURRENT_USER\Control Panel\Cursors";Location of the cursor info in the registry While 1 Sleep(100) WEnd Func ToggleCursor() $NewCursor = NOT $NewCursor RegWrite($RegKeyCursor1,"Arrow","REG_EXPAND_SZ","%SystemRoot%\cursors\aero_ew.cur");Change the cursor value in the registry _WinAPI_SystemParametersInfo($SPI_SETCURSORS, 0);Refresh the mouse settings used in the registry While $NewCursor;loop Sleep(100);loop WEnd;loop RegWrite($RegKeyCursor1,"Arrow","REG_EXPAND_SZ",$OriginalCursor);Restore the original mouse value in the registry _WinAPI_SystemParametersInfo($SPI_SETCURSORS, 0);Refresh the mouse settings used in the registry EndFunc Func Terminate() Exit 0 EndFunc F3 toggles the cursor and esc exits the program. Edited December 3, 2014 by computergroove Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html
Bert Posted December 3, 2014 Author Posted December 3, 2014 Thats got it. Thanks! The Vollatran project My blog: http://www.vollysinterestingshit.com/
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now