Jump to content

Regedit Okuyucusu


asmazh
 Share

Recommended Posts

Merhabalar,
Dün canım sıkıldı kitabı attım kenara (Üniversiteye hazırlanıyorum da) dedim bu kadar yeter.
Bilgisayarı açtım stres atmak için program yazayım dedim ama ne yazacam diye düşünmeye başladım.
Eni sonu bu geldi aklıma sizlerle paylaşmak istedim. Eksik yönleri olabilir aceleye geldi zaten. [color="#FF0000"]Yorumlarınızı bekliyorum arkadaşlar.[/color]
[img]http://www.tnctr.com/uploads/imgs/pre_1328524107__sb_-_642634492294863.jpeg[/img]

[media]http://www.upload.gen.tr/d.php/www/ccx2ycy8/RegAu3.au3.html[/media]

[codebox]#region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Res_Comment=RegAu3
#AutoIt3Wrapper_Res_Fileversion=1.0.0.0
#AutoIt3Wrapper_Res_LegalCopyright=Mahmut TAŞKIRAN Copyright :)
#AutoIt3Wrapper_Res_Language=1055
#AutoIt3Wrapper_Res_requestedExecutionLevel=requireAdministrator
#endregion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <TreeViewConstants.au3>
#include <WindowsConstants.au3>
#include <GuiTreeView.au3>
#include <GuiListView.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GuiComboBoxEx.au3>
#include <GuiStatusBar.au3>
#include <StaticConstants.au3>
#include <GuiRichEdit.au3>
$Form1 = GUICreate("Regedit Okuyucusu - Mahmut TAŞKIRAN [AsmazH]", 618, 478, 241, 139)
GUISetBkColor(0xFFFFFF)
Local $iStyle = BitOR($TVS_HASBUTTONS, $TVS_HASLINES, $TVS_LINESATROOT, $TVS_DISABLEDRAGDROP, $TVS_SHOWSELALWAYS, $TVS_CHECKBOXES, $WS_BORDER)

$TreeView1 = GUICtrlCreateTreeView(8, 8, 177, 441, $iStyle)
Global $TreeView1_0 = _GUICtrlTreeView_Add($TreeView1, 0, "HKEY_CLASSES_ROOT")
_RegEnumKey_ListAdd("HKCR", $TreeView1_0)
Global $TreeView1_1 = _GUICtrlTreeView_Add($TreeView1, 0, "HKEY_LOCAL_MACHINE")
_RegEnumKey_ListAdd("HKLM", $TreeView1_1)
Global $TreeView1_2 = _GUICtrlTreeView_Add($TreeView1, 0, "HKEY_CURRENT_USER")
_RegEnumKey_ListAdd("HKCU", $TreeView1_2)
Global $TreeView1_3 = _GUICtrlTreeView_Add($TreeView1, 0, "HKEY_USERS")
_RegEnumKey_ListAdd("HKU", $TreeView1_3)
Global $TreeView1_4 = _GUICtrlTreeView_Add($TreeView1, 0, "HKEY_CURRENT_CONFIG")
_RegEnumKey_ListAdd("HKCC", $TreeView1_4)
$ListView1 = GUICtrlCreateListView("", 192, 8, 417, 257)
_GUICtrlListView_AddColumn($ListView1, "Ad", 150)
_GUICtrlListView_AddColumn($ListView1, "Tür", 100)
_GUICtrlListView_AddColumn($ListView1, "Veri", 200)
$Input_code = GUICtrlCreateInput("", 296, 272, 313, 21)
$StatusBar1 = _GUICtrlStatusBar_Create($Form1, -1, "", BitOR($SBARS_SIZEGRIP, $SBARS_TOOLTIPS, $WS_VISIBLE, $WS_CHILD), $WS_EX_STATICEDGE)
_GUICtrlStatusBar_SetSimple($StatusBar1)
_GUICtrlStatusBar_SetText($StatusBar1, "")
$Combo1 = GUICtrlCreateCombo("RegWriteCode:", 192, 272, 97, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "RegReadCode:|RegDeleteCode:")
$Edit1 = GUICtrlCreateEdit("", 192, 300, 417, 105)
GUICtrlSetColor(-1, 0x0000FF)
$Button2_Copy = GUICtrlCreateButton("Kopyala", 192, 416, 51, 25)
$Button2_Pres = GUICtrlCreateButton("Yenile", 248, 416, 51, 25)
$Button2_Exit = GUICtrlCreateButton("Çık", 360, 416, 51, 25)
$Button2_INF = GUICtrlCreateButton("Yardım", 304, 416, 51, 25)
GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")
GUISetState(@SW_SHOW)

