Torna indietro   Hardware Upgrade Forum > Software > Programmazione

Tascabile e con Android: BOOX Go 6 Gen II è diverso da tutti gli altri e-reader
Tascabile e con Android: BOOX Go 6 Gen II è diverso da tutti gli altri e-reader
BOOX Go 6 Gen II porta per la prima volta il supporto allo stilo su un e-reader da 6 pollici, affiancando 3 GB di RAM al collaudato Snapdragon 665 e un design rivisto con scocca posteriore a costolature. Su carta la proposta è interessante, ma Android 11 fuori supporto, l'assenza di un alloggiamento per il pennino e un'autonomia ridotta rispetto agli e-reader tradizionali sono i compromessi da accettare
Recensione Lenovo Idea Tab Plus: il tablet da 12 pollici che costa meno di 300 euro
Recensione Lenovo Idea Tab Plus: il tablet da 12 pollici che costa meno di 300 euro
Lenovo Idea Tab Plus prova a portare un display da 12,1 pollici 2.5K, quattro speaker Dolby Atmos e una batteria da 10.200 mAh sotto la soglia psicologica dei 300 euro, penna inclusa. Lo abbiamo usato per oltre una settimana per capire dove l'azienda ha tagliato e dove invece ha tenuto il punto
Oltre il contante e le crypto: tutto sull'Euro Digitale e la nuova sovranità monetaria europea
Oltre il contante e le crypto: tutto sull'Euro Digitale e la nuova sovranità monetaria europea
L'euro digitale è una valuta fiat che entrerà in vigore nei prossimi anni. L'obiettivo principale è quello di ridurre la dipendenza dalle piattaforme di pagamento digitali statunitensi e offrire ai cittadini un modo semplice per trasferire denaro. Anche offline, anche in maniera (pseudo)anonima
Tutti gli articoli Tutte le news

Vai al Forum
Rispondi
 
Strumenti
Old 24-02-2004, 14:23   #1
akkiappamukke
Member
 
Iscritto dal: Oct 2003
Città: Saronno(Va)
Messaggi: 118
Problema con il Registry

non riesco a inserire i valori nelle chiavi con questo codice ke secondo me e' giusto!!!


Public Function ScriviValore(ByVal ChiavePrincipale As ChiaviPrincipali, ByVal NomeValore As String, ByVal TipoDato As TipoValoriRegistro, ByVal ContenutoDato As Variant)
'inserisce i valori nella chiave indicata
Dim Buffer As String
Dim Lunghezza As Long
Buffer = ContenutoDato
Lunghezza = Len(Buffer)
If ChiavePrincipale = Chiave_aperta Then ChiavePrincipale = Nuovo_indice
Buffer = NomeValore
Call RegSetValueEx(ChiavePrincipale, NomeValore, 0, TipoDato, ContenutoDato, Len(CONTENUTO))

End Function

qualcuno mi potrebbe dare una mano sono disperato!!!
akkiappamukke è offline   Rispondi citando il messaggio o parte di esso
Old 24-02-2004, 14:59   #2
matpez
Senior Member
 
L'Avatar di matpez
 
Iscritto dal: Aug 2002
Città: Biella
Messaggi: 1882
Prova a vedere questo esempio:

