<div>with SetForegroundwindow ?<br><br> </div>
<div><span class="gmail_quote">On 30/05/06, <b class="gmail_sendername">Dennis Chuah</b> <<a href="mailto:dennis_cs_chuah@hotmail.com">dennis_cs_chuah@hotmail.com</a>> 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. 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: "Paul A Norman" <<a href="mailto:paul.a.norman@gmail.com">paul.a.norman@gmail.com</a>><br>Sent: Tuesday, May 30, 2006 2:32 PM
<br><br><br>> What about SW_RESTORE ?<br>><br>> Peter Below's bigger solution to this in his posting suggests this can<br>> give<br>> all sorts of control overn such a prog.<br>><br>> "The other option is to use CreateProcess to start the program. That gives
<br>> you (among other goodies) the threadID of the programs main thread. Which<br>> you can then use with EnumThreadWindows to find the window(s) of that<br>> 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>> <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>> newsgroups for the API functions mentioned above for examples. "<br>><br>><br>> On 30/05/06, Phil Scadden <<a href="mailto:p.scadden@gns.cri.nz">p.scadden@gns.cri.nz</a>> wrote:
<br>>><br>>> Having some fun with Shellexecute. I am using it from my program to<br>>> get another application open one of its documents. No problem there.<br>>> However, if the application is ALREADY running, then the document
<br>>> is opened within the existing application. Hmm. Not so good but no<br>>> real problem. Now the real problem. If the application is covered by<br>>> another<br>>> window, this it is not brought to top and its not obvious that the
<br>>> document<br>>> has been opened all. It looks like my application is not doing its job.<br>>><br>>> I am calling shellexecute with shownormal. Any way to force the<br>>> application<br>
>> to the top short of scanning the process list or findwindow and calling<br>>> setwindowpos on that instance?<br>>><br>>> ----------------------------------------------------------<br>>> Phil Scadden, Institute of Geological and Nuclear Sciences
<br>>> 764 Cumberland St, Private Bag 1930, Dunedin, New Zealand<br>>> Ph +64 3 4799663, fax +64 3 477 5232<br>>><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>>><br>><br><br><br>
--------------------------------------------------------------------------------<br><br><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>><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>