Child .exe application within RadPane

6 posts, 0 answers
  1. Wilfred
    Wilfred avatar
    9 posts
    Member since:
    Feb 2017

    Posted 13 Mar 2019 Link to this post

    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

  2. Kalin
    Admin
    Kalin avatar
    1360 posts

    Posted 15 Mar 2019 Link to this post

    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.
  3. Wilfred
    Wilfred avatar
    9 posts
    Member since:
    Feb 2017

    Posted 18 Mar 2019 Link to this post

    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);

                        

  4. Kalin
    Admin
    Kalin avatar
    1360 posts

    Posted 21 Mar 2019 Link to this post

    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.
  5. Wilfred
    Wilfred avatar
    9 posts
    Member since:
    Feb 2017

    Posted 25 Mar 2019 in reply to Kalin Link to this post

    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.
  6. Kalin
    Admin
    Kalin avatar
    1360 posts

    Posted 28 Mar 2019 Link to this post

    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.
Back to Top