Re: Add a context menu item to Windows Explorer (Win98) with VB6?



I should point out that this will fail under Windows Vista, FWIW.


"Eduardo" <mm@xxxxxx> wrote in message news:gd58cb$i3e$1@xxxxxxxxxxx
| "MM" <kylix_is@xxxxxxxxxxx> escribió en el mensaje
| news:h93cf4danhcuie7r4r1tc679sdv78vkhbl@xxxxxxxxxx
| > Okay, before I start searching the web or delving through my extensive
| > library, which could take days, here's what I want to do:
| >
| > Write a VB6 program. No problem. Program accepts one or more text
| > files (may have any extension).
| >
| > In Windows Explorer I select the files and right click.
| >
| > The context menu shows a new command (the one I will have added).
| >
| > I click on the item and the files are processed in some way.
| >
| > Finished.
| >
| > --------------------------------
| >
| > In VB6, has someone done this already? Or similar code that I can
| > modify?
| >
| > (I don't want to reinvent the wheel!)
|
| Look here: http://www.freevbcode.com/ShowCode.Asp?ID=322
|
| Modify the function CreateFileAssociation adding another parameter
(Variant)
| with name "CommandName" or something like that, an optional parameter.
| Then change the line:
|
| If bAns Then bAns = WriteStringToRegistry(HKEY_CLASSES_ROOT, _
| sExtName & "\shell\open\command", "", AppCommand)
|
| to:
|
| If bAns Then bAns = WriteStringToRegistry(HKEY_CLASSES_ROOT, _
| sExtName & "\shell\" & CommandName & "\command", "", AppCommand)
|
| Since this parameter is optional, then at the begining of the function add
| this:
|
| If IsMissing (CommandName) Then CommandName = "open"
|
| > Thanks!
| >
| > MM
|
|


.



Relevant Pages

  • Re: Outlook 2007 attachments
    ... You probably do not have the permissions to modify the registry data needed ... to disable this prompt. ... Are you using Windows Vista or Windows XP? ... Do you also experience this warning for other files? ...
    (microsoft.public.outlook)
  • Re: Runtime Error when not Administrator
    ... Thanks for the suggestion. ... I will just need to decide whether it better to modify the application, or just require that users be administrators on their machines. ... If you require your user to be an administrator, then on Windows Vista your app will either require a UAC prompt, or it will get "virtualized", neither of which you want. ...
    (microsoft.public.vc.language)
  • Re: Vista & BDS 2006
    ... "This Webinar will show you how to modify your Delphi and C++Builder ... applications to get them ready for Windows Vista. ...
    (borland.public.delphi.non-technical)