Torna indietro   Hardware Upgrade Forum > Software > Programmazione

Nuova Dacia Spring, del modello precedente resta solo il nome: più grande, più efficiente e ora prodotta in Europa
Nuova Dacia Spring, del modello precedente resta solo il nome: più grande, più efficiente e ora prodotta in Europa
La seconda generazione della citycar elettrica di Dacia passa alla piattaforma RGEV small di Renault Group, cresce di 15 cm in lunghezza e 18 cm in larghezza, adotta un motore da 80 CV e una batteria LFP da 27,5 kWh per 250 km WLTP. Prezzi da 17.900 euro, produzione a Novo Mesto in Slovenia.
BOOX Picco: l'ebook reader minuscolo è una genialata, e si può attaccare allo smartphone
BOOX Picco: l'ebook reader minuscolo è una genialata, e si può attaccare allo smartphone
BOOX ha portato sul mercato Picco, un e-reader da 3,97 pollici che pesa 58 grammi e si aggancia al retro dello smartphone con un anello magnetico. Lo abbiamo usato con Pixel 11 Pro XL e iPhone 18 Pro per capire se un formato così ridotto regga la prova della lettura quotidiana
AMD EPYC Venice: dentro Zen 6, i SoC a 256 core e la sfida al costo della memoria
AMD EPYC Venice: dentro Zen 6, i SoC a 256 core e la sfida al costo della memoria
A Las Vegas AMD ha svelato i dettagli architetturali delle CPU EPYC di sesta generazione, note con il nome in codice Venice. Nuovi core Zen 6 e Zen 6c costruiti a 2 nanometri, fino a 256 core per socket, 16 canali di memoria, interfaccia PCI Express 6.0 e un'intera famiglia di proposte che va da Venice SP7 a Verano. Senza dimenticare la memoria, oggi la voce di costo più pesante in un server: AMD risponde con CXL 3.1 e con la tecnologia software MEXT, che porta la memoria flash dentro la gerarchia della DRAM.
Tutti gli articoli Tutte le news

Vai al Forum
Rispondi
 
Strumenti
Old 01-01-2005, 04:03   #1
ax89
Senior Member
 
L'Avatar di ax89
 
Iscritto dal: Sep 2004
Messaggi: 2067
Domande di un neofita di Visual Basic 6.0

Salve a tutti.
Allora, dovrei fare queste due cose e mi servirebbe una mano di uno + bravo di me:

1) assegnare ad un CommandButton un link per compilare una e-mail con il campo "Oggetto:" già indicato dallo stesso programma VB. Se sono stato poco chiaro intendo una specie di a href="mailto:[email protected]" in html + una voce che riempie subito il campo "oggetto".

2)Leggere ed estrarre info dal registro di win.

Grazie a tutti per gli aiuti.
ax89 è offline   Rispondi citando il messaggio o parte di esso
Old 02-01-2005, 23:56   #2
matpez
Senior Member
 
L'Avatar di matpez
 
Iscritto dal: Aug 2002
Città: Biella
Messaggi: 1882
Mail:

Codice:
Private Const SW_SHOWNORMAL = 1

Private Declare Function ShellExecute Lib "Shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long


Call ShellExecute(0&, vbNullString, "mailto:" & sEmail & "?Subject=" & sSubject, vbNullString, "", SW_SHOWNORMAL)




Registro:
Codice:
'This program needs 3 buttons

Const REG_SZ = 1 ' Unicode nul terminated string
Const REG_BINARY = 3 ' Free form binary

'Tipi di primo livello per le chiavi del registro di configurazione
Public Enum RegKeyRootConstants
  HKEY_CLASSES_ROOT = &H80000000
  HKEY_CURRENT_USER = &H80000001
  HKEY_LOCAL_MACHINE = &H80000002
  HKEY_USERS = &H80000003
End Enum

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()
    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
 Rispondi


Nuova Dacia Spring, del modello precedente resta solo il nome: più grande, più efficiente e ora prodotta in Europa Nuova Dacia Spring, del modello precedente resta...
BOOX Picco: l'ebook reader minuscolo è una genialata, e si può attaccare allo smartphone BOOX Picco: l'ebook reader minuscolo è un...
AMD EPYC Venice: dentro Zen 6, i SoC a 256 core e la sfida al costo della memoria AMD EPYC Venice: dentro Zen 6, i SoC a 256 core ...
HONOR Pad X9 Max recensione, schermo ultra large a meno di 400 euro HONOR Pad X9 Max recensione, schermo ultra large...
Lenovo ThinkPad X1 Carbon Gen 14: il business ultraleggero si rinnova dall’interno Lenovo ThinkPad X1 Carbon Gen 14: il business ul...
Jensen Huang avrebbe nascosto ai vertici...
Le prime cuffie over-ear di Vivo arrivan...
GPU, CPU e fotoni: il piano di AMD per p...
La soluzione di Google per i nuovi occhi...
Il futuro di XBOX passa per l'intelligen...
Amazon, le 13 offerte da non perdere ogg...
Svendita TV su MediaWorld: OLED LG e Sam...
AMD si ricorda dei gamer, ma il messaggi...
Fate in fretta: su Mediaworld c'è...
Ho usato ArtCraft per trasformare un mio...
SSD e hard disk su AliExpress: 4TB a sol...
Due Mac agli antipodi in forte sconto su...
Quick Spectral Super Resolution (QSSR): ...
AMD Ryzen, prezzi interessanti su AliExp...
Zenbook S è un MacBook Air che co...
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: 19:53.


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