Mehmet Posted June 3, 2012 Share Posted June 3, 2012 [b]örnek kullanım [/b] [code]Case $Button1 _RegJump('HKCR\lnkfile')[/code] [quote][codebox] Func _RegJump($sKey) Local $Root, $Text = StringSplit($sKey, '\', 2) If IsArray($Text) Then $Text = $Text[0] Else $Text = $sKey EndIf Switch $Text Case 'HKEY_CLASSES_ROOT', 'HKEY_CURRENT_USER', 'HKEY_LOCAL_MACHINE', 'HKEY_USERS', 'HKEY_CURRENT_CONFIG' $Root = $Text Case 'HKCR' $Root = 'HKEY_CLASSES_ROOT' Case 'HKCU' $Root = 'HKEY_CURRENT_USER' Case 'HKLM' $Root = 'HKEY_LOCAL_MACHINE' Case 'HKU' $Root = 'HKEY_USERS' Case 'HKCC' $Root = 'HKEY_CURRENT_CONFIG' Case Else Return 0 EndSwitch Local $Class = '[CLASS:RegEdit_RegEdit]', $Delay = Opt('WinWaitDelay', 0) Local $Prev, $Result = 1 If WinExists($Class) Then WinClose($Class) If Not WinWaitClose($Class, '', 5) Then $Result = 0 EndIf EndIf If $Result Then $Prev = RegRead('HKCU\Software\Microsoft\Windows\CurrentVersion\Applets\Regedit', 'Lastkey') If @error Then $Prev = 0 EndIf If Not RegWrite('HKCU\Software\Microsoft\Windows\CurrentVersion\Applets\Regedit', 'Lastkey', 'REG_SZ', StringReplace($sKey, $Text, $Root, 1)) Then $Result = 0 Else If Not Run('regedit.exe') Then $Result = 0 If IsString($Prev) Then RegWrite('HKCU\Software\Microsoft\Windows\CurrentVersion\Applets\Regedit', 'Lastkey', 'REG_SZ', $Prev) EndIf EndIf EndIf EndIf Opt('WinWaitDelay', $Delay) Return $Result EndFunc ;==>_RegJump [/codebox][/quote] [b][color="#0000FF"]Not: Alıntıdır[/color][/b] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.