Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Can this be done  An app1 open and display app2 within app1 form?

Posted on 2007-04-01
5
Medium Priority
?
231 Views
Last Modified: 2010-04-23
Is it possible to open another app within an app?  Does that make sense?

I mean could one actually make another application appear within a container within a main app?


Mark
0
Comment
Question by:vbMarkO
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 86

Accepted Solution

by:
Mike Tomlinson earned 2000 total points
ID: 18831367
0
 
LVL 28

Expert Comment

by:iboutchkine
ID: 18835598
Another way of doing it:
Use the WebBrowser control - add an instance of the control to your form, and use the .Navigate
method to open your word document - It works just like the old OLE container did.
0
 

Author Comment

by:vbMarkO
ID: 18835896
Idle_Mind,

Oh man this is very cool, no doubt what I am looking for I think....

not clear on one thing here  using the below code which worked perfectly by the way ...

Public Class Form1

    Private Declare Function SetParent Lib "user32" Alias "SetParent" (ByVal hWndChild As IntPtr, ByVal hWndNewParent As IntPtr) As Integer

    Private p As Process = Nothing

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If (p Is Nothing) OrElse p.HasExited Then
            p = Process.Start("Calc")
            p.WaitForInputIdle()
            SetParent(p.MainWindowHandle, Panel1.Handle)
        End If
    End Sub

    Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
        If Not (p Is Nothing) Then
            If Not p.HasExited Then
                p.CloseMainWindow() ' or p.Kill() if it doesn't have a GUI                
            End If
        End If
    End Sub

End Class

This opened the calc  ... but how would I aim this at a different app   ....   is it here in this line of code
p = Process.Start("Calc")
Calc <----- is this where I would put path to exe file of app I wish to open up?

Mark

0
 

Author Comment

by:vbMarkO
ID: 18836056
I answered that question I just opened up another app and it worked great .... May I ask another question or 2 understand your answer is the accepted solution and I will accept your solution as soon as I am done typing here.

Follow up questions if I might;

1. Is there a way to constrain the app I am opening in a fixed position within the panel?

2. Also is it possible to make my app resize to accommodate the opened app?

Note:  Should I just be posting new questions   .... if so I am more than happy because my original question has been solved ..

Thanx
0
 

Author Comment

by:vbMarkO
ID: 18836395
Idle_Mind  ...

Here is my new questions concerning this I invite you to answer

http://www.experts-exchange.com/Programming/Languages/.NET/Visual_Basic.NET/Q_22486758.html
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question