Jump to content
ripdad

WinMove FileOpenDialog - (Solved)

Recommended Posts

Posted (edited)

Is there some way to WinMove a FileOpenDialog without using some external helper function?

 

Edited by ripdad

"The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward

Share this post


Link to post
Share on other sites

Thanks for the tip.

I did searched the forum -- but did not come up with anything remotely what I needed for FileOpenDialog.

Anyways, you have a link?

 


"The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward

Share this post


Link to post
Share on other sites

Well, what I was hoping for was perhaps FileOpenDialog embedded in a GUI, and then move the GUI -- If it was possible.

I made an external helper script that does the job nicely, but was trying to avoid using it.

 


"The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward

Share this post


Link to post
Share on other sites

Not possible as this function is synchronous.   Either you rewrite the OpenDialog for your own good (GUI mode), or use a Run single line of code, and receive result thru IPC (this could be as simple as a StdoutRead).

Share this post


Link to post
Share on other sites

Nine,

Okay thanks.  I appreciate it.

 


"The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward

Share this post


Link to post
Share on other sites
Posted (edited)

This is what I came up with after I found a way on the forum here:

https://www.autoitscript.com/forum/topic/181491-question-about-autoit3executeline/?do=findComment&comment=1303207

Works very nice:

Local $sCmd = '"Local $d1 = WinWait(""Open "", """"), $d2 = WinMove(WinGetHandle(""Open ""), """", 400, 1)"'
Run(@AutoItExe & ' /AutoIt3ExecuteLine ' & $sCmd)

You might have to adjust it a bit for your needs at:  ""Open "" and the coordinates.

 

Edited by ripdad

"The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward

Share this post


Link to post
Share on other sites
Posted (edited)

Here is a example using GUICreate.  

#include <Constants.au3>
#include <WindowsConstants.au3>

;~ Global $hWnd = GUICreate("", -1, -1, 50, 50, $WS_POPUP) ;Left = 50, Top = 50
Global $hWnd = GUICreate("", -1, -1, @DesktopWidth / 4, @DesktopHeight / 4, $WS_POPUP) ;Centered

Global $sFilePath = FileOpenDialog("", "", "CSV (*.csv)|Images (*.jpg;*.bmp)|Videos (*.avi;*.mpg)", $FD_FILEMUSTEXIST, "", $hWnd)
If @error Then Exit

GUIDelete($hWnd)

ConsoleWrite(@CRLF & $sFilePath & @CRLF & @CRLF)

 

Adam

 

Edited by AdamUL

Share this post


Link to post
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

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...