$TYPECHECK ON
CONST HKEY_CLASSES_ROOT = &H80000000
CONST HKEY_LOCAL_MACHINE = &H80000002
CONST ctab = CHR$(9)
CONST clf = CHR$(10)
DIM Registry AS QREGISTRY
DECLARE SUB Button1Click (Sender AS QBUTTON)
DECLARE SUB Button2Click (Sender AS QBUTTON)
DECLARE SUB Button3Click (Sender AS QBUTTON)
DECLARE SUB Button4Click (Sender AS QBUTTON)
DECLARE SUB Button5Click (Sender AS QBUTTON)
DECLARE SUB Button6Click (Sender AS QBUTTON)
DECLARE SUB Button7Click (Sender AS QBUTTON)
DECLARE SUB listele(adres AS STRING)
CREATE Form AS QFORM
CAPTION = "Qregistry Sample"
Width = screen.width
Height = 267
Center
CREATE Button1 AS QBUTTON
CAPTION = "Windows açýlýþta çalýþan programlar"
Left = 9
Top = 7
Width = 203
OnClick = Button1Click
END CREATE
CREATE Button2 AS QBUTTON
CAPTION = "Bilgisayar adý"
Left = 9
Top = 39
Width = 203
TabOrder = 1
OnClick = Button2Click
END CREATE
CREATE Button3 AS QBUTTON
CAPTION = "Birincil ekran kartý"
Left = 9
Top = 71
Width = 203
TabOrder = 2
OnClick = Button3Click
END CREATE
CREATE Button4 AS QBUTTON
CAPTION = "Birincil modem"
Left = 9
Top = 103
Width = 203
TabOrder = 3
OnClick = Button4Click
END CREATE
CREATE Button5 AS QBUTTON
CAPTION = "Windows bilgileri"
Left = 9
Top = 135
Width = 203
TabOrder = 4
OnClick = Button5Click
END CREATE
CREATE rt1 AS QRICHEDIT
Left = 220
Top = 10
height = 212
width = screen.width - 235
wordwrap=0
scrollbars=3
font.name="courier"
text="Mesut Akcan" + clf + "http://kaynak.cjb.net"
END CREATE
CREATE Button6 AS QBUTTON
CAPTION = "Her tür dosyayý notepad ile aç"
Left = 9
Top = 167
Width = 203
TabOrder = 6
OnClick = Button6Click
END CREATE
CREATE Button7 AS QBUTTON
CAPTION = "Her tür dosyayý notepad ile aç(Ýptal)"
Left = 9
Top = 199
Width = 203
TabOrder = 6
OnClick = Button7Click
END CREATE
END CREATE
Form.SHOWMODAL
SUB Button1Click (Sender AS QBUTTON)
Registry.RootKey = HKEY_LOCAL_MACHINE
rt1.text=""
CALL listele("Run")
CALL listele("RunOnce")
CALL listele("RunOnceEx")
CALL listele("RunServices")
CALL listele("RunServicesOnce")
END SUB
SUB listele(adres AS STRING)
DIM i AS SHORT, txt AS STRING,regitem AS STRING , adres2 AS STRING
adres2="Software\Microsoft\Windows\CurrentVersion\" + adres
WITH Registry
.OpenKey(adres2, 0)
txt=""
FOR i = 0 TO .ValueItemCount - 1
regitem = .ValueItem(I)
txt = txt + regitem + ctab + .readstring(regitem) + clf
NEXT
txt = STRING$(60,"-")+ CHR$(10)+ adres + CHR$(10) + STRING$(60,"-") + CHR$(10)+ txt
rt1.addstring txt
.closekey
END WITH
END SUB
SUB Button2Click (Sender AS QBUTTON)
WITH Registry
.RootKey = HKEY_LOCAL_MACHINE
.OpenKey("System\CurrentControlSet\Control\ComputerName\ComputerName", 0)
rt1.text="Bilgisayar adý:" +CHR$(9) + .readstring("ComputerName")
.closekey
END WITH
END SUB
SUB Button3Click (Sender AS QBUTTON)
DIM adres AS STRING, txt AS STRING
DIM m AS INTEGER
WITH Registry
.RootKey = HKEY_LOCAL_MACHINE
adres = "System\CurrentControlSet\Services\Class\Display\0000"
.OpenKey(adres, 0)
txt = "Sürücü tanýmý : " + ctab + .readstring("DriverDesc") + clf
txt =txt + "Sürücü tarihi : " + ctab + .readstring("DriverDate")+ clf
.closekey
adres = adres + "\INFO"
.OpenKey(adres, 0)
txt =txt + "Chip Tipi : " + ctab + .readstring("ChipType")+ clf
m = .readinteger("VideoMemory")
m = m / &H100000
txt =txt + "Bellek : " + ctab + STR$(m) + " Mb"
rt1.text=txt
.closekey
END WITH
END SUB
SUB Button4Click (Sender AS QBUTTON)
DIM adres AS STRING, txt AS STRING
DIM m AS INTEGER
WITH Registry
.RootKey = HKEY_LOCAL_MACHINE
adres = "System\CurrentControlSet\Services\Class\Modem\0000"
.OpenKey(adres, 0)
txt = "Sürücü tanýmý : " + ctab + .readstring("DriverDesc") + clf
txt =txt + "Sürücü tarihi : " + ctab + .readstring("DriverDate")+ clf
.closekey
rt1.text=txt
END WITH
END SUB
SUB Button5Click (Sender AS QBUTTON)
DIM txt AS STRING
WITH Registry
.RootKey = HKEY_LOCAL_MACHINE
.OpenKey("Software\Microsoft\Windows\CurrentVersion", 0)
txt = "Versiyon : " + ctab + .readstring("Version")+ clf _
+ "Versiyon no: " + ctab + .readstring("VersionNumber")+ clf _
+ "Ürününün adý: " + ctab + .readstring("ProductName")+ clf _
+ "Ürününün anahtarý: " + ctab + .readstring("ProductKey")+ clf _
+ "Ürününün kodu: " + ctab + .readstring("ProductId")+ clf _
+ "Kayýtlý kiþi adý: " + ctab + .readstring("RegisteredOwner")+ clf _
+ "Þirketi: " + ctab + .readstring("RegisteredOrganization")
rt1.text=txt
.closekey
END WITH
END SUB
SUB Button6Click (Sender AS QBUTTON)
WITH Registry
.RootKey = HKEY_CLASSES_ROOT
.OpenKey("*\shell\notepad\command",1)
.WriteString("", "Notepad.exe %1")
.closekey
.OpenKey("*\shell\notepad",1)
.WriteString("", "&Not Defteriyle Aç")
.closekey
END WITH
SHOWMESSAGE "Ýþlem Tamam" + cLf _
+ "Artýk her tür dosyayý sað týkladýðýnýzda Not defteriyle açabilirsiniz"
END SUB
SUB Button7Click (Sender AS QBUTTON)
WITH Registry
.RootKey = HKEY_CLASSES_ROOT
.OpenKey("*\shell\notepad\command",1)
.DeleteKey("")
.closekey
.OpenKey("*\shell\notepad",1)
.DeleteKey("")
.closekey
END WITH
SHOWMESSAGE "Ýþlem Tamam" + cLf _
+ "Her tür dosyay Not defteriyle açma özelliði silindi"
END SUB
|