Guidance
指路人
g.yi.org
software / rapidq / Examples / Registry & INI / sqregistry.bas

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
' Qregistry için örnek program
' Kullanýmdan doðan zararlar için sorumlu kullanan kiþidir
' Garantisi yoktur

' QREGISTRY Component sample program
' Warning: No Warranty.
' sorry my bad english

' © 2001 Mesut Akcan
' 1 April 2001
' makcan@softhome.net
' http://kaynak.cjb.net
' http://makcan.virtualave.net

     $TYPECHECK ON

     CONST HKEY_CLASSES_ROOT  = &H80000000
     CONST HKEY_LOCAL_MACHINE = &H80000002

     CONST ctab = CHR$(9) ' Tab character
     CONST clf = CHR$(10) ' Line Feed Chr
     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"
        'Running on Win Startup
       Left = 9
       Top = 7
       Width = 203
       OnClick = Button1Click
      END CREATE
      CREATE Button2 AS QBUTTON
       CAPTION = "Bilgisayar adý" 'Computer Name
       Left = 9
       Top = 39
       Width = 203
       TabOrder = 1
       OnClick = Button2Click
      END CREATE
      CREATE Button3 AS QBUTTON
       CAPTION = "Birincil ekran kartý" 'First Video Adapter
       Left = 9
       Top = 71
       Width = 203
       TabOrder = 2
       OnClick = Button3Click
      END CREATE
      CREATE Button4 AS QBUTTON
       CAPTION = "Birincil modem" 'First Modem
       Left = 9
       Top = 103
       Width = 203
       TabOrder = 3
       OnClick = Button4Click
      END CREATE
      CREATE Button5 AS QBUTTON
       CAPTION = "Windows bilgileri" 'Windows Info
       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ç"
        ' View all file with Notepad
       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)"
        ' View all file with Notepad (Cancel)
       Left = 9
       Top = 199
       Width = 203
       TabOrder = 6
       OnClick = Button7Click
      END CREATE
     END CREATE

     Form.SHOWMODAL
'-------------------------------------------
     SUB Button1Click (Sender AS QBUTTON)
'win açýlýþta çalýþan
' Running programs, Win on Startup
      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)
'bilgisayar adý
'computer name (on network)
      WITH Registry
       .RootKey = HKEY_LOCAL_MACHINE
       .OpenKey("System\CurrentControlSet\Control\ComputerName\ComputerName", 0)
       rt1.text="Bilgisayar adý:" +CHR$(9) + .readstring("ComputerName")
            ' ^ Computer name
       .closekey
      END WITH
     END SUB

'-------------------------------------------
     SUB Button3Click (Sender AS QBUTTON)
' ekran kartý
' Video Graphics Adapter
      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)
        'Driver description
       txt = "Sürücü tanýmý : " + ctab + .readstring("DriverDesc") + clf
        'Driver date
       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
        ' Memory Size (Mb)
       txt =txt + "Bellek : " + ctab + STR$(m) + " Mb"
       rt1.text=txt
       .closekey
      END WITH
     END SUB

'-------------------------------------------
     SUB Button4Click (Sender AS QBUTTON)
' birincil modem
' Modem
      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)
        'Driver desc.
       txt = "Sürücü tanýmý : " + ctab + .readstring("DriverDesc") + clf
        'driver date
       txt =txt + "Sürücü tarihi : " + ctab + .readstring("DriverDate")+ clf
       .closekey
       rt1.text=txt
      END WITH
     END SUB

'-------------------------------------------
     SUB Button5Click (Sender AS QBUTTON)
'windows bilgileri
'Win info
      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 _
        'Product Name
        + "Ürününün adý: " + ctab + .readstring("ProductName")+ clf _
        'Product Key
        + "Ürününün anahtarý: " + ctab + .readstring("ProductKey")+ clf _
        'Product Id.
        + "Ürününün kodu: " + ctab + .readstring("ProductId")+ clf _
        'Registered Owner
        + "Kayýtlý kiþi adý: " + ctab + .readstring("RegisteredOwner")+ clf _
        'Registered Organization
        + "Þirketi: " + ctab + .readstring("RegisteredOrganization")
       rt1.text=txt
       .closekey
      END WITH
     END SUB

'-------------------------------------------
     SUB Button6Click (Sender AS QBUTTON)
' tüm dosyalarý notepad ile aç
' Open all files with Notepad
      WITH Registry
       .RootKey = HKEY_CLASSES_ROOT
       .OpenKey("*\shell\notepad\command",1)
       .WriteString("", "Notepad.exe %1")
       .closekey
       .OpenKey("*\shell\notepad",1)
       .WriteString("", "&Not Defteriyle Aç")'Open with Notepad
       .closekey
      END WITH
      SHOWMESSAGE "Ýþlem Tamam" + cLf _
       + "Artýk her tür dosyayý sað týkladýðýnýzda Not defteriyle açabilirsiniz"
 'OK. Now. if you are right click on filename (in explorer file list), shown "Open with Notepad"
     END SUB

'-------------------------------------------
     SUB Button7Click (Sender AS QBUTTON)
' tüm dosyalarý notepad ile aç(iptal)
' Open all files with Notepad (Cancel)
      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"
 'OK. Open all files with Notepad (Cancelled)
     END SUB

掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Tue 2024-5-21  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0 Last modified:2001-04-01 17:06:36