Jump to content

FileOpenDialog position


Recommended Posts

Hi,

is there a way FileOpenDialog (and FileSaveDialog) to open some place else as always top left?

Thanks for any hint.

you could make your own open/save dialog and display anywhere, or i think you could do it with dll calls, but probably the easiest way would be an adlib function that looks for the presence of your open/save dialog and uses WinMove() to put it wherever you like.
Link to comment
Share on other sites

Hello,

A quick and dirty work around would be something along these lines. (Un-tested)

$title = "Some Unique Title/Text"
$fileOpen = FileOpenDialog($title, "C:\Windows", "All Files (*.*)")
WinSetState($title, "", @SW_HIDE)
WinMove($title, "", 0, 0)
WinSetState($title, "", @SW_SHOW)

That is a horrible work around if it works, but the only one I can think of at the moment.

JS

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Link to comment
Share on other sites

Hello,

A quick and dirty work around would be something along these lines. (Un-tested)

$title = "Some Unique Title/Text"
$fileOpen = FileOpenDialog($title, "C:\Windows", "All Files (*.*)")
WinSetState($title, "", @SW_HIDE)
WinMove($title, "", 0, 0)
WinSetState($title, "", @SW_SHOW)

That is a horrible work around if it works, but the only one I can think of at the moment.

JS

i don't think that it will work JS, juts because the state and movement won't happen as execution is paused at the fileopendialog. that's why i suggested the adlib function to do the same thing.
Link to comment
Share on other sites

try this....

$Title= "Select file"

_Move($Title)

$file = FileOpenDialog($Title, @scriptdir, "(*.*)", 1,"")

Func _Move($Title)

FileDelete(@TempDir & "\Dummy.txt")

FileWrite(@TempDir & '\Dummy.txt','#NoTrayIcon' & @crlf & _

'AutoItSetOption("RunErrorsFatal",0)' & @crlf & _

'Opt("WinWaitDelay",0)' & @crlf & _

'WinWait($cmdline,"")' & @crlf & _

'WinMove($cmdline,"",@DesktopWidth/2-281,@DeskTopHeight/2-206)' & @crlf & _

'FileDelete(@TempDir & "\Dummy.txt")')

Run(@AutoItExe & ' /AutoIt3ExecuteScript ' & @TempDir & '\Dummy.txt "' & $Title & '"')

EndFunc

FileOpenDialog_position_test.au3

Edited by Rick

Who needs puzzles when we have AutoIt!!

Link to comment
Share on other sites

i don't think that it will work JS, juts because the state and movement won't happen as execution is paused at the fileopendialog. that's why i suggested the adlib function to do the same thing.

We posted at basically the same time. :whistle: I didnt even think of the script pausing there.

JS

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Link to comment
Share on other sites

Thanks to all who suggested solutions. The easy solution unfortunately doesn't work (The FileOpenDialog pauses the script!). The solution calling a second instance of Autoit works fine, but is quite complicated and insecure(circle!). As centering the Dialog is rather cosmetic and my project is for use by myself, I'll leave the Dialog in the corner. Thanks anyhow.

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...