CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 9 of 9
  1. #1
    Join Date
    Apr 2007
    Posts
    15

    Talking Open/Display File

    Hi,

    I want to ask how to open/display a file like we double click to this file in windows. Not like read/open file such as fread or ifstream...

    Thank you.

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,430

    Re: Open/Display File

    Have a look at MSDN topic CWinApp::EnableShellOpen
    Victor Nijegorodov

  3. #3
    Join Date
    Aug 2008
    Posts
    373

    Re: Open/Display File

    Quote Originally Posted by Coaxecva View Post
    Hi,

    I want to ask how to open/display a file like we double click to this file in windows. Not like read/open file such as fread or ifstream...

    Thank you.
    Think about ShellExecute()

  4. #4
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,430

    Re: Open/Display File

    Quote Originally Posted by Msm View Post
    Think about ShellExecute()
    Correct!
    but first you must register file type...
    Victor Nijegorodov

  5. #5
    Join Date
    Aug 2008
    Posts
    373

    Re: Open/Display File

    Quote Originally Posted by VictorN View Post
    Correct!
    but first you must register file type...
    yes sir..

  6. #6
    Join Date
    Apr 2007
    Posts
    15

    Re: Open/Display File

    Okie, thanks

  7. #7
    Join Date
    Jul 2009
    Location
    India
    Posts
    835

    Re: Open/Display File

    @..Victor Sir..

    Can you explain me why did you suggest to register file type before ShellExecute().

    We can easily use ShellExecute() to run any program or others.

  8. #8
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,430

    Re: Open/Display File

    Quote Originally Posted by hypheni View Post
    ...
    We can easily use ShellExecute() to run any program or others.
    Yes, after registering!
    See:
    http://www.ml-consult.co.uk/foxst-26.htm
    http://msdn.microsoft.com/en-us/libr...01(VS.85).aspx
    http://msdn.microsoft.com/en-us/libr...86(VS.85).aspx
    Victor Nijegorodov

  9. #9
    Join Date
    Jul 2009
    Location
    India
    Posts
    835

    Re: Open/Display File

    Okay you are suggesting the registration for unknown file types. I got it. And yes thanks for those links..

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

Featured