Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Right click menu from windows explorer
Message
General information
Forum:
Visual FoxPro
Category:
Installation, Setup and Configuration
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00967962
Message ID:
00968571
Views:
10
This message has been marked as the solution to the initial question of the thread.
1) First, you have to find file group name by looking at the entry for the file extension. After that you can add your key. Code below that uses WSH demonstrates that. You can use VFP FFC Registry class or any other class/program that works with registry.
oShell = CreateObject("WScript.Shell")
lcExt = [.txt]
lcFileGroupName = oShell.RegRead([HKCR\] + lcExt + [\])
lcCommand = [H:\temp\test.exe "%1"]
lcMenuItem = [TestRun]
oShell.RegWrite([HKCR\] + lcFileGroupName + [\shell\] + lcMenuItem + [\command\], lcCommand)
2) After running code above you'll see new entry 'TestRun' on Right-clik menu of .TXT files. Selecting it will launch a program you specify in the lcCommand above.

3) Your program will be launched once for every file selected and full file name will be passed as a parameter to it.

>I need to program some functionaility into a system I am working on.
>
>The user needs to be able to send file to the app quickly and the prefered method is to select the files/or files (it may be a multi-select) and then send them to my app, by right clicking, finding my app name in the drop down and then opening my app with the file names in memory. Hope I have explained this adequately.
>
>From my understanding this is managed by changing registry values. The software can be installed anywhere on the disc, so I will need to create these values using my installer (using an old version of wise for this project, but know how to update kets etc)
>
>My question is what keys do I need to add to :
>
>1) Add the right click menu item to a certain file type? Think its HKEY_CLASSES_ROOT\txtfile\shell for a text file etc?
>2) Then get my app to open with the parameter of the file names passed to it.
>3) How do I reference the file names from my VFP app, thinking probably have a parameter from the commna line to pass them directly in.
>
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform