Torna indietro   Hardware Upgrade Forum > Software > Programmazione

Recensione Google Pixel 10a, si migliora poco ma è sempre un'ottima scelta
Recensione Google Pixel 10a, si migliora poco ma è sempre un'ottima scelta
Google ha appena rinnovato la sua celebre serie A con il Pixel 10a, lo smartphone della serie più conveniente se consideriamo il rapporto tra costo e prestazioni. Con il chip Tensor G4, un design raffinato soprattutto sul retro e l'integrazione profonda di Gemini, il colosso di Mountain View promette un'esperienza premium a un prezzo accessibile. E il retro non ha nessuno scalino
6G, da rete che trasporta dati a rete intelligente: Qualcomm accelera al MWC 2026
6G, da rete che trasporta dati a rete intelligente: Qualcomm accelera al MWC 2026
Al MWC Qualcomm annuncia una coalizione industriale per lanciare il 6G entro il 2029 e introduce agenti IA per la gestione autonoma della RAN. Ericsson, presente sul palco, conferma la direzione: le reti del futuro saranno IA-native fin dalla progettazione
CHUWI CoreBook Air alla prova: design premium, buona autonomia e qualche compromesso
CHUWI CoreBook Air alla prova: design premium, buona autonomia e qualche compromesso
CHUWI CoreBook Air è un ultraleggero da 1 kg con Ryzen 5 6600H, display 14" 16:10 e 16 GB LPDDR5. Offre buona portabilità, autonomia discreta e costruzione in alluminio, ma storage PCIe 3.0 e RAM saldata limitano l'espandibilità. A 549 euro sfida brand più noti nella stessa fascia di mercato.
Tutti gli articoli Tutte le news

Vai al Forum
Rispondi
 
Strumenti
Old 24-02-2004, 15: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, 15: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, 16: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, 16: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, 16: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


Recensione Google Pixel 10a, si migliora poco ma è sempre un'ottima scelta Recensione Google Pixel 10a, si migliora poco ma...
6G, da rete che trasporta dati a rete intelligente: Qualcomm accelera al MWC 2026 6G, da rete che trasporta dati a rete intelligen...
CHUWI CoreBook Air alla prova: design premium, buona autonomia e qualche compromesso CHUWI CoreBook Air alla prova: design premium, b...
Roborock Saros 20: il robot preciso e molto sottile Roborock Saros 20: il robot preciso e molto sott...
ASUS ROG Kithara: quando HIFIMAN incontra il gaming con driver planari da 100mm ASUS ROG Kithara: quando HIFIMAN incontra il gam...
"Non stiamo sostituendo nessuno con...
Tutti i robot in offerta ora: prezzi bas...
Fra 3 giorni, a mezzanotte, Amazon attiv...
Il principale limite del MacBook Neo &eg...
899€ in tutti i colori, crolla il prezzo...
Sempre più pubblicità su Y...
Costo della memoria alle stelle? Non ave...
GPT-5.4 cambia il modo di usare ChatGPT:...
Centinaia di petabyte in una molecola: l...
Lenovo al MWC 2026: dal PC modulare all'...
Huawei presenta gli agenti di IA per le ...
Alla scoperta di GAIA, la piattaforma IA...
Crimson Desert alla ricerca dell'equilib...
Ray-Ban Meta, video privati visionati da...
Epic Games fa causa a un ex collaborator...
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: 10:13.


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