Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can application be opened in Panel / TabPage 2

Status
Not open for further replies.

StevenK

Programmer
Jan 5, 2001
1,294
GB
We're looking at opening up an application (i.e. Windows Explorer or Excel) within a Panel or TabPage - or other container.
Can this be done - and if so - how?

Thanks in advance.
Steve
 
You can do it with using the webbrowser control. I don't think the application itself can be called inside your app.

________________________________________________________
Zameer Abdulla
Help to find Missing people
 
Will this webbrowser component allow me to run any application in it?
Or is it just the Windows Explorer application?
I want to run either Word or Excel, etc.

Can this be done within this webbrowser control or similar?

Thanks again.

Steve
 
The link to the download is about halfway down the page I mentioned above.

[vampire][bat]
 
The DSOFramer component looks to do what we need here.
How can I add this to my ToolBox in Visual Studio to make use of in new projects?

That could well be a silly question....

Thanks in advance.
Steve
 
Install it, and then select it from the COM tab in the Add Components/Controls dialog box (right-click on the Toolbox).

It is very easy to use, just follow the examples provided.

[vampire][bat]
 
There is another method, but it is not as flexible as DSOFramer and there are a limited number of programs for which it will work. You will have to use trial and error to find out which. For examnple it works (sort of) with Notepad, but not WordPad. It will work with Calc, but then goes wrong if you change view. But it is a much lighter weight solution (if it is applicable to your requirements) than DSOFramer.

Both these methods actually form a small part of an example I'm putting together for Sorwen regarding Plug-Ins.


Code:
	Private Const WM_SYSCOMMAND As Integer = 274
	Private Const SC_MAXIMIZE As Integer = 61488

	Declare Auto Function SetParent Lib "user32.dll" (ByVal hWndChild As IntPtr, ByVal hWndNewParent As IntPtr) As Integer
	Declare Auto Function SendMessage Lib "user32.dll" (ByVal hWnd As IntPtr, ByVal Msg As Integer, ByVal wParam As Integer, ByVal lParam As Integer) As Integer

	Private Sub NotepadToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NotepadToolStripMenuItem.Click

		Dim f1 As New Form1
		f1.MdiParent = Me
		f1.Show()
		f1.WindowState = FormWindowState.Maximized
		Dim proc As Process
		proc = Process.Start("notepad")
		proc.WaitForInputIdle()
		SetParent(proc.MainWindowHandle, Me.Handle)
		SendMessage(proc.MainWindowHandle, WM_SYSCOMMAND, SC_MAXIMIZE, 0)
		SendMessage(proc.MainWindowHandle, WM_SYSCOMMAND, SC_MAXIMIZE, 0)

	End Sub

[vampire][bat]
 
earthandfire, that is new to me. thanks

________________________________________________________
Zameer Abdulla
Help to find Missing people
 
I'm trying to make the component available for usage within my copy of Visual Studio - but failing fast.

What installation do I need to run with this?
I've run the 'DsoFramer_KB311765_x86.exe' which has then produced a 'Samples' and 'Source' directory.
I've been able to run the sample code in the 'Samples' / 'Vb7Test' directory and this works well.

But I'm failing to understand how I am able to get the component in my Toolbox for use on a Windows Form - if this is possible.

Thanks in advance.
Steve
 
I don't have access at work, but I'll post a more detailed explanation tonight.

[vampire][bat]
 
I can't install it on this machine to tell you for certain (Rather than finding out what I need to do my job, IT suddenly decided to tell me what I need. So I can't install any more. Which makes doing my job hard.) but generally what E&F posted before should hold.

For a step by step. Right-click on the ToolBox. Select "Choose Items". Click on the "Com" tab. Go through the list and select you item. Should say something about DSOFramer in the title. Click the box next to it. If it isn't listed then you can browse to the location of the OCX file and the click Ok all of the way out.

-I hate Microsoft!
-Forever and always forward.
-My kingdom for a edit button!
 
It's ok - I've now been able to do this. :)
Thanks again for the pointers.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top