Jump to content

FileOpenDialog() not coming to front...


Recommended Posts

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 :idiot:

Link to comment
Share on other sites

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  :idiot:

<{POST_SNAPBACK}>

You can try the WinSetOnTop function. Check the helpfile.
Link to comment
Share on other sites

You can try the WinSetOnTop function. Check the helpfile.

<{POST_SNAPBACK}>

Gave it a shot, no go. :D

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 :idiot:

Link to comment
Share on other sites

Gave it a shot, no go.  :lol:

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  :D

<{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 :idiot:

Link to comment
Share on other sites

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 by Helge
Link to comment
Share on other sites

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 problem

that are hidden in this forum.. Check this out... Hmmm...does it work for your problem anyway ? :idiot:

Edited by Helge
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...