Hello,

I've wrote a little program wich exports files (.TDF extension).

I want, if user do a right click on a .TDF file in Windows explorer a feature like:

"Open it with ."

Do I have to do it with registry keys ?

If yes, what are the registry keys I have to add (and where) ?

Thank you very much.

Regards, Neitsa.
Posted on 2004-06-21 11:31:24 by Neitsa
REGEDIT4

tdf\Shell\the text you want displayed\

tdf\Shell\the text you want displayed\Command]
@="\"your program path" %1"


----------------

would be an example, replace green text with the text you want displayed, and the 'tdf' in blue = the extension.. have fun
Posted on 2004-06-21 12:05:05 by evlncrn8
Thank you very much evlncrn8 !

Works great ! :alright:

Regards, Neitsa.
Posted on 2004-06-21 12:27:18 by Neitsa
I use this little function...

RegisterFileExtension FRAME pFileExt,pCmd,pCmdLine

LOCAL hClassKey :D
LOCAL hCmdKey :D
LOCAL Disposition :D
LOCAL szExt[16] :B
LOCAL szCmd[260] :B

; Be sure the extension starts with .
mov eax,[pFileExt]
mov al,[eax]
cmp al,2EH
je >
lea eax,szExt
mov B[eax],2EH
inc eax
jmp >C1
:
lea eax,szExt
C1:
invoke lstrcpy,eax,[pFileExt]

invoke RegCreateKeyEx, HKEY_CLASSES_ROOT, ADDR szExt, 0, 0, \
REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, 0, \
ADDR hClassKey, ADDR Disposition

invoke wsprintf,ADDR szCmd,ADDR CmdFmt,[pCmd]
add esp,12

invoke RegCreateKeyEx, [hClassKey], ADDR szCmd, 0, 0, \
REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, 0, \
ADDR hCmdKey,ADDR Disposition
invoke lstrlen,[pCmdLine]
inc eax
invoke RegSetValueEx,[hCmdKey], 0, 0, REG_SZ, [pCmdLine], eax
invoke RegCloseKey,[hCmdKey]
invoke RegCloseKey,[hClassKey]

xor eax,eax
RET
CmdFmt: DB "Shell\%s\Command",0
ENDF


It is called as follows...

invoke RegisterFileExtension, "blb", "Open", 'C:\WinNT\system32\NOTEPAD.EXE "%1"'
Posted on 2004-06-21 13:39:43 by donkey
Hello,

Thank you very much Donkey, You're help is always greatly appreciated.

:alright:

Nice forum with nice people, glad to be here.

Regards, Neitsa.
Posted on 2004-06-21 16:46:23 by Neitsa