Just_Plain_Cool Posted January 12, 2005 Share 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 Link to comment Share on other sites More sharing options...
closeupman Posted January 12, 2005 Share 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. Link to comment Share on other sites More sharing options...
Just_Plain_Cool Posted January 12, 2005 Author Share 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 Link to comment Share on other sites More sharing options...
closeupman Posted January 12, 2005 Share 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 Link to comment Share on other sites More sharing options...
Helge Posted January 12, 2005 Share 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 Link to comment Share on other sites More sharing options...
Helge Posted January 12, 2005 Share 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 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now