Just_Plain_Cool 0 Posted January 12, 2005 Hi all, Have written a script file that automates the interaction between three programs. The one common thread in all of them is a MicroSoft Word file. When the script starts up, it checks if the necessary programs are running and if not, it runs them. Then it uses "FileOpenDialog" to get the name of the Word file to use. However, the FileOpenDialog window keeps opening behind other windows. Is there a way to force the FileOpenDialog window to open as the topmost window? Thanks, JPC Share this post Link to post Share on other sites
closeupman 0 Posted January 12, 2005 Hi all,Have written a script file that automates the interaction between three programs. The one common thread in all of them is a MicroSoft Word file. When the script starts up, it checks if the necessary programs are running and if not, it runs them. Then it uses "FileOpenDialog" to get the name of the Word file to use. However, the FileOpenDialog window keeps opening behind other windows. Is there a way to force the FileOpenDialog window to open as the topmost window?Thanks,JPC <{POST_SNAPBACK}>You can try the WinSetOnTop function. Check the helpfile. Share this post Link to post Share on other sites
Just_Plain_Cool 0 Posted January 12, 2005 You can try the WinSetOnTop function. Check the helpfile.<{POST_SNAPBACK}>Gave it a shot, no go. If I put WinSetOnTop before the FileOpenDialog command, there is no window for it to set the attribute on. If I put it after the FileOpenDialog command, then WinSetOnTop is not executed until after the FileOpenDialog is closed...Thanks for the reply,JPC Share this post Link to post Share on other sites
closeupman 0 Posted January 12, 2005 Gave it a shot, no go. If I put WinSetOnTop before the FileOpenDialog command, there is no window for it to set the attribute on. If I put it after the FileOpenDialog command, then WinSetOnTop is not executed until after the FileOpenDialog is closed...Thanks for the reply,JPC <{POST_SNAPBACK}>Ya...saw that now....cuz it's a windows creation, not a GUI u created.....only other thing I can think of is to 1st hide the other windows(or minimize them), then do the FileOpenDialog...then unhide(unminizing) after the choice.....I'm sure others here can give you better choices...but that's my 2 cents Share this post Link to post Share on other sites
Helge 3 Posted January 12, 2005 (edited) Compile and run this (Untested but it SHOULD work !!) :If $CMDLine[0] > 1 AND $CMDLine[1] = "-max" Then WinWait("text here") WinActivate("text here") Exit Endif Run(@ScriptDir & " -max",@ScriptDir) Sleep(1000); Waits for secondary script to start... FileOpenDialog("text here", "C:\Windows\", "BP-playlists (*.bpl)") ;script continues....Good luck ! Edited January 12, 2005 by Helge Share this post Link to post Share on other sites
Helge 3 Posted January 12, 2005 (edited) I changed my last post...I added a Sleep after the Run-command...Yes, and I know that it could result in failure in some situations but it's just an example..Edit :I searched the forum, and I found one of the many solutions to your problemthat are hidden in this forum.. Check this out... Hmmm...does it work for your problem anyway ? Edited January 12, 2005 by Helge Share this post Link to post Share on other sites