Jump to content

Program Ekle/kaldır


daft117
 Share

Recommended Posts

Ek olarak bu listede görmek istemediğiniz girişleri silebiliyorsunuz

Kayıt defteri, array işlemlerine güzel bir örnek
[img]http://img839.imageshack.us/img839/1271/123ne.jpg[/img]
dosya linki: http://www.multiupload.com/BTKCN7W6IB

kod:
[code]#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <WindowsConstants.au3>
Global $i = 0, $name = "", $command = "", $aName[1], $aCommand[1], $aKey[1]

$Form1 = GUICreate("verpacino Uninstaller", 625, 445, -1, -1)
$List1 = GUICtrlCreateList("", 8, 8, 609, 370)
$Button1 = GUICtrlCreateButton("Kaldır", 24, 392, 75, 25, $WS_GROUP)
$Button2 = GUICtrlCreateButton("Girişi Sil", 120, 392, 75, 25, $WS_GROUP)
$Button3 = GUICtrlCreateButton("Yenile", 216, 392, 75, 25, $WS_GROUP)
Yenile()
GUISetState(@SW_SHOW)

While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
Kaldir()
Case $Button2
GirisiSil()
Case $Button3
Yenile()
EndSwitch
WEnd

Func Yenile()
$aKey = 0
$aName = 0
$aCommand = 0
Global $i = 0, $name = "", $command = "", $aName[1], $aCommand[1], $aKey[1]
$aName[0] = 0
$aCommand[0] = 0
$aKey[0] = 0

While 1 ; İSİM VE KOMUTLARI AL
;~ ANAHTARLARI AL
$i = $i + 1
$a = RegEnumKey("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall", $i)
If $a = "" And @error <> -1 Then ContinueLoop
If @error = -1 Then ExitLoop

;~ İSİMLERİ OKU VE STRING'E EKLE (LIST İÇİN)
$read = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" & $a
$RegRead1 = RegRead($read, "DisplayName")
If $RegRead1 = "" And @error Then ContinueLoop
If $name = "" Then
$name = $RegRead1
Else
$name = $name & "|" & $RegRead1
EndIf

;~ KALDIRMA KOMUTUNU OKU VE STRING'E EKLE (LIST İÇİN)
$RegRead2 = RegRead($read, "UninstallString")
If $command = "" Then
$command = $RegRead2
Else
$command = $command & "|" & $RegRead2
EndIf

;~ ARRAY'A İSİMLERİ, KOMUTLARI, ANAHTARLARI YERLEŞTİR
$a = UBound($aName) + 1
ReDim $aName[$a]
ReDim $aCommand[$a]
ReDim $aKey[$a]
$a = $a - 1
$aName[$a] = $RegRead1
$aCommand[$a] = $RegRead2
$aKey[$a] = $read
WEnd
GUICtrlSetData($List1, "")
GUICtrlSetData($List1, $name)
EndFunc ;==>Yenile

Func Kaldir()
Local $a, $b, $i
$a = GUICtrlRead($List1)
If $a <> "" Then
$b = UBound($aName) - 1
For $i = 1 To $b Step +1
If $aName[$i] = $a Then
$b = $aCommand[$i]
ExitLoop
EndIf
Next
If Run($B) = 0 Then MsgBox(0, "Hata", "Kaldırma fonksiyonu çalıştırılamadı")
EndIf
Yenile()
EndFunc ;==>Kaldir

Func GirisiSil()
Local $a, $b, $i
$a = GUICtrlRead($List1)
If $a <> "" Then
$b = UBound($aName) - 1
For $i = 1 To $b Step +1
If $aName[$i] = $a Then
$b = $aKey[$i]
ExitLoop
EndIf
Next
If MsgBox(4, "Soru", "Giriş: " & $aName[$i] & @CRLF & @CRLF & "Gerçekten silmek istiyormusun?") = 6 Then RegDelete($B)
EndIf
Yenile()
EndFunc ;==>GirisiSil[/code]

Link to comment
Share on other sites

  • 4 hafta sonra ...

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...