Results 1 to 3 of 3

Thread: Shelling your app.

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Apr 2000
    Posts
    215
    hi I was just wondering something about be able to shell your program and make it start with a certain function, for example when you shell Regsvr32 and put the space and \u at the end to say unregister a active x control, is there a way to make your vb app shell so that a particular functin is executed? the reason I ask this is I want to add a file asociation to my app, but if I just put the path to my app it will just open my app as it would if they just doubled clicked the exe and not open the file with it.

  2. #2
    Guest
    The command line argument is represented by the Command statement with VB.

    Code:
    Private Sub Form_Load()
        
        'This will open whatever file you type as the argument
        Open Command For Input As #1
        Text1 = Input(LOF(1), 1)
        Close #1
    
    End Sub
    In the command prompt, you would write

    Code:
    MyApp C:\FileToOpen.txt

  3. #3
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    Code:
    ' if you put the shell of the file in the
    ' form load of your app your app opens and
    ' opens the file as well...
    ' here it opens notepad and try.txt
    
    
    Private Sub Form_Load()
        Shell "C:\WINDOWS\notepad.exe C:\try.txt", 1
    End Sub
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

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