delphi - How to return an embedded window to windows as parent -


I'm using ShellExecute to launch Adobe Reader. After that I will get the window with WinApi.Windows.SetParent Redirecting to a panel. Now when I close my app, Adobe Reader is still active in memory and I must finish the process in Task Manager before opening a new session.

My questions are: How do I get Adobe Reader in my app? How do I talk to it? (Stop sending messages and minimizing it) and how do I return them to the windows as parents?

Edit Delphi XE5:

This is the code that I use to set up new parents:

  ShellExecute (handle, zero, picarah ('c: \ tool \ temp.pdf'), zero, zero, SW_SOWNOWNMAL); Sleep (500); WHandle: = FindWindow (zero, 'Temp.pdf - Adobe Reader'); WinApi.Windows.SetParent (wHandle, Panel1.Handle);    

Here are my answers to my questions:

  • I have been saved in the WH and Wear because this is a global variable, so I can get it anywhere in my code. Like my form's on-close event

  • To 'talk' to the ebob reader, I have to use the Sand Message method and pass the required parameters. I can use wHandle to point to Adobe Reader. The creator of Adobe Reader is not really a problem.

  • When I want to root Adobe Reader as Windows, then I just change SetParent's NewParent parameter from Panel 1. 0 from handles

    I got the reply from my question and got the reply. They all told me in the right direction.

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -