Results 1 to 3 of 3

Thread: [RESOLVED] Open multiple custom associated file to a single-instance application (from explorer)

  1. #1

    Thread Starter
    PoorPoster iPrank's Avatar
    Join Date
    Oct 2005
    Location
    In a black hole
    Posts
    2,729

    Resolved [RESOLVED] Open multiple custom associated file to a single-instance application (from explorer)

    My app is a single-instance MDI application which opens multiple documents (via file menu/command line) in MDI child windows.
    I have associated my own filetype in explorer.
    Now, I want, if I double click associated files on explorer, the files will be opened in the active instance of my app (in child windows).

    Basically I need to pass the file path to the active instance of my application.

    I have an idea for this. But that is too complex. (Creating mutex to find previous instance and passing filename with WM_COPYDATA etc. )

    Anyone got simpler idea ? OR correct google keywords ? (my search didn't result good results)
    Last edited by iPrank; Dec 20th, 2012 at 10:56 AM.
    Usefull VBF Threads/Posts I Found . My flickr page .
    "I love being married. It's so great to find that one special person you want to annoy for the rest of your life." - Rita Rudner


  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Open multiple custom associated file to a single-instance application (from explo

    It's all built into VB.NET. Handle the Startup and StartupNextInstance events of the application, which you can access from the Application page of the project properties. Startup is the event that's raised the first time the user runs the app. StartupNextInstance is the event that's raised when the user tries to run the application again while it's already open. You can access the commandline arguments via both events.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    PoorPoster iPrank's Avatar
    Join Date
    Oct 2005
    Location
    In a black hole
    Posts
    2,729

    Re: [RESOLVED] Open multiple custom associated file to a single-instance application

    Thanks. I've found the solution after posting the thread.
    The said project is a VB6 upgrade project. The "Application.myapp" file was not correct. I was unable to enable 'Application Framework".
    I deleted and recreated that file. Now everything is working properly.
    Last edited by iPrank; Dec 20th, 2012 at 11:20 AM.
    Usefull VBF Threads/Posts I Found . My flickr page .
    "I love being married. It's so great to find that one special person you want to annoy for the rest of your life." - Rita Rudner


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