This is a migrated thread and some comments may be shown as answers.

Child .exe application within RadPane

5 Answers 132 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Wilfred
Top achievements
Rank 1
Wilfred asked on 13 Mar 2019, 06:31 PM

Hi,

I was wondering if the RadPane supports child application window handles. That is, i'm starting a new child process within my application and I want it to live inside one of the panes i've created. I can create the application and set the parent as the main window, but can't figure out how to make it live inside the pane. Any idea?

Thanks

5 Answers, 1 is accepted

Sort by
0
Kalin
Telerik team
answered on 15 Mar 2019, 02:02 PM
Hi Wilfred,

RadPane is basically ContentControl, so you should be able to that is should be done if working with ContentControl. However as I'm not completely sure what is the exact scenario you are trying to achieve - if you share a sample project with a sample implementation we can check it and let you know if there is anything special that needs to be done in the context of RadDocking.

I'm looking forward to hearing from you.

Regards,
Kalin
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Wilfred
Top achievements
Rank 1
answered on 18 Mar 2019, 01:56 PM

This snippet of code gets the process created and sets the parent as the main window. It looks like the child application lives within the pane, but when switch to other RadPanes (tabs) via mouse click, the child application is still the foremost view.

testChildapp = System.Diagnostics.Process.Start(process);
...
_appWin = testChildapp.MainWindowHandle;
...
var parent = new WindowInteropHelper(Window.GetWindow((TestAppPane.Content));
SetParent(_appWin, parent.Handle);
SetWindowLongA(_appWin, GWL_STYLE, WS_VISIBLE);
MoveWindow(_appWin, 200, 100, 200, 200, true);

                    

0
Kalin
Telerik team
answered on 21 Mar 2019, 11:37 AM
Hi Wilfred,

I assume the problem is that the new process runs inside of Window placed above the RadDocking control and this causes the observed behavior. Basically if you manage to run this process in place it inside WPF TabControl - it should be possible to achieve the same with RadDocking. If you can share sample project demonstrating how this is implemented and displayed inside TabControl, we would be able investigate what is the reason to behave differently inside RadDocking.

As another solution you could try to collapse the window of the external application when the active Pane of the current group changes.

Hope this helps - if you have any other questions, please let me know.

Regards,
Kalin
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Wilfred
Top achievements
Rank 1
answered on 25 Mar 2019, 12:39 PM
I'm able to switch between tabs now and have the child app show/hide as applicable. However, the child app doesn't follow the RadTab when I drag it out of the main tab dock and let it float in it's own window.
0
Kalin
Telerik team
answered on 28 Mar 2019, 08:59 AM
Hi Wilfred,

What I can suggest you would be to hook to the ToolWindowCreated event of RadDocking (for more info about all the events check this article) and then hook to the LocationChanged event of the new ToolWindow. This way you would be able to move as the floating window moves. Please check the following snippet:

private void Dock_ToolWindowCreated(object sender, Telerik.Windows.Controls.Docking.ElementCreatedEventArgs e)
{
    var toolWindow = e.CreatedElement as ToolWindow;
    toolWindow.LocationChanged += this.OnToolWindowLocationChanged;
}
 
private void OnToolWindowLocationChanged(object sender, System.EventArgs e)
{
    // Change the Location of the child process window here.
}

Hope this will help you.


Regards,
Kalin
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Docking
Asked by
Wilfred
Top achievements
Rank 1
Answers by
Kalin
Telerik team
Wilfred
Top achievements
Rank 1
Share this question
or