Results 1 to 7 of 7

Thread: Add command to Windows Shell integration

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Sep 2000
    Posts
    25
    I have a tricky one for all of you :

    I want to add a command to the shell that pop up's when you right-click a file in the windows explorer( e.g. like winzip does that).

    I want to have the option, that if you right click a folder or file in the windows explorer, you can start up my program.

    The second question is that if you click on 'my program' i want to pass the data of the folder/file-name to 'my program'

    Anyone got any suggestions ??

    I'm lost ....


  2. #2
    Guest
    To let the proggie accept that sort of opening, you need to use the Command$ variable that contains a string of everythying that was passed in to you proggie at startup time.

    Therefore, you would check the Command$ var in Sub Main and see if it contained a filename. If it did, then call your load function or whatever function you need to passignthe command line var to it eg:

    Code:
        Dim strFile as String
        strFile = Command$
        LoadFile strFile
    or something similar.

    - gaffa

  3. #3
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649
    I've answered this question before have a look at this thread.

    Good luck!

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Sep 2000
    Posts
    25
    Thx for the quick reply.
    The registry part works :-)
    It's now in the shell-menu.

    Question 2 :

    How do I pass the folder/file-name to my program ?
    I want it to start up with the folder where my program is started from ....

    Any suggestions ??

    Kleinvaag

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Sep 2000
    Posts
    25
    By the way, I tried to Command$, there seems to be nothing in it ??

    Kleinvaag

  6. #6
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    In registry, you've put the default value of the command key ending with a " %1" right? Should work if you lauch your app by rightclicking that file in explorer on that command in the context menu.
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  7. #7

    Thread Starter
    Junior Member
    Join Date
    Sep 2000
    Posts
    25
    Thx a lot.
    I didn't had the %1 ...

    It workds fine now.

    Thx Again,

    You've been a big help ....

    Kleinvaag

    See you .......... at my next question :-)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width