![]() | |
| Home Page | Mark Forums Read | Today's Posts | My Replies | Classifieds | Reviews | Photo Gallery | Web Links | Share Files | Advertise With Us | Ad List |
| |||||||
| CNCzone Club House Discuss everything in between CNC. THIS IS NOT A TRASH BIN. |
| This forum is sponsored by: |
![]() |
| | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
| ||||
| ||||
| O/T Mouse Settings.."Snap To" Is there a way of getting straight to the SNAP TO toggle of the mouse/pointer options? I love having it on about 50% of the time, and HATE it the other 55%. When in Mastercam, I want to be able to toggle it on and off without having to open mouse properties, click the right tab, then click the toggle button. I'm pretty sure that data is stored in the registry, but don't know where. If it IS there, I can write 2 reg files that will toggle it, then run those files from my quick launch. Is this AT ALL possible? Or am I all wet? TYIA 'Rekd
__________________ Matt San Diego, Ca ___ o o o_ [l_,[_____], l---L - □lllllll□- ( )_) ( )_)--)_) (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management) |
|
#2
| ||||
| ||||
| Try searching regedit for SnapToDefaultButton HKEY_LOCAL_MACHINE| SOFTWARE| MICROSOFT| WINDOWS NT| INIFILEMAPPING| WIN.INI| WINDOWS There is a bunch of stuff in there to do with mouse.
__________________ First you get good, then you get fast. Then grouchiness sets in. (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management) |
|
#3
| ||||
| ||||
| I can change it in the Mouse Options dialog and it updates the registry. I can't change the registry and have it update. Mayhaps there's another setting that goes with it? 'Rekd
__________________ Matt San Diego, Ca ___ o o o_ [l_,[_____], l---L - □lllllll□- ( )_) ( )_)--)_) (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management) |
|
#4
| |||
| |||
I wrote a small commandline utility that will let you change the snap to setting without rebooting. http://ullberg.us/files/MouseControl.zip usage: MouseControl.exe /snaptodefault [true|false] if you run it without any command line parameters at all it will toggle the setting. disclaimer: I wrote this in 5 minutes, it looks like it is working fine for me on windows 2000, but there may be bugs. Some other restrictions are that the command line parameters need to be in lower case and you also need the .NET framework 1.1 installed. Let me know if you dont want to install the .net framework and i'll write a c++ version instead. hope this helps edit: Changed the link to a zipfile |
|
#5
| |||
| |||
| Updated the zipfile with a c++ version of the program. This version has even less features.. all it does it toggle the setting and exit. No feedback and no command line parameters. I can add that later if you want. (didnt want to spend a lot of time on it if you already had the .net framework installed) |
| Sponsored Links |
|
#6
| ||||
| ||||
| Thanks ullbergm. That works. Question; I do VB6 programmin, where do you send the WM_SETTINGSCHANGE message? Can I do this with VB6? 'Rekd
__________________ Matt San Diego, Ca ___ o o o_ [l_,[_____], l---L - □lllllll□- ( )_) ( )_)--)_) (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management) |
|
#7
| |||
| |||
You need to call a windows api called SystemParametersInfo BOOL SystemParametersInfo( UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni ); I dont remember how to import external dll's in vb right now but after you import it you call it with the following parameters: Get the value: uiAction = SPI_GETSNAPTODEFBUTTON (0x005F) uiParam = 0 pvParam = reference to a integer fWinIni = 0 if pvParam is 1 it's enabled, 0 disabled Set the value: uiAction = SPI_SETSNAPTODEFBUTTON (0x0060 uiParam = 1 or 0 (depending on if you want to enable or disable it) pvParam = reference to a integer (may be able to set this to null, not sure, dont use it anyways..) fWinIni = SPIF_SENDCHANGE (0x0002) All i did was to read the previous value and set it to the opposite to toggle it. Here is the c# code to give you some idea of what it looks like:
|
|
#8
| |||
| |||
| one more thing, i didnt include any error checking at all. you should check the return value of SystemParametersInfo it returns a boolean telling you wether the call was successful or not. If it fails you should call GetLastError Here is the MSDN page explaining the function: http://msdn.microsoft.com/library/de...metersinfo.asp |
|
#9
| ||||
| ||||
| I got it to work in VB. This is just running it on a form with 2 command buttons. I'm going to set up a tray icon to toggle it. Thanks again for your help! ![]() PHP Code:
__________________ Matt San Diego, Ca ___ o o o_ [l_,[_____], l---L - □lllllll□- ( )_) ( )_)--)_) (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management) |
|
#10
| |||
| |||
glad i could help |
| Sponsored Links |
|
#11
| ||||
| ||||
| Update.. I made this with ullbergm's help and some help from Extreme Visual Basic Forum. If anyone wants, you're welcome to it. What I do (for now, until I set it up to run from the tray), is put a shortcut in my quick launch and toggle it on and off when I need to. :edit: BTW, this will only work on OS's that support this mouse function, and may only work on XP and 2k machines. :/edit: 'Rekd
__________________ Matt San Diego, Ca ___ o o o_ [l_,[_____], l---L - □lllllll□- ( )_) ( )_)--)_) (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management) |
|
#12
| |||
| |||
| Re: Update..
Cool, isnt it satisfying to write something that is actually useful? I do software development for a living and it's great when you can see people actually use what you wrote and that it is making their work easier.
Requirements Client: Included in Windows XP, Windows 2000 Professional, Windows NT Workstation, Windows Me, Windows 98, and Windows 95. |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Mutilated mouse DRO (using Microsoft PS2 Mice) | wcarrothers | General Electronics Discussion | 6 | 03-30-2009 12:37 PM |
| Fun with steppers (From serial mouse to stepper) | Konstantin | General Electronics Discussion | 0 | 07-21-2004 01:41 PM |