<div>with SetForegroundwindow ?<br><br>&nbsp;</div>
<div><span class="gmail_quote">On 30/05/06, <b class="gmail_sendername">Dennis Chuah</b> &lt;<a href="mailto:dennis_cs_chuah@hotmail.com">dennis_cs_chuah@hotmail.com</a>&gt; wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><br>SW_RESTORE will not work.<br><br>You can use ShellExecuteEx instead.&nbsp;&nbsp;It returns a handle to the process,
<br>from which you can find the main window and bring to the front.<br><br>----- Original Message -----<br>From: &quot;Paul A Norman&quot; &lt;<a href="mailto:paul.a.norman@gmail.com">paul.a.norman@gmail.com</a>&gt;<br>Sent: Tuesday, May 30, 2006 2:32 PM
<br><br><br>&gt; What about SW_RESTORE ?<br>&gt;<br>&gt; Peter Below's bigger solution to this in his posting suggests this can<br>&gt; give<br>&gt; all sorts of control overn such a prog.<br>&gt;<br>&gt; &quot;The other option is to use CreateProcess to start the program. That gives
<br>&gt; you (among other goodies) the threadID of the programs main thread. Which<br>&gt; you can then use with EnumThreadWindows to find the window(s) of that<br>&gt; thread. Go to <a href="http://www.deja.com">http://www.deja.com
</a>, <a href="http://www.mers.com/searchsite.html">http://www.mers.com/searchsite.html</a>,<br>&gt; <a href="http://www.tamracka.com">http://www.tamracka.com</a> or <a href="http://developers.href.com">http://developers.href.com
</a> and search the<br>&gt; newsgroups for the API functions mentioned above for examples. &quot;<br>&gt;<br>&gt;<br>&gt; On 30/05/06, Phil Scadden &lt;<a href="mailto:p.scadden@gns.cri.nz">p.scadden@gns.cri.nz</a>&gt; wrote:
<br>&gt;&gt;<br>&gt;&gt; Having some fun with Shellexecute. I am using it from my program to<br>&gt;&gt; get another application open one of its documents. No problem there.<br>&gt;&gt; However, if the application is ALREADY running, then the document
<br>&gt;&gt; is opened within the existing application. Hmm. Not so good but no<br>&gt;&gt; real problem. Now the real problem. If the application is covered by<br>&gt;&gt; another<br>&gt;&gt; window, this it is not brought to top and its not obvious that the
<br>&gt;&gt; document<br>&gt;&gt; has been opened all. It looks like my application is not doing its job.<br>&gt;&gt;<br>&gt;&gt; I am calling shellexecute with shownormal. Any way to force the<br>&gt;&gt; application<br>
&gt;&gt; to the top short of scanning the process list or findwindow and calling<br>&gt;&gt; setwindowpos on that instance?<br>&gt;&gt;<br>&gt;&gt; ----------------------------------------------------------<br>&gt;&gt; Phil Scadden, Institute of Geological and Nuclear Sciences
<br>&gt;&gt; 764 Cumberland St, Private Bag 1930, Dunedin, New Zealand<br>&gt;&gt; Ph +64 3 4799663, fax +64 3 477 5232<br>&gt;&gt;<br>&gt;&gt; _______________________________________________<br>&gt;&gt; Delphi mailing list
<br>&gt;&gt; <a href="mailto:Delphi@ns3.123.co.nz">Delphi@ns3.123.co.nz</a><br>&gt;&gt; <a href="http://ns3.123.co.nz/mailman/listinfo/delphi">http://ns3.123.co.nz/mailman/listinfo/delphi</a><br>&gt;&gt;<br>&gt;<br><br><br>
--------------------------------------------------------------------------------<br><br><br>&gt; _______________________________________________<br>&gt; Delphi mailing list<br>&gt; <a href="mailto:Delphi@ns3.123.co.nz">Delphi@ns3.123.co.nz
</a><br>&gt; <a href="http://ns3.123.co.nz/mailman/listinfo/delphi">http://ns3.123.co.nz/mailman/listinfo/delphi</a><br>&gt;<br>_______________________________________________<br>Delphi mailing list<br><a href="mailto:Delphi@ns3.123.co.nz">
Delphi@ns3.123.co.nz</a><br><a href="http://ns3.123.co.nz/mailman/listinfo/delphi">http://ns3.123.co.nz/mailman/listinfo/delphi</a><br></blockquote></div><br>