Sign in to follow this  
Followers 0
Joe-Schmo

Help with applying registry updates

6 posts in this topic

Hey all,

Here is a simple script:

RegWrite ( "HKCU\Control Panel\Mouse", "SwapMouseButtons", "REG_SZ", "1" )

This is simply switching the left/right mouse buttons around for left handed users in windows 2000.

The problem Im having is Im trying to apply these changes without logging out of the workstation and back in.

Does anyone know of a way to Apply or re-read user registry settings?

Thanks

Share this post


Link to post
Share on other sites



try this:

ProcessClose("explorer.exe")
Do
    Sleep(1000)
Until ProcessExists("explorer.exe") = 0
Run("explorer.exe")

Arjan

Share this post


Link to post
Share on other sites

Thanks for the suggestion! However this did not work. It does what you want it to but it does not reload the mouse changes I have may until I logout and re-login.

Any other suggestions?

Share this post


Link to post
Share on other sites

This might work

Run this command

RunDll32.exe USER32.DLL,UpdatePerUserSystemParameters ,1 ,True


Start here if you are new Valuater's AutoIT 1-2-3Looking for an UDF - Look hereDo you need to do it twice - Autoit

Share this post


Link to post
Share on other sites

RUNDLL32 USER32.DLL,SwapMouseButton

Well work the one way :)


Start here if you are new Valuater's AutoIT 1-2-3Looking for an UDF - Look hereDo you need to do it twice - Autoit

Share this post


Link to post
Share on other sites

HI,

try:

#cs
    mode = 1 for swapping
    mode = 0 for returning to normal mode
#ce

SwapMouseButton()
ToolTip("swapped!", 0, 0)
Sleep(5000)
SwapMouseButton(0)
ToolTip("Normal!", 0, 0)

Func SwapMouseButton($mode = 1)
    DllCall("user32.dll", "int", "SwapMouseButton", "int", $mode)
EndFunc   ;==>SwapMouseButton

_SwitchMousePrimary(_MouseGetPrimary())
Func _MouseGetPrimary()
    Local $aDLLMButton = DllCall('User32.dll', 'int', 'SwapMouseButton', 'int', True)
    If IsArray($aDLLMButton) And $aDLLMButton[0] <> 0 Then Return 0
    If IsArray($aDLLMButton) And $aDLLMButton[0] = 0 Then DllCall('User32.dll', 'int', 'SwapMouseButton', 'int', False)
    Return 1
EndFunc   ;==>_MouseGetPrimary

Func _SwitchMousePrimary($nPrimary)
    Return DllCall('User32.dll', 'int', 'SwapMouseButton', 'int', $nPrimary)
EndFunc

So long,

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0