Borje Posted January 14, 2017 Share Posted January 14, 2017 HI all Is that possible to have the FileSelectFolder comes up in the center of screen? What commands I must use? also change the position's Now it is popup in upper left corner that is standard i think Link to comment Share on other sites More sharing options...
careca Posted January 14, 2017 Share Posted January 14, 2017 (edited) Hi, you can winmove to move that window to where you want, and you can use a udf like melba23's, that allows you to set the coordinates directly. EDIT: on second thought, i think fileselectfolder stops the script, like winwait or msgbox, so winmove wouldn't be able to move the window, unless it's running in a loop outside of the function where select folder is. Edited January 14, 2017 by careca Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 14, 2017 Moderators Share Posted January 14, 2017 careca, As that function is blocking, how do you intend to move it from within the script? There is a way, but it is not that simple. Borje, As you might expect, I second the vote for my UDF. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
careca Posted January 14, 2017 Share Posted January 14, 2017 Yeah, it blocks either way. :\ Maybe with AdlibRegister and checking for the window, and move it if exists.. Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe Link to comment Share on other sites More sharing options...
Borje Posted January 14, 2017 Author Share Posted January 14, 2017 Thanks Melba23 and careca for your answers but I not know how I use the winmove have you som examles ? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 14, 2017 Moderators Share Posted January 14, 2017 Borje, You cannot WinMove the FileSelectFolder dialog from within your script - at least not without getting into some very complicated /AutoIt3ExecuteScript stuff, which I would not recommend. As both of us suggested, if you really want a controllable dialog in terms of position and size then take a look at my UDF - that is one of the reasons I wrote it! M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
careca Posted January 14, 2017 Share Posted January 14, 2017 I had the impression your udf had a folder select like the regular one, instead of treeview. TBH im not a big fan of treeview, is there something like the OP wants, that allows selection, with the "normal" icon view, and window position customizable? Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe Link to comment Share on other sites More sharing options...
mikell Posted January 14, 2017 Share Posted January 14, 2017 (edited) This works for me Based on a script from funkey (initially used to manage a msgbox) expandcollapse popup#include <GUIConstantsEx.au3> #include <WinAPI.au3> Global $fsfX = 800 Global $fsfY = 200 Global $hHookFsF $gui = GuiCreate("test", 200, 100) $btn = GuiCtrlCreateButton("test", 50, 30, 50, 25) GuiSetState() While 1 $msg = GuiGetMsg() Switch $msg Case $GUI_EVENT_CLOSE Exit Case $btn $sFileSelectFolder = _FileSelectFolder("test", "") If $sFileSelectFolder = "" Then MsgBox(0, "", "No folder was selected.") Else MsgBox(0, "", "You chose the following folder:" & @CRLF & $sFileSelectFolder) EndIf EndSwitch Wend Func _FileSelectFolder($dialog, $rootdir, $flag = 0, $initdir = "", $hwnd = 0) Local $hProcFsF = DllCallbackRegister("CbtHookProcFsF", "int", "int;int;int") Local $TIDFsF = _WinAPI_GetCurrentThreadId() $hHookFsF = _WinAPI_SetWindowsHookEx($WH_CBT, DllCallbackGetPtr($hProcFsF), 0, $TIDFsF) Local $iRet = FileSelectFolder($dialog, $rootdir, $flag, $initdir, $hwnd) _WinAPI_UnhookWindowsHookEx($hHookFsF) DllCallbackFree($hProcFsF) Return $iRet EndFunc Func CbtHookProcFsF($nCode, $wParam, $lParam) Local $RET = 0 If $nCode < 0 Then $RET = _WinAPI_CallNextHookEx($hHookFsF, $nCode, $wParam, $lParam) Return $RET EndIf Switch $nCode Case 5 ;5=HCBT_ACTIVATE If $wParam <> $gui Then _WinAPI_SetWindowPos($wParam, $HWND_TOP, $fsfX, $fsfY, _ _WinAPI_GetWindowWidth($wParam), _WinAPI_GetWindowHeight($wParam), $SWP_NOZORDER) EndSwitch Return EndFunc ;==>CbtHookProcFsF Edited January 15, 2017 by mikell Link to comment Share on other sites More sharing options...
Bowmore Posted January 14, 2017 Share Posted January 14, 2017 @Mikell Looks like you made a typo. $hHookFsF is use in function CbtHookProcFsF but not declared. It's declared in _FileSelectFolder as Local but needs to be Global. "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook Link to comment Share on other sites More sharing options...
careca Posted January 15, 2017 Share Posted January 15, 2017 (edited) I made a kind of a workaround, just for fun. First part is a compiled exe that accepts parameters, called right before the fileselectfolder, and timeouts after 3 secs. Local $begin = TimerInit() Local $dif Do $dif = TimerDiff($begin) If WinExists($CmdLine[1]) Then WinMove($CmdLine[1],$CmdLine[2], $CmdLine[3], $CmdLine[4], $CmdLine[5], $CmdLine[6]) EndIf Sleep(100) Until $dif >= 3000 Second is the script, that passes parameters, title, text, coordinates, size. $Title = 'SelectTest' $Text = '""' $X = 500 $Y = 500 $XSize = 800 $YSize = 400 Go() Func Go() ShellExecute('MoveDlg.exe', $Title&' '&$Text&' '&$X&' '&$Y&' '&$XSize&' '&$YSize) Local $Select = FileSelectFolder('SelectTest', '', 0, '') Exit EndFunc While 1 Sleep(100) WEnd So if the user has the compiled script somewhere and calls it this way, with these parameters, the window gets re-positioned and re-sized as desired. To ignore the re-size its just a matter of replacing the number with '""' double quotes, inside quotes, can't have spaces. Edited January 15, 2017 by careca Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe Link to comment Share on other sites More sharing options...
mikell Posted January 15, 2017 Share Posted January 15, 2017 @Bowmore Good point. post #8 edited Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 15, 2017 Moderators Share Posted January 15, 2017 careca, That is essentially the /AutoIt3ExecuteScript method I mentioned - you need to run something outside the main script, either compiled or as another script. mikell, Very clever. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Borje Posted January 15, 2017 Author Share Posted January 15, 2017 Thanks all for the tips and examples it works perfect now I am supriced you is so helpful I have to study this examples from the members of this forum... 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