Menu

Launching External Programs

2007-08-23
2012-09-26
  • Martian Man

    Martian Man - 2007-08-23

    Hello,
    I've got a menu and menuitems and one of the menuitems is New Adobe Acrobat Document. I was wondering how to launch an external program from a menuitem (in this case Adobe Acrobat (AcroRd32.exe)).

     
    • Osito

      Osito - 2007-08-23

      I have this line in one of my programs to launch an html doc:

      ShellExecute(NULL, "open", FILE_NAME_OF_HELP, NULL, NULL, SW_SHOWNORMAL);

      FILE_NAME_OF_HELP is the path to the file. You'd have to figure out where the user has installed Acrobat, or else put a dummy pdf file in the same folder as your program and have it open that to launch Acrobat:

      ShellExecute(NULL, "open", "dummy.pdf", NULL, NULL, SW_SHOWNORMAL);

      Something along those lines anyway. Look at the MSDN help on ShellExecute for more info.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.