Thread: Opening file with other program

  1. #1
    george7378
    Guest

    Opening file with other program

    Hi everyone,

    Is there a way to open a file with it's respective program (eg: Word files with Word, images with picture and fax viewer, etc...) using C++?
    Thanks.

  2. #2
    'Allo, 'Allo, Allo
    Join Date
    Apr 2008
    Posts
    639
    system("C:/this/is/my/file.doc");

  3. #3
    Registered User
    Join Date
    Dec 2007
    Posts
    2,675
    ShellExecute is probably a better choice here.

  4. #4
    Programming Wraith GReaper's Avatar
    Join Date
    Apr 2009
    Location
    Greece
    Posts
    2,738
    Quote Originally Posted by rags_to_riches View Post
    ShellExecute is probably a better choice here.
    Indeed.
    When i'm using "system" instead of "ShellExecute", the console window pops up even if i have disabled it!
    Devoted my life to programming...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Free glut, Rastering a .raw file
    By Falconmick in forum C Programming
    Replies: 3
    Last Post: 04-03-2011, 04:41 AM
  2. Totally confused on assigment using linked lists
    By Uchihanokonoha in forum C++ Programming
    Replies: 8
    Last Post: 01-05-2008, 04:49 PM
  3. Last program!!
    By buckwheat88 in forum C++ Programming
    Replies: 12
    Last Post: 01-17-2006, 12:31 PM
  4. Possible circular definition with singleton objects
    By techrolla in forum C++ Programming
    Replies: 3
    Last Post: 12-26-2004, 10:46 AM
  5. My program, anyhelp
    By @licomb in forum C Programming
    Replies: 14
    Last Post: 08-14-2001, 10:04 PM