CONVERTER CODIGO .REG PARA VB6

PAYDANA 03/02/2015 22:03:25
#444271
Pessoal pesquisei bastante e não consegui colocar este código para ser executado direto do meu projeto
No caso é um arquivo .reg que faz com que o Internet Explorer abra arquivos JSON ao em vês de baixa-lo

Testem em seu próprio navegador se quiser ver na pratica [Ô]http://servicos.albertino.eti.br/Loteria.asmx/GetLotoFacil_PorConcurso_JSON?numero=1[Ô]
Se alguém puder me ajudar agradeço muito.

Eis ó código.
Windows Registry Editor Version 5.00;
; Tell IE 7,8,9,10,11 to open JSON documents in the browser on Windows XP and later.
; 25336920-03F9-11cf-8FD0-00AA00686F13 is the CLSID for the [Ô]Browse in place[Ô] .
;
[HKEY_CLASSES_ROOT\MIME\Database\Content Type\application/json]
[Ô]CLSID[Ô]=[Ô]{25336920-03F9-11cf-8FD0-00AA00686F13}[Ô]
[Ô]Encoding[Ô]=hex:08,00,00,00
PAYDANA 04/02/2015 17:40:04
#444303
Nenhuma dica?
PAYDANA 05/02/2015 14:48:38
#444324
Consegui!!!!

  Option Explicit

Private Declare Function RegCreateKeyA Lib [Ô]advapi32.dll[Ô] (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
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 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

Private Const HKEY_CLASSES_ROOT = &H80000000
Private Const REG_SZ = 1
Private Const REG_BINARY = 3

Private Sub Command1_Click()
Dim V As String

Call SaveString(HKEY_CLASSES_ROOT, [Ô]Mime\Database\Content Type\application/json\[Ô] & V, [Ô]CLSID[Ô], [Ô]{25336920-03F9-11cf-8FD0-00AA00686F13}[Ô])
Call SaveString1(HKEY_CLASSES_ROOT, [Ô]Mime\Database\Content Type\application/json\[Ô] & V, [Ô]Encoding[Ô], [Ô]08 00 00 00[Ô])

End Sub

Private Sub SaveString(hKey As Long, strPath As String, strValue As String, strData As String)
Dim keyhand As Long
Dim X As Long

X = RegCreateKey(hKey, strPath, keyhand)
X = RegSetValueEx(keyhand, strValue, 0, REG_SZ, ByVal strData, Len(strData))
X = RegCloseKey(keyhand)
End Sub

Private Sub SaveString1(hKey As Long, strPath As String, strValue As String, strData As String)
Dim keyhand As Long
Dim Y As Long

Y = RegCreateKey(hKey, strPath, keyhand)
Y = RegSetValueEx(keyhand, strValue, 0, REG_BINARY, ByVal strData, Len(strData))
Y = RegCloseKey(keyhand)
End Sub


Se tiverem alguma dica pra diminuir ainda mais o codigo digam.
PAYDANA 05/02/2015 15:13:35
#444327
Assim tambem da mais não consegui escrever na segunda liunha

  Dim WshShell 
Set WshShell = CreateObject([Ô]WScript.Shell[Ô])

WshShell.RegWrite [Ô]HKEY_CLASSES_ROOT\Mime\Database\Content Type\application/json\[Ô], [Ô]jmhhl![Ô], [Ô]REG_SZ[Ô]
TUNUSAT 05/02/2015 16:54:25
#444329
PAYDANA,

Põe um exemplo do que você está fazendo no VBMania e torne-se lendário...
... nunca vi na vida VB6 acessando AJAX!
é quase que um bisavô conversando com um bisneto... KKKKK!

[][ô]s,
Tunusat.
PAYDANA 05/02/2015 18:20:32
#444334
O que achou do papo?
Faça seu login para responder