Torna indietro   Hardware Upgrade Forum > Software > Programmazione

Logitech G325, G305 e G316 X: il tris per chi non vuole rinunciare a nulla, spendendo poco
Logitech G325, G305 e G316 X: il tris per chi non vuole rinunciare a nulla, spendendo poco
Nelle ultime settimane abbiamo provato il mouse Logitech G305, la tastiera G316 X 98 e le cuffie G325. Si tratta del setup entry-level di Logitech che ormai, di "entry-level" ha ben poco. Tastiera e mouse offrono prestazioni di livello competitivo con quasi nessuna rinuncia e un livello di personalizzazione estremamente elevato. Le cuffie, invece, hanno mostrato qualche debolezza, ma propongono un ventaglio di funzionalità completo che consente di abbandonare completamente i cavi
Recensione POCO F9 pro: potenza da vero top di gamma, display da 185 Hz e finalmente una fotocamera da prendere sul serio
Recensione POCO F9 pro: potenza da vero top di gamma, display da 185 Hz e finalmente una fotocamera da prendere sul serio
POCO F9 Pro arriva sul mercato con l'obiettivo di portare prestazioni da smartphone top di gamma in una fascia di prezzo "più aggressiva", senza rinunciare a un comparto fotografico finalmente all'altezza. Dopo averlo testato sul campo, emerge uno smartphone molto più completo rispetto alla generazione precedente, ma anche con alcuni piccoli compromessi che diventano difficili da ignorare quando il prezzo di listino sfiora i 1.000 euro.
Tra audio e AI: la ricetta di Qualcomm per l'agentic AI
Tra audio e AI: la ricetta di Qualcomm per l'agentic AI
Snapdragon Soung Gen 2 è la piattaforma Qualcomm per i dispositivi audio sempre più integrati nel mondo dell'intelligenza artificiale: al prorpio interno tanta potenza elaborativa per gestire al meglio le necessità d'uso dell'agentic AI
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


Logitech G325, G305 e G316 X: il tris per chi non vuole rinunciare a nulla, spendendo poco Logitech G325, G305 e G316 X: il tris per chi no...
Recensione POCO F9 pro: potenza da vero top di gamma, display da 185 Hz e finalmente una fotocamera da prendere sul serio Recensione POCO F9 pro: potenza da vero top di g...
Tra audio e AI: la ricetta di Qualcomm per l'agentic AI Tra audio e AI: la ricetta di Qualcomm per l'age...
Qualcomm annuncia la nuova generazione di SoC Snapdragon 8 Elite Gen 6 Qualcomm annuncia la nuova generazione di SoC Sn...
realme 16 Pro Harry Potter Edition: il nuovo midrange ha uno stemma di Hogwarts che cambia colore al sole! realme 16 Pro Harry Potter Edition: il nuovo mid...
BYD Seagull (Dolphin Surf), l'elettrica ...
Multa milionaria per un data center del ...
F-Droid 2.0 si aggiorna con una nuova gr...
Microsoft ridisegna Copilot: dalla chat ...
Volkswagen porterà 20 videogiochi...
Troppa IA storpia: OpenAI licenzia in tr...
Marathon, Bungie svela i contenuti dell'...
Autunno, tempo di potature: i tagliasiep...
Meta Muse, due sviluppatori riescono a o...
Google AI Pro gratis: festa a sorpresa p...
MacSync colpisce macOS usando i calendar...
L'agente IA cancella 48 mila file in 103...
Jensen Huang avverte: l'AI può aiutare a...
Elettrico Renault in arrivo in Spagna: 6...
Linux, un file AGENTS.md per insegnare a...
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: 17:02.


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