ViSiToR
Silver Member | Редактировать | Профиль | Сообщение | ICQ | Цитировать | Сообщить модератору madmasles 22:04 16-11-2011 Цитата: А можно и так: Код: #include <GUIConstantsEx.au3> Global $a_FileOpenDialog_Move_Data[6] $hGUI = GUICreate("Parent GUI") GUISetState() _FileOpenDialog("_FileOpenDialogEx Example", "", "All (*.*)", 0, "", $hGUI, 0, 0) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func _FileOpenDialog($sTitle, $sInitDir, $sFilter, $iOpts = 0, $sDefName = "", $hWnd = Default, $iLeft = Default, $iTop = Default) $a_FileOpenDialog_Move_Data[0] = $sTitle ;If ($iLeft <> -1 And $iLeft <> Default) Or ($iTop <> -1 And $iTop <> Default) Then Local $h_CallBack_Proc = DllCallbackRegister("__FileOpenDialog_Move_Handler", "none", "hwnd;int;int;dword") Local $a_hTimer = DllCall("user32.dll", "int", "SetTimer", _ "hwnd", 0, _ ;$hWnd "int", TimerInit(), _ "int", 0, _ ;$iTime "ptr", DllCallbackGetPtr($h_CallBack_Proc)) $a_FileOpenDialog_Move_Data[1] = $h_CallBack_Proc $a_FileOpenDialog_Move_Data[2] = $a_hTimer[0] $a_FileOpenDialog_Move_Data[3] = $iLeft $a_FileOpenDialog_Move_Data[4] = $iTop $a_FileOpenDialog_Move_Data[5] = $hWnd ;EndIf Return FileOpenDialog($sTitle, $sInitDir, $sFilter, $iOpts, $sDefName, $hWnd) EndFunc Func __FileOpenDialog_Move_Handler($hWnd, $nMsg, $iIDTimer, $dwTime) If $a_FileOpenDialog_Move_Data[1] > 0 Then DllCallBackFree($a_FileOpenDialog_Move_Data[1]) DllCall("user32.dll", "int", "KillTimer", "hwnd", 0, "int", $a_FileOpenDialog_Move_Data[2]) Local $iOld_Opt_WWD = Opt("WinWaitDelay", 0) Local $iLeft = $a_FileOpenDialog_Move_Data[3] Local $iTop = $a_FileOpenDialog_Move_Data[4] WinWait("[CLASS:#32770;TITLE:" & $a_FileOpenDialog_Move_Data[0] & "]") If ($iLeft <> -1 And $iLeft <> Default) Or ($iTop <> -1 And $iTop <> Default) Then WinMove("[CLASS:#32770;TITLE:" & $a_FileOpenDialog_Move_Data[0] & "]", "", $iLeft, $iTop) ElseIf IsHWnd($a_FileOpenDialog_Move_Data[5]) Then Local $aParent_Pos = WinGetPos($a_FileOpenDialog_Move_Data[5]) Local $aMB_Pos = WinGetPos("[CLASS:#32770;TITLE:" & $a_FileOpenDialog_Move_Data[0] & "]") $iX_Pos = $aParent_Pos[0] + ($aParent_Pos[2]/2) - ($aMB_Pos[2] / 2) $iY_Pos = $aParent_Pos[1] + ($aParent_Pos[3]/2) - ($aMB_Pos[3] / 2) WinMove("[CLASS:#32770;TITLE:" & $a_FileOpenDialog_Move_Data[0] & "]", "", $iX_Pos, $iY_Pos) EndIf Opt("WinWaitDelay", $iOld_Opt_WWD) $a_FileOpenDialog_Move_Data[0] = 0 $a_FileOpenDialog_Move_Data[1] = 0 $a_FileOpenDialog_Move_Data[2] = 0 $a_FileOpenDialog_Move_Data[3] = 0 $a_FileOpenDialog_Move_Data[4] = 0 $a_FileOpenDialog_Move_Data[5] = 0 EndFunc |
---------- ViSiToR a.k.a CreatoR CreatoR это не ник, CreatoR это стиль жизни! |
|