Key code
IntPtr notepadHandle =APPIntprt= _process.MainWindowHandle; int style = GetWindowLong(notepadHandle, GWL_STYLE); style = style & ~((int)WS_CAPTION) & ~((int)WS_THICKFRAME); // Removes Caption bar and the sizing border style |= ((int)WS_CHILD); // Must be a child window to be hosted SetWindowLong(notepadHandle, GWL_STYLE, style); SetParent(notepadHandle, this.Handle);
Effect picture (embedded Notepad process exe):
Source code download:
https://files.cnblogs.com/files/chlm/wpf_load_exe.rar