bman Posted June 9, 2004 Share Posted June 9, 2004 Is there a way to make it so that the FileOpenDialog shows up with an "always on top" attribute? Also, is there a way to make the FileOpenDialog time out? Link to comment Share on other sites More sharing options...
pekster Posted June 9, 2004 Share Posted June 9, 2004 Is there a way to make it so that the FileOpenDialog shows up with an "always on top" attribute?Also, is there a way to make the FileOpenDialog time out?Since the main script is paused while this window is open, you can't do it from the same script. However, I have done this using a 2nd script. You could FileInstall it if you don't want it to appear like you have 2 scripts to the end user. Right before you hit the FileOpenDialog call, you call your 2nd script. That 2nd script will: wait for the dialog to appear, start a timer, and loop to check the timer, and check if the window is not on top. If it is no longer on top, bring it back, and if the time is out, close the window. [font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes. Link to comment Share on other sites More sharing options...
bman Posted June 9, 2004 Author Share Posted June 9, 2004 thanks man, worked like a charm... Opt("WinTitleMatchMode", 2) WinWait ("Choose File", "Look &in:") WinSetOnTop ( "Choose File", "Look &in:", 1) Link to comment Share on other sites More sharing options...
bman Posted June 9, 2004 Author Share Posted June 9, 2004 (edited) I found a pretty cool way to do it without the extra file too... If $CmdLine[0] > 0 Then If $CmdLine[1] = "ontop" Then AutoItWinSetTitle("AutoIT ONTOP") WinWait ("Choose File", "Look &in:", 5000) WinSetOnTop ( "Choose File", "Look &in:", 1) Exit EndIf EndIf ;other script steps go here Run("filename.exe ontop") $imagename = FileOpenDialog("Choose File", "C:\Windows\", "Images (*.jpg)", 1 + 2 ) ;other script steps go here Edited June 9, 2004 by bman Link to comment Share on other sites More sharing options...
SlimShady Posted June 9, 2004 Share Posted June 9, 2004 The script runs itself again with a command line option, to set the window of the existing script on top, right? That works too. Even better than FileInstall. Link to comment Share on other sites More sharing options...
bman Posted June 9, 2004 Author Share Posted June 9, 2004 yes.. that is exactly what it does.. runs itself again... Link to comment Share on other sites More sharing options...
CyberSlug Posted June 9, 2004 Share Posted June 9, 2004 Genius! I had to tweak it a little to work for me, Win XP Pro AutoIt 3.0.102 (June 4th?)--and this should also work for uncompiled scripts if you installed AutoIt with an installer. $fileOpenDialogTitle = "Choose File" If $CmdLine[0] > 0 Then If $CmdLine[1] = "ontop" Then WinWait ($fileOpenDialogTitle, "", 5000) WinActivate($fileOpenDialogTitle, "") WinSetOnTop ($fileOpenDialogTitle, "", 1) Exit EndIf EndIf ;other script steps go here If @Compiled Then Run('"' & @ScriptName & '" ontop') Else $AUTOIT = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\HiddenSoft\AutoIt3","InstallDir") & "\AutoIt3.exe" Run('"' & $AUTOIT & '" ' & @ScriptName & ' ontop') EndIf $imagename = FileOpenDialog($fileOpenDialogTitle, "C:\Windows\", "Images (*.jpg)", 1 + 2 ) ;other script steps go here Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! 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