Announcement

Collapse
No announcement yet.

how to open a program with one click

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • how to open a program with one click

    hi,,
    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

    thanks

  • #2
    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.
    kgpsoftware.com | Slam DBMS | PrpT Control | Other Downloads | Contact Me

    Comment


    • #3
      I choose not to send parameters but you can, here is the MSDN description of ShellExecute
      http://msdn.microsoft.com/en-us/libr...53(VS.85).aspx


      Code:
               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
      http://www.tngbbs.com
      ----------------------
      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

      Comment


      • #4
        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? "

        Comment

        Working...
        X