On 11/20/06, Chris Davis <[EMAIL PROTECTED]> wrote:
> Hi All,
>
> Does anyone have an example of how to change a file association via vfp?
>
> TIA
>
> Chris.
Here's something that I use to associate .iqc and .iqt with my
application "Inventory Query". It's fairly rudimentary, and probably
requires admin privs to run, but it's a place to start...
#include lib/registry.h
LOCAL oReg
IF MESSAGEBOX("*.IQT and *.IQC files will be started with ";
+CR+SYS(16,1),1+48+256,"Inventory Query") = 1
ASSERT ".EXE" $ UPPER(SYS(16,1)) MESSAGE "Not Now!"
oReg=NEWOBJECT("registry","lib/registry.vcx")
=oReg.SetRegKey("",'"'+SYS(16,1)+'" "%1"', ;
"InventoryQuery\shell\open\command", ;
HKEY_CLASSES_ROOT,.T.)
=oReg.SetRegKey("","InventoryQuery", ;
".iqc", HKEY_CLASSES_ROOT,.T.)
=oReg.SetRegKey("","InventoryQuery", ;
".iqt", HKEY_CLASSES_ROOT,.T.)
=oReg.SetRegKey("",SYS(16,1)+",0", ;
"InventoryQuery\DefaultIcon", ;
HKEY_CLASSES_ROOT,.T.)
=oReg.SetRegKey("","Inventory Query Criteria Set", ;
"InventoryQuery",HKEY_CLASSES_ROOT,.T.)
ENDIF
--
Dave Thayer
Denver, CO
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.