No announcement yet.

how to open a program with one click

  • Filter
  • Time
  • Show
Clear All
new posts

    how to open a program with one click

    i have created a dialogue and it has a button that i want to use it to open an application like adobe reader or windows mediaplayer ?

    what is the command for calling applications ?
    i tried SHELL didnt work


    SHELL should work, please post the code you used. If you need to open a particular file with it's associated program then the Windows API function ShellExecute() is the one to use. | Slam DBMS | PrpT Control | Other Downloads | Contact Me


      I choose not to send parameters but you can, here is the MSDN description of ShellExecute

               Case %IDM_HELP 'Help menu was selected
                   sTmp = AppPath & "Help\Index.html"
                   ShellExecute ByVal %NULL, "open", ByVal StrPtr(sTmp), ByVal %NULL, ByVal %NULL, %SW_SHOWNORMAL
                   Function = %TRUE
      Scott Turchin
      MCSE, MCP+I
      True Karate-do is this: that in daily life, one's mind and body be trained and developed in a spirit of humility; and that in critical times, one be devoted utterly to the cause of justice. -Gichin Funakoshi


        like Scott said..."ShellExecute" is the way.

        I have used it for opening a program via the users personal preference of what program to use (unlike "Lazy" programmers out there, that force you to open Internet Explorer, when you normally use Firefox, or force M$ Office, when you normally use OpenOffice"

        The choice should be up to the user, and not the programmer (unless no choice), and only takes one line of code to do so

        Engineer's Motto: If it aint broke take it apart and fix it

        "If at 1st you don't succeed... call it version 1.0"

        "Half of Programming is coding"....."The other 90% is DEBUGGING"

        "Document my code????" .... "WHYYY??? do you think they call it CODE? "