Hi!
I want to get the default web browser using registry. I wrote this code:


.data
szKey db "http\shell\open\command",0
szValue db 0
hKey dd 0
BuffSize db 256
Buff db 256 dup (0)
.code
GetDefBrowser proc

push offset [hKey]
push KEY_READ
push 0
push offset [szKey]
push HKEY_CLASSES_ROOT
call RegOpenKeyEx

push offset [BuffSize]
push offset [Buff]
push 0
push 0
push offset [szValue]
push offset [hKey]
call RegQueryValueEx

push offset [hKey]
call RegCloseKey

ret

GetDefBrowser endp

But it doesn't work. Why ? Please help me.

Cya.
Posted on 2004-01-27 05:32:36 by KKKas

Hi!
I want to get the default web browser using registry. I wrote this code:


.data
szKey db "http\shell\open\command",0
szValue db 0
hKey dd 0
BuffSize dd 256
Buff db 256 dup (0)
.code
GetDefBrowser proc

push offset hKey
push KEY_READ
push 0
push offset szKey
push HKEY_CLASSES_ROOT
call RegOpenKeyEx

push offset BuffSize
push offset Buff
push 0
push 0
push offset szValue
push [hKey]
call RegQueryValueEx

push [hKey]
call RegCloseKey

ret

GetDefBrowser endp

But it doesn't work. Why ? Please help me.

Cya.


try that ;)
Posted on 2004-01-27 05:53:54 by evlncrn8
Oh, very, very, very, very thanks!! :* (:
Posted on 2004-01-27 06:10:29 by KKKas
whenever you need to find the registered (default) executable for a 'document' (so a data file that doesn't execute itself) you can use FindExecutable. :)
Posted on 2004-01-27 07:22:51 by Hiroshimator