View Full Version : Showing downloaded file on top of other windows.
rohit.khambe
06-30-2008, 06:08 AM
HI, I'm using TU to d/w a VB exe. Once the exe is d/w, I run the new exe so that it sits at the login prompt. My problem is that when TU calls the exe, it sits behind other windows. If I just double-click my app directly it is in front.
After d/w, Im calling the File.Run action with the SW_SHOWNORMAL parameter. Is there any way I can keep the called exe on top.
Thanks
Rohit
upeters
06-30-2008, 08:13 AM
There are at least two possibilities.
The first one would be to modify your VB application to have it set the login window as the topmost window on startup. This is very easy, and how-tos can be found online (http://support.microsoft.com/kb/q184297/).
The other way would be to instruct TrueUpdate to set your application as the topmost window. This can be done in the following way:
Start your updated VB application with File.Run (with the last parameter set to false (WaitForReturn) or else your script will stop at this point);
Once File.Run() started up your application, begin to monitor the windows with a loop, checking all top level windows of your desktop, with Window.EnumerateTitles() until your application becomes available on the desktop and you get a handle to your application's window;
After you got the handle to the window of your application, set it as the topmost window using Window.SetOrder();
Finally, once you have changed the z-order, you can break out of the loop and finish/continue the update process.
Ulrich
rohit.khambe
06-30-2008, 10:15 PM
Thanks Ulrich. The second solution works perfect.
First solution can be applied only if the window is already displayed. Here I'm talking about a login form which has to be shown modally. (ofcourse I could've used a timer etc). But the second solution is what I was looking for.
Cheers,
Rohit
vBulletin® v3.7.3, Copyright ©2000-2009, Jelsoft Enterprises Ltd.