Jump to content

_Regjump


Mehmet
 Share

Recommended Posts

[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]
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...