Results 1 to 11 of 11

Thread: Please solve this!!

  1. #1

    Thread Starter
    Fanatic Member pvbangera's Avatar
    Join Date
    Sep 2001
    Location
    Mumbai, India
    Posts
    961

    Please solve this!!

    Say, I have developed an application which opens a text file. it reads a text file and displays it to the user on a form and does various tasks.

    Now, I want to open every txt file using my application whenever the user double clicks the file in the windows explorer.

    pls guide.
    Microsoft Techie

  2. #2
    PowerPoster
    Join Date
    Dec 2003
    Location
    Bristol, England (but heart is in Virginia)
    Posts
    2,949
    Hi,

    Why do it in windows explorer? You can do it perfectly well using the OpenFileDialog control from the ToolBox. (Which looks like Windows Explorer anyway!)
    Last edited by taxes; Mar 5th, 2004 at 10:49 AM.
    Taxes
    The more I learn about VB.NET the more I like dBaseIII Plus

    The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.

  3. #3
    Frenzied Member
    Join Date
    Feb 2003
    Location
    Argentina
    Posts
    1,950
    I'm not sure how to associate extensions with an app in code, although it probably wouldn't take much searching to find a way, but a user can easily do it manually.

  4. #4
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Associating your program with specific ext can be easily done while making setup project for your application .

    Or

    by API .

  5. #5
    Frenzied Member Ideas Man's Avatar
    Join Date
    Aug 2002
    Location
    Australia
    Posts
    1,718
    Look in HKEY_CLASSES_ROOT at how the file extensions are created and use your program to simply add the required registry keys and strings to associate the files with your program.
    I use Microsoft Visual Basic 2005. (Therefore, most code samples I provide will be based around the .NET Framework v2.0, unless otherwise specified)

  6. #6
    Frenzied Member
    Join Date
    Feb 2003
    Location
    Argentina
    Posts
    1,950
    I'd go with Pirate. I forgot you could do it in setup, although to be nice, you should ask first.
    But, now you've got leads on 4 or 5 ways to do it

  7. #7

    Thread Starter
    Fanatic Member pvbangera's Avatar
    Join Date
    Sep 2001
    Location
    Mumbai, India
    Posts
    961
    is it something related to commandline argument??

    like, say, my application name followed by filename

    c:\MyApp.exe Text1.txt


    ??
    Microsoft Techie

  8. #8
    Frenzied Member Ideas Man's Avatar
    Join Date
    Aug 2002
    Location
    Australia
    Posts
    1,718
    Yeah the filename goes into the command part of the path. To get the file name, use X = Command in the Form_Load sub. I'm pretty sure it displays the full path so all you'd really have to do is call the sub that loads the files and it would do it automatically when it first loads up.
    I use Microsoft Visual Basic 2005. (Therefore, most code samples I provide will be based around the .NET Framework v2.0, unless otherwise specified)

  9. #9

    Thread Starter
    Fanatic Member pvbangera's Avatar
    Join Date
    Sep 2001
    Location
    Mumbai, India
    Posts
    961
    i am bit confused.

    can u provide me with an example?

    what settings i have to do in my project properties?

    thanx in advance
    Microsoft Techie

  10. #10
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    File Types Editor view . Check out MSDN howto .

  11. #11

    Thread Starter
    Fanatic Member pvbangera's Avatar
    Join Date
    Sep 2001
    Location
    Mumbai, India
    Posts
    961
    pirate, i am searching for it.

    btw, could u please solve my query at the following link:

    Please solve this!

    didnt receive any help from anybody yet. its urgent.

    thanx in advance
    Microsoft Techie

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