4

I tried to embed external app, not only notepad but also mstsc (remote desktop), within a tpanel in my delphi application. With CreateProcess i run application and with Windows.SetParent i embed first app window. I get problems with next windows opened by then external app (for instance file-open window in notepad or next login window and main window in remote desktop). Timing a call to enumwindows for the external process is a solution, but enumwindows list every window of the process (also popup & controls). Is there a way identify only process' windows (forms) to be relocated, or a way to embed the process once for all within the panel?

Thanks

kit62
  • 161
  • 1
  • 3
  • 6
  • 4
    Try and find a different solution. Attempting to make this one work will cause you endless pain and there will be nothing to show for that pain. For instance, here's Raymond comparing what you are attempting with juggling chainsaws: http://blogs.msdn.com/b/oldnewthing/archive/2013/04/12/10410454.aspx The best solution would be to run the remote desktop functionality in your process – David Heffernan Jun 24 '13 at 11:51
  • 4
    This is definitely not a road you want to go. Trust me, I'm there. And it only causes pain..every day. And I'm parenting my own applications not even 3rd party. Try using COM/ActiveX for what you are trying to do. Most of the time you will get better results that way. – Sherlock70 Jun 24 '13 at 12:41
  • I totally agree with David and @Sherlock70: do not do this. Mixing the event handlers of two applications will open a can of worms, especially if not all of the applications developed by yourself. – Jeroen Wiert Pluimers Jun 24 '13 at 16:00
  • You might also want to have a look at a (somehow) similar question of mine: [SO:Parent window freezes when child window freezes altough it's from another process](http://stackoverflow.com/q/16817112/) - If some inner window freezes, the host also does. – Günther the Beautiful Jun 24 '13 at 21:10
  • Gunther, if i understand your question, i've got similar effect on notepad popup menus when i parented to my panel all windows enumerated with enumwindows. For this reason i've asked for a manner to identify only forms not all windowed controls. – kit62 Jun 24 '13 at 21:27
  • Thanks for other answers, think i bad explain. I try obtain from my delphi app to: start another app (not a particular one) registering app start and bordering app windows to a panel, passing from one opened app to another giving focus to its parent panel and register when app is closed (eventually with a timer checking process) – kit62 Jun 24 '13 at 21:48

0 Answers0