Delphi – How to display a window from another process in an MDI window in the application

delphi

I am working on an MDI application in Delphi.

I would like to show interactive views generated by other applications(which I also build) within MDI child windows of my application.

When the user selects a specific view type in my app it will start an instance of the other app which will generate one or more data views displayed in MDI child windows of my app.

I hope this is clear.

Best Answer

You can spawn the other application, grab the window handle associated with that process, then set the Parent of that window handle to the handle associated with a form or panel in your MDI application.

Check out the following Win32 functions...

  • GetParent( hWnd )
  • SetParent( hWndChild, hWndNewParent )

You may also need...

  • SetWindowPos( hWnd, hWndInsertAfter, X, Y, cx, cy, uFlags )
  • SetWindowLong( hWnd, nIndex, dwNewLong );
  • GetWindowLong( hWnd, nIndex );
Related Topic