$Form2 = GUICreate("Bilgiler", 320, 192, -1, -1, $GUI_SS_DEFAULT_GUI, BitOR($WS_EX_TOOLWINDOW, $WS_EX_WINDOWEDGE))
GUISetBkColor(0xFFFFFF)
$Group1 = GUICtrlCreateGroup("", 8, 0, 305, 153)
$Input1_Yol = GUICtrlCreateInput("", 16, 16, 289, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_READONLY))
$Group2 = GUICtrlCreateGroup("", 16, 40, 289, 105)
$Label1 = GUICtrlCreateLabel("Ad", 22, 56, 19, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x800080)
$Input_ad = GUICtrlCreateInput("", 48, 53, 249, 21)
$Input_Veri = GUICtrlCreateInput("", 48, 85, 249, 21)
$Label3 = GUICtrlCreateLabel("Veri", 22, 88, 26, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x800080)
$Label2 = GUICtrlCreateLabel("Tür", 22, 120, 23, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x800080)
$Input_Tur = GUICtrlCreateCombo("", 48, 116, 249, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL, $WS_BORDER), $WS_EX_CLIENTEDGE)
GUICtrlSetData(-1, "REG_NONE|REG_SZ|REG_EXPAND_SZ|REG_BINARY|REG_DWORD|REG_DWORD_BIG_ENDIAN|REG_LINK|REG_MULTI_SZ|REG_RESOURCE_LIST|REG_FULL_RESOURCE_DESCRIPTOR|REG_RESOURCE_REQUIREMENTS_LIST")
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button_Sil = GUICtrlCreateButton("Sil", 160, 160, 75, 25)
$Button_Kaydet = GUICtrlCreateButton("Kaydet", 238, 160, 75, 25)
GUISetState(@SW_HIDE)


Func _Yenile()
$GetHandle = _GUICtrlTreeView_GetSelection($TreeView1)
_GUICtrlTreeView_DeleteChildren($TreeView1, $GetHandle)
_GUICtrlTreeView_SetSelected($TreeView1, $GetHandle, True)
EndFunc ;==>_Yenile

While 1
$nMsg = GUIGetMsg(1)
If $nMsg[1] = $Form1 Then
If $nMsg[0] = $GUI_EVENT_CLOSE Then Exit
If $nMsg[0] = $Button2_Copy Then
$Edi_read = GUICtrlRead($Edit1)
If $Edi_read <> "" Then
ClipPut(GUICtrlRead($Edit1))
MsgBox(64, "Başarılı!", "Kopyalandı. İstediğiniz yere yapıştırabilirsiniz.", "", $Form1)
Else
MsgBox(16, "Başarısız!", "Edit boş!", "", $Form1)
EndIf
EndIf
If $nMsg[0] = $Button2_Pres Then _Yenile()
If $nMsg[0] = $Button2_Exit Then Exit
If $nMsg[0] = $Button2_INF Then
MsgBox(32, "Hakkında!", "Program Mahmut TAŞKIRAN tarafından yazılmıştır." & @CRLF & @CRLF & "Au3 kodunu almak istediğiniz yeri fare ile ilkin sol tıklayın, sonra yine fare ile sağ tıklayıp seçili hale getirin." & @CRLF & @CRLF & "Bilmem ki öyle uzun uzadıya açıklama yapmaya gerek var mı? Sağa sola tıklayıp öğrenin işte. :)", "", $Form1)
EndIf
ElseIf $nMsg[1] = $Form2 Then
If $nMsg[0] = $GUI_EVENT_CLOSE Then
GUISetState(@SW_HIDE, $Form2)
WinSetState($Form1, "", @SW_ENABLE)
WinSetOnTop($Form1, "", 1)
WinSetOnTop($Form1, "", 0)

EndIf
If $nMsg[0] = $Button_Sil Then
_Sil()
If Not @error Then
_GUICtrlListView_DeleteItemsSelected($ListView1)
EndIf
GUISetState(@SW_HIDE, $Form2)
WinSetState($Form1, "", @SW_ENABLE)
WinSetOnTop($Form1, "", 1)
WinSetOnTop($Form1, "", 0)
EndIf

If $nMsg[0] = $Button_Kaydet Then
_Kaydet()
$aItem = _GUICtrlListView_GetItemTextArray($ListView1, _GUICtrlListView_GetSelectedColumn($ListView1))
RegDelete(GUICtrlRead($Input1_Yol), $aItem[1])
GUISetState(@SW_HIDE, $Form2)
WinSetState($Form1, "", @SW_ENABLE)
WinSetOnTop($Form1, "", 1)
WinSetOnTop($Form1, "", 0)
_GUICtrlListView_DeleteItemsSelected($ListView1)
GUICtrlCreateListViewItem(GUICtrlRead($Input_ad) & "|" & GUICtrlRead($Input_Tur) & "|" & GUICtrlRead($Input_Veri), $ListView1)

EndIf

EndIf
WEnd

Func _Kaydet()
Global $Arr_asd[2]
$iMsgBoxAnswer = MsgBox(36, "Kaydı Değiştir?", "Kaydı değiştirmek istediğinizden emin misiniz?", "", $Form1)
Select
Case $iMsgBoxAnswer = 6 ;Yes
RegWrite(GUICtrlRead($Input1_Yol), GUICtrlRead($Input_ad), GUICtrlRead($Input_Tur), GUICtrlRead($Input_Veri))
If @error Then
MsgBox(16, "Hata", "Reg kayıt değiştirilemedi!", "", $Form1)
Else
RegWrite(GUICtrlRead($Input1_Yol), GUICtrlRead($Input_ad), GUICtrlRead($Input_Tur), GUICtrlRead($Input_Veri))
$Reg_L = GUICtrlRead($Input1_Yol) & "\" & GUICtrlRead($Input_ad) & GUICtrlRead($Input_Tur) & " ''" & GUICtrlRead($Input_Veri) & "''"
MsgBox(64, "Reg kaydı değiştirildi!", "Reg kaydı değiştirildi:" & @CRLF & $Reg_L, "", $Form1)
EndIf
EndSelect
EndFunc ;==>_Kaydet

Func _Sil()
If GUICtrlRead($Input_ad) = "(Varsayılan)" Then
MsgBox(16, "Hata", "Bu kaydı silemezsiniz!", "", $Form1)
Return SetError(1)
EndIf
$iMsgBoxAnswer = MsgBox(36, "Kayır sil?", "Bu kaydı silmek istediğinden emin misin?" & @CRLF & GUICtrlRead($Input1_Yol) & "\" & GUICtrlRead($Input_ad), "", $Form1)
Select
Case $iMsgBoxAnswer = 6 ;Yes
RegDelete(GUICtrlRead($Input1_Yol) & "\", GUICtrlRead($Input_ad))
If @error Then
MsgBox(16, "Hata", "Reg kaydı silinemedi!", "", $Form1)
Else
MsgBox(64, "Reg kaydı slindi!", "Reg kaydı silindi:" & @CRLF & GUICtrlRead($Input1_Yol) & "\" & GUICtrlRead($Input_ad), "", $Form1)

EndIf
Case $iMsgBoxAnswer = 7 ;No
EndSelect
EndFunc ;==>_Sil

Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam)
#forceref $hWnd, $iMsg, $iwParam
Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $hWndTreeview
$hWndTreeview = $TreeView1
If Not IsHWnd($TreeView1) Then $hWndTreeview = GUICtrlGetHandle($TreeView1)
If Not IsHWnd($ListView1) Then $hWndListView = GUICtrlGetHandle($ListView1)
$tNMHDR = DllStructCreate($tagNMHDR, $ilParam)
$hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom"))
$iIDFrom = DllStructGetData($tNMHDR, "IDFrom")
$iCode = DllStructGetData($tNMHDR, "Code")
Switch $hWndFrom
Case $hWndTreeview
Switch $iCode
Case $NM_DBLCLK
_YolBelirle()
$GetHandle = _GUICtrlTreeView_GetSelection($TreeView1)
_RegEnumKey_ListAdd(_GUICtrlStatusBar_GetText($StatusBar1, 0), $GetHandle)
_RegEnumVal_ListAdd(_GUICtrlStatusBar_GetText($StatusBar1, 0))
Case $NM_RCLICK
_YolBelirle()
$GetHandle = _GUICtrlTreeView_GetSelection($TreeView1)

If _GUICtrlTreeView_GetChecked($TreeView1, $GetHandle) = False Then
_GUICtrlTreeView_SetChecked($TreeView1, $GetHandle, True)
_Au3Code_Edit($GetHandle, True)
Else
_GUICtrlTreeView_SetChecked($TreeView1, $GetHandle, False)
_Au3Code_Edit($GetHandle, False)
EndIf
EndSwitch
Case $hWndListView
Switch $iCode
Case $NM_DBLCLK
$aItem = _GUICtrlListView_GetItemTextArray($ListView1, _GUICtrlListView_GetSelectedColumn($ListView1))
GUICtrlSetData($Input1_Yol, _GUICtrlStatusBar_GetText($StatusBar1, 0))
If $aItem[1] = "(Yeni Kayıt Oluştur)" Then
GUICtrlSetData($Button_Kaydet, "Kaydet")
GUICtrlSetData($Input_ad, "")
GUICtrlSetData($Input_Veri, "")
_GUICtrlComboBox_SelectString($Input_Tur, "", -1)
Else
GUICtrlSetData($Button_Kaydet, "Değiştir")
GUICtrlSetData($Input_ad, $aItem[1])
_GUICtrlComboBox_SelectString($Input_Tur, $aItem[2], -1)
GUICtrlSetData($Input_Veri, $aItem[3])
EndIf
If $aItem[2] = "" Then Return
GUISetState(@SW_SHOW, $Form2)
WinSetState($Form1, "", @SW_DISABLE)
Case $NM_CLICK
GUICtrlSetData($Input_code, _Au3Code(_GUICtrlListView_GetItemTextArray($ListView1, _GUICtrlListView_GetSelectedColumn($ListView1))))
EndSwitch
EndSwitch
Return $GUI_RUNDEFMSG
EndFunc ;==>WM_NOTIFY

Func _Au3Code($INF)
$READ_YOL = _GUICtrlStatusBar_GetText($StatusBar1, 0)
If $INF[1] = "(Yeni Kayıt Oluştur)" Then Return ""
If $INF[2] = "" Then Return ""
Switch GUICtrlRead($Combo1)
Case "RegReadCode:"
$Var = StringRegExpReplace($INF[1], "[!'()^+%&)/={[}{[}?.-><*/,]iüğşç;:!", "")
Return '$' & $Var & ' = ' & 'RegRead("' & $READ_YOL & '", "' & $INF[1] & '")'
Case "RegWriteCode:"
Return 'RegWrite("' & $READ_YOL & '", "' & $INF[1] & '", "' & $INF[2] & '", "' & $INF[3] & '")'
Case "RegDeleteCode:"
Return 'RegDelete("' & $READ_YOL & '", "' & $INF[1] & '")'
EndSwitch
EndFunc ;==>_Au3Code

Func _RegEnumVal_ListAdd($GetText_2)

_GUICtrlListView_DeleteAllItems(GUICtrlGetHandle($ListView1))
GUICtrlCreateListViewItem("(Yeni Kayıt Oluştur)" & "|" & "REG_SZ" & "|" & "", $ListView1)
$Deger = RegRead($GetText_2, "")
For $i = 1 To 2000
$Var = RegEnumVal($GetText_2, $i)
If @error <> 0 Then ExitLoop
$Deger = RegRead($GetText_2, $Var)
If $Var = "" Then $Var = ("(Varsayılan)")
$Extended = _Extended(@extended)
$a = GUICtrlCreateListViewItem($Var & "|" & $Extended & "|" & $Deger, $ListView1)
Next

EndFunc ;==>_RegEnumVal_ListAdd

Func _Au3Code_Edit($GetHandle, $Bool)

Local $READ_YOL = _GUICtrlStatusBar_GetText($StatusBar1, 0), $Message_Edit
For $i = 1 To 5000
$Var = RegEnumVal($READ_YOL, $i)
If @error Then ExitLoop
$Deger = RegRead($READ_YOL, $Var)
$Extended = _Extended(@extended)
Switch GUICtrlRead($Combo1)
Case "RegReadCode:"
$Var_ = StringRegExpReplace($Var, "[!'() ^+%&)/=?.-><*/,iüğşç;:!", "")
$Message_Edit &= '$' & $Var_ & ' = ' & 'RegRead("' & $READ_YOL & '", "' & $Var & '")' & @CRLF
Case "RegWriteCode:"
$Message_Edit &= 'RegWrite("' & $READ_YOL & '", "' & $Var & '", "' & $Extended & '", "' & $Deger & '")' & @CRLF
Case "RegDeleteCode:"
$Message_Edit &= 'RegDelete("' & $READ_YOL & '", "' & $Var & '")' & @CRLF
EndSwitch
Next
If $Bool = True Then
GUICtrlSetData($Edit1, $Message_Edit, 1)
Else
If $Message_Edit <> "" Then
$Data_1 = StringReplace(GUICtrlRead($Edit1), $Message_Edit, "")
GUICtrlSetData($Edit1, $Data_1)
EndIf
EndIf


EndFunc ;==>_Au3Code_Edit

Func _Extended($ex)
Switch $ex
Case 0

Return "REG_NONE"
Case 1
Return "REG_SZ"
Case 2
Return "REG_EXPAND_SZ"
Case 3
Return "REG_BINARY"
Case 4
Return "REG_DWORD"
Case 5
Return "REG_DWORD_BIG_ENDIAN"
Case 6
Return "REG_LINK"
Case 7
Return "REG_MULTI_SZ"
Case 8
Return "REG_RESOURCE_LIST"
Case 9
Return "REG_FULL_RESOURCE_DESCRIPTOR"
Case 10
Return "REG_RESOURCE_REQUIREMENTS_LIST"
Case Else
Return "@error"
EndSwitch
EndFunc ;==>_Extended

Func _RegEnumKey_ListAdd($GetText, $GetHandle)

$GuiChlidC = _GUICtrlTreeView_GetChildCount($TreeView1, $GetHandle)
If $GuiChlidC > 0 Then
Return ""
EndIf

For $i = 1 To 10000
$Var = RegEnumKey($GetText, $i)
If @error <> 0 Then ExitLoop
_GUICtrlTreeView_AddChild($TreeView1, $GetHandle, $Var)

Next

EndFunc ;==>_RegEnumKey_ListAdd

Func _YolBelirle()

$Yol = _GUICtrlTreeView_GetTree($TreeView1)
$Yol = StringReplace($Yol, "|", "\")
_GUICtrlStatusBar_SetText($StatusBar1, $Yol, 1)

EndFunc ;==>_YolBelirle
[/codebox]

Edited by asmazh
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...