Jump to content

Recommended Posts

Posted

Hi all,

Just little question for fun,

It is possible to center dialogbox to the screen with function "FileOpenDialog" or "FileSaveDialog"

tks,

fuzzz

Posted

Hi,

search for FileDialogsEx.au3 it works.

Mega

P.S.: Or do a WinMove

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Posted

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Posted

Not found on this include ... nothing for center dialog window. :)

an other idea?

Try this by /dev/nul :_MoveFileOpenDialog()
Posted (edited)

Hi,

I did this:

#include<WinAPI.au3>
#include<WindowsConstants.au3>
#include<FileDialogsEx.au3>
;    _FileDialogsEx.au3 example #1:
;    create big resizeable file open dialog, defaulting to thumbnails view
;     demonstrates how to set size/position of dialog window, how to set default view mode for listview.

Global $f_CDN_Start = 1

$Return = _FileOpenDialogEx("Open picture", @WindowsDir & "\Web\Wallpaper", "All Files (*.*)", BitOR($OFN_ENABLESIZING,$OFN_ALLOWMULTISELECT), "", 0, "_OFN_HookProc")
If @error Then
    ConsoleWrite('No file selected.' & @CRLF)
Else
    ConsoleWrite($Return & @CRLF)
EndIf

Func _OFN_HookProc($hWnd, $Msg, $wParam, $lParam)
    Switch $Msg
        Case $WM_NOTIFY
            Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR
            $tNMHDR = DllStructCreate("hwnd hWndFrom;int idFrom;int code", $lParam)
            $hWndFrom = DllStructGetData($tNMHDR, "hWndFrom")
            $iIDFrom = DllStructGetData($tNMHDR, "idFrom")
            $iCode = DllStructGetData($tNMHDR, "code")
            Switch $iCode
                Case $CDN_INITDONE
                Case $CDN_FOLDERCHANGE
                    If $f_CDN_Start Then;if executing first time
                        Local $hODLV = _FindWindowEx($hWndFrom, 0, "SHELLDLL_DefView", "")
                        If $hODLV <> 0 Then
                            DllCall('user32.dll','int','SendMessage','hwnd',$hODLV,'uint',$WM_COMMAND,'wparam',$ODM_VIEW_THUMBS,'lparam',0)
                        EndIf
                        WinMove($hWndFrom, "", 100,100, 800,600, 0) ; CHANGE!!! HERE!!!
                        $f_CDN_Start = 0;to make sure these tweaks happens only once.
                    EndIf
                Case $CDN_SELCHANGE
                Case $CDN_FILEOK
            EndSwitch
        Case Else
    EndSwitch
EndFunc
Func _FindWindowEx($hWndParent,$hWndChildAfter,$sClassName,$sWinTitle="")
    Local $aRet = DllCall('user32.dll','hwnd','FindWindowEx', 'hwnd', $hWndParent,'hwnd',$hWndChildAfter,'str',$sClassName,'str',$sWinTitle)
    If $aRet[0] = 0 Then ConsoleWrite('_FindWindowEx() Error : ' & _WinAPI_GetLastErrorMessage())
    Return $aRet[0]
EndFunc
Exit

Look at : WinMove($hWndFrom, "", 100,100, 800,600, 0) ; CHANGE!!! HERE!!!

Mega

Edited by Xenobiologist

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

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