Codice:
'This program needs 3 buttons
Const REG_SZ = 1 ' Unicode nul terminated string
Const REG_BINARY = 3 ' Free form binary
Const HKEY_CURRENT_USER = &H80000001
Private Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As Long
Private Declare Function RegCreateKey Lib "advapi32.dll" Alias "RegCreateKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
Private Declare Function RegDeleteValue Lib "advapi32.dll" Alias "RegDeleteValueA" (ByVal hKey As Long, ByVal lpValueName As String) As Long
Private Declare Function RegOpenKey Lib "advapi32.dll" Alias "RegOpenKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
Private Declare Function RegQueryValueEx Lib "advapi32.dll" Alias "RegQueryValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal lpReserved As Long, lpType As Long, lpData As Any, lpcbData As Long) As Long
Private Declare Function RegSetValueEx Lib "advapi32.dll" Alias "RegSetValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal Reserved As Long, ByVal dwType As Long, lpData As Any, ByVal cbData As Long) As Long
Function RegQueryStringValue(ByVal hKey As Long, ByVal strValueName As String) As String
    Dim lResult As Long, lValueType As Long, strBuf As String, lDataBufSize As Long
    'retrieve nformation about the key
    lResult = RegQueryValueEx(hKey, strValueName, 0, lValueType, ByVal 0, lDataBufSize)
    If lResult = 0 Then
        If lValueType = REG_SZ Then
            'Create a buffer
            strBuf = String(lDataBufSize, Chr$(0))
            'retrieve the key's content
            lResult = RegQueryValueEx(hKey, strValueName, 0, 0, ByVal strBuf, lDataBufSize)
            If lResult = 0 Then
                'Remove the unnecessary chr$(0)'s
                RegQueryStringValue = Left$(strBuf, InStr(1, strBuf, Chr$(0)) - 1)
            End If
        ElseIf lValueType = REG_BINARY Then
            Dim strData As Integer
            'retrieve the key's value
            lResult = RegQueryValueEx(hKey, strValueName, 0, 0, strData, lDataBufSize)
            If lResult = 0 Then
                RegQueryStringValue = strData
            End If
        End If
    End If
End Function
Function GetString(hKey As Long, strPath As String, strValue As String)
    Dim Ret
    'Open the key
    RegOpenKey hKey, strPath, Ret
    'Get the key's content
    GetString = RegQueryStringValue(Ret, strValue)
    'Close the key
    RegCloseKey Ret
End Function
Sub SaveString(hKey As Long, strPath As String, strValue As String, strData As String)
    Dim Ret
    'Create a new key
    RegCreateKey hKey, strPath, Ret
    'Save a string to the key
    RegSetValueEx Ret, strValue, 0, REG_SZ, ByVal strData, Len(strData)
    'close the key
    RegCloseKey Ret
End Sub
Sub SaveStringLong(hKey As Long, strPath As String, strValue As String, strData As String)
    Dim Ret
    'Create a new key
    RegCreateKey hKey, strPath, Ret
    'Set the key's value
    RegSetValueEx Ret, strValue, 0, REG_BINARY, CByte(strData), 4
    'close the key
    RegCloseKey Ret
End Sub
Sub DelSetting(hKey As Long, strPath As String, strValue As String)
    Dim Ret
    'Create a new key
    RegCreateKey hKey, strPath, Ret
    'Delete the key's value
    RegDeleteValue Ret, strValue
    'close the key
    RegCloseKey Ret
End Sub
Private Sub Command1_Click()
    Dim strString As String
    'Ask for a value
    strString = InputBox("Please enter a value between 0 and 255 to be saved as a binary value in the registry.", App.Title)
    If strString = "" Or Val(strString) > 255 Or Val(strString) < 0 Then
        MsgBox "Invalid value entered ...", vbExclamation + vbOKOnly, App.Title
        Exit Sub
    End If
    'Save the value to the registry
    SaveStringLong HKEY_CURRENT_USER, "KPD-Team", "BinaryValue", CByte(strString)
End Sub
Private Sub Command2_Click()
    'Get a string from the registry
    Ret = GetString(HKEY_CURRENT_USER, "KPD-Team", "BinaryValue")
    If Ret = "" Then MsgBox "No value found !", vbExclamation + vbOKOnly, App.Title: Exit Sub
    MsgBox "The value is " + Ret, vbOKOnly + vbInformation, App.Title
End Sub
Private Sub Command3_Click()
    'Delete the setting from the registry
    DelSetting HKEY_CURRENT_USER, "KPD-Team", "BinaryValue"
    MsgBox "The value was deleted ...", vbInformation + vbOKOnly, App.Title
End Sub
Private Sub Form_Load()
    'KPD-Team 1998
    'URL: http://www.allapi.net/
    'E-Mail: [email protected]
    Command1.Caption = "Set Value"
    Command2.Caption = "Get Value"
    Command3.Caption = "Delete Value"
End Sub
__________________
"Analizzando e valutando ogni giorno tutte le idee, ho capito che spesso tutti sono convinti che una cosa sia impossibile, finchè arriva uno sprovveduto che non lo sa e la realizza!"
A. Einstein
matpez è offline   Rispondi citando il messaggio o parte di esso
Old 24-02-2004, 15:25   #3
akkiappamukke
Member
 
Iscritto dal: Oct 2003
Città: Saronno(Va)
Messaggi: 118
Bho!!!

a me sembra uguale al mio soltanto con l'unica differenza ke il tuo funziona!!!

facendo il punto della situazione per vedere se ho capito

gli serve in rdine:

-l'Handle della chiave a cui andare a puntare
-il nome del valore
-0
-il tipo di dato
-il contenuto di tale valore
-le dimensioni

dimmi se ho ragione o no!!!!!
akkiappamukke è offline   Rispondi citando il messaggio o parte di esso
Old 24-02-2004, 15:45   #4
matpez
Senior Member
 
L'Avatar di matpez
 
Iscritto dal: Aug 2002
Città: Biella
Messaggi: 1882
Si in pratica devi aprire la chiave per potere scrivere dentro
__________________
"Analizzando e valutando ogni giorno tutte le idee, ho capito che spesso tutti sono convinti che una cosa sia impossibile, finchè arriva uno sprovveduto che non lo sa e la realizza!"
A. Einstein
matpez è offline   Rispondi citando il messaggio o parte di esso
Old 24-02-2004, 15:54   #5
akkiappamukke
Member
 
Iscritto dal: Oct 2003
Città: Saronno(Va)
Messaggi: 118
e perke porka m****

******* ****** ********* c**** f**** p***** non funziona!!!
akkiappamukke è offline   Rispondi citando il messaggio o parte di esso
 Rispondi


Tascabile e con Android: BOOX Go 6 Gen II è diverso da tutti gli altri e-reader Tascabile e con Android: BOOX Go 6 Gen II &egrav...
Recensione Lenovo Idea Tab Plus: il tablet da 12 pollici che costa meno di 300 euro Recensione Lenovo Idea Tab Plus: il tablet da 12...
Oltre il contante e le crypto: tutto sull'Euro Digitale e la nuova sovranità monetaria europea Oltre il contante e le crypto: tutto sull'Euro D...
Recensione HONOR Magic V6: spessore record e super batteria. È lui il fold da battere? Recensione HONOR Magic V6: spessore record e sup...
Redmi Pad 2 9.7: ampio display, economico e peso contenuto, ma qualche limite nelle prestazioni Redmi Pad 2 9.7: ampio display, economico e peso...
Comprare vecchi libri per distruggerli: ...
Perde la testa e continua a tirare pugni...
Nessuna ulteriore proroga ESU per Exchan...
Samsung integra l'IA on device con Gemin...
L'IA ammazza le vendite dei mainframe, m...
Ritorno al vintage con Kodak EC35: la nu...
StoryKit, l'app di Meta che genera fiabe...
Allarme SharePoint: una falla critica es...
HMD potrebbe riportare in vita i Lumia c...
Preordine Samsung Galaxy Watch 9, tutti ...
Framework, il nuovo desktop è pot...
STMicroelectronics vola sull'intelligenz...
Recensione Assassin's Creed Black Flag R...
Amazon Haul lancia la promo sui bestsell...
"Claudefishing": Substack d&ag...
Chromium
GPU-Z
OCCT
LibreOffice Portable
Opera One Portable
Opera One 106
CCleaner Portable
CCleaner Standard
Cpu-Z
Driver NVIDIA GeForce 546.65 WHQL
SmartFTP
Trillian
Google Chrome Portable
Google Chrome 120
VirtualBox
Tutti gli articoli Tutte le news Tutti i download

Strumenti

Regole
Non Puoi aprire nuove discussioni
Non Puoi rispondere ai messaggi
Non Puoi allegare file
Non Puoi modificare i tuoi messaggi

Il codice vB è On
Le Faccine sono On
Il codice [IMG] è On
Il codice HTML è Off
Vai al Forum


Tutti gli orari sono GMT +1. Ora sono le: 12:26.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Served by www3v