Results 1 to 7 of 7

Thread: opening app from another app

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 1999
    Location
    Glasgow,Scotland
    Posts
    281

    opening app from another app

    Hi,

    In my exe I have a command button. When this button is clicked it opens my help.exe (I use the treeview control in my help file).

    Now, what I want to know is, is it possible to have the help file opened on a certain page when it's opened from the main app? Like when the above button, titled 'Using this program' is clicked, the page that loads in the help.exe is the relevant page to that part of the program?

    If the user opens the helpfile by double clicking it (not through the main application) it opens up on the title page, rather than a particular page.

    Is it possible to do this in vb? How?

  2. #2
    Frenzied Member
    Join Date
    Jan 2001
    Location
    Newbury, UK
    Posts
    1,878
    Call the application (how do you do that? With Shell?) with a parameter. This parameter is passed into the called program as Command$.
    The starting program can check to see what is in Command$ and do anything it likes based on the values.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 1999
    Location
    Glasgow,Scotland
    Posts
    281
    Thanks Jordan, but I'm not too sure what you mean by the command$.

    I use Shell:


    Private Sub Command1_Click()

    Call ShellExecute(hwnd, "Open", "project1.exe", "How do I use.htm", App.Path, 1)

    End Sub

    The application project1.exe opens, alright. I got that far. But I want it to open the page 'How do I use.htm.

    If it's any use, I've got access to all source code for project1.exe. It's a web browser I've made myself.

    Thanks.

  4. #4
    Frenzied Member
    Join Date
    Jan 2001
    Location
    Newbury, UK
    Posts
    1,878
    In Project1, in the Form_Load procedure just put this line, and take it from there:
    VB Code:
    1. msgbox command$

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 1999
    Location
    Glasgow,Scotland
    Posts
    281
    If I simply put msgbox command$ in the form_load of project1, project1 always loads showing a message box - even if I don't open project1 from project2.

    And it doesn't go straight to "how do I use.htm" .

    I tried this? Why doesn't it work? Been looking at similar problems and can't get it to work. What's wrong?

    If Shell(Command$) = Shell(App.Path & "\how do I use.htm") Then
    WebsterPro2.Navigate "file:///" & App.Path & "\how do I use.htm", NavGet, 0, "", "", ""
    End If


    Also dabbled in stuff like:

    Shell Command$, open

  6. #6
    Lively Member da_haCKEr's Avatar
    Join Date
    Oct 2002
    Location
    Paradise Isle of Sri Lanka
    Posts
    116

    Red face Commands and stuff

    Well, if you have ever used any dos programmes, you know how to pass parameters to a program. Ex.: Xcopy file1, file2. Xcopy is the program name. File1 and File2 are the parameters.
    You can pass parameters like that to your VB program. If you have Project1.exe, then you can call it like project1 mypage.html.
    Then command$ function would return mypage.html.

    BTW, why not use Html Help ?. It's really easy to configure and use.
    .:JanuZ:.
    .:JanuZ:.XtremeSoft


  7. #7
    Frenzied Member
    Join Date
    Jan 2001
    Location
    Newbury, UK
    Posts
    1,878
    In the Shell / ShellExecute you put:

    MyProgram Myparameters

    Then within the form_load area (or anywhere else really) of MyProgram you take a look at Command$. Command$ will have "Myparameters" in it.

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