#include-once
#include <GuiRichEdit.au3>
#include <WindowsConstants.au3>
#include <GuiConstants.au3>
#include <GuiConstantsEx.au3>
#include <StaticConstants.au3>
#Include <GUITreeView.au3>
#Include <TreeViewConstants.au3>
#Include <GuiListView.au3>
#Include <ListViewConstants.au3>
#Include <IE.au3>
OnAutoItExitRegister("Error")
_IEErrorHandlerRegister ()
Global $iWidth=1200, $iHeight=800
$hForm = GUICreate('Resize Test', $iWidth, $iHeight+20, -1, -1, BitOR($GUI_SS_DEFAULT_GUI, $WS_THICKFRAME, $WS_OVERLAPPEDWINDOW, $WS_TILEDWINDOW, $WS_TABSTOP));, $WS_EX_COMPOSITED)
GUISetBkColor(0xECE9D8 )
Global $i_yL2=770, $i_wL=$iWidth
$_L0=GUICtrlCreateLabel("", 0, 2 , $i_wL, 2, 0x1000)
$_L1=GUICtrlCreateLabel("", 0, 33 , $i_wL, 2, 0x1000)
$_L2=GUICtrlCreateLabel("", 0, $i_yL2, $i_wL, 2, 0x1000)
Global $i__Y1a=300,$i__Y1b=200, $i__Y1c=100, $i__X3=300,$i__X2=700; Расстояния от нижне-правых границ окна
Global $i_X2=$iWidth-$i__X2, $i_Y2=35 , $i_W2=2 , $i_H2=($iHeight-31)-$i_Y2
Global $i_X3=$iWidth-$i__X3, $i_Y3=35 , $i_W3=2 , $i_H3=($iHeight-31)-$i_Y3
Global $i_X1a=2 , $i_Y1a=$iHeight-$i__Y1a, $i_W1a=($i_X2-1)-$i_X1a , $i_H1a=2
Global $i_X1b=$i_X2+3 , $i_Y1b=$iHeight-$i__Y1b, $i_W1b=($i_X3-1)-$i_X1b , $i_H1b=2
Global $i_X1c=$i_X3+3 , $i_Y1c=$iHeight-$i__Y1c, $i_W1c=($iWidth-2)-$i_X1c, $i_H1c=2
Global $X_Edit1=$i_X1a, $Y_Edit1=$i_Y2 , $W_Edit1=$i_W1a, $H_Edit1=($i_Y1a-1)-$Y_Edit1
Global $X_Edit2=$i_X1a, $Y_Edit2=$i_Y1a+3, $W_Edit2=$i_W1a, $H_Edit2=($i_Y2+$i_H2)-$Y_Edit2
Global $X_oIE1=$i_X1b , $Y_oIE1=$i_Y2 , $W_oIE1=$i_W1b , $H_oIE1=($i_Y1b-3)-$Y_oIE1
Global $X_oIE2=$i_X1b , $Y_oIE2=$i_Y1b+3 , $W_oIE2=$i_W1b , $H_oIE2=($i_Y2+$i_H2)-$Y_oIE2
Global $X_TV=$i_X1c , $Y_TV=$i_Y2 , $W_TV=$i_W1c , $H_TV=($i_Y1c-1)-$Y_TV
Global $X_LV=$i_X1c , $Y_LV=$i_Y1c+3 , $W_LV=$i_W1c , $H_LV=$i_Y2+$i_H2-$Y_LV
$Resizer_Label1a=GUICtrlCreateLabel("", $i_X1a, $i_Y1a, $i_W1a, $i_H1a)
GUICtrlSetBkColor(-1, 0xC0c000)
GUICtrlSetCursor(-1, 11)
$Resizer_Label1b=GUICtrlCreateLabel("", $i_X1b, $i_Y1b, $i_W1b, $i_H1b)
GUICtrlSetBkColor(-1, 0xC0c000)
GUICtrlSetCursor(-1, 11)
$Resizer_Label1c=GUICtrlCreateLabel("", $i_X1c, $i_Y1c, $i_W1c, $i_H1c)
GUICtrlSetBkColor(-1, 0xC0c000)
GUICtrlSetCursor(-1, 11)
$Resizer_Label2=GUICtrlCreateLabel("", $i_X2, $i_Y2, $i_W2, $i_H2)
GUICtrlSetBkColor(-1, 0xC0c000)
GUICtrlSetCursor(-1, 13)
$Resizer_Label3=GUICtrlCreateLabel("", $i_X3,$i_Y3,$i_W3,$i_H3)
GUICtrlSetBkColor(-1, 0xC0c000)
GUICtrlSetCursor(-1, 13)
$hEdit1 = _GUICtrlRichEdit_Create($hForm,'Edit1', $X_Edit1, $Y_Edit1, $W_Edit1, $H_Edit1)
_GUICtrlRichEdit_SetBkColor($hEdit1,0xffffC0)
;ControlHide ( "", "",$hEdit1 )
$hEdit2 = _GUICtrlRichEdit_Create($hForm,'Edit2',$X_Edit2, $Y_Edit2, $W_Edit2, $H_Edit2)
_GUICtrlRichEdit_SetBkColor($hEdit2,0xffffC0)
;ControlHide ( "", "",$hEdit2 )
$oIE1 = ObjCreate("Shell.Explorer.2")
$GUIActiveX1 = GUICtrlCreateObj($oIE1, $X_oIE1, $Y_oIE1, $W_oIE1, $H_oIE1)
$oIE1.navigate("file://C:\")
;GUICtrlSetState ( -1, $GUI_HIDE )
$oIE2 = _IECreateEmbedded ()
$GUIActiveX2 = GUICtrlCreateObj($oIE2, $X_oIE2, $Y_oIE2, $W_oIE2, $H_oIE2)
_IENavigate ($oIE2, "C:\WINDOWS\Web\Wallpaper\Chip_Wallpapers (32).jpg")
;GUICtrlSetState ( -1, $GUI_HIDE )
$hTreeView=_GUICtrlTreeView_Create($hForm,$X_TV, $Y_TV, $W_TV, $H_TV,-1,$WS_EX_CLIENTEDGE)
_GUICtrlTreeView_SetBkColor($hTreeView, 0xC0ffff)
;ControlHide ( "", "",$hTreeView )
$hListView=_GUICtrlListView_Create($hForm," FileName | Path ",$X_LV, $Y_LV, $W_LV, $H_LV,-1,$WS_EX_CLIENTEDGE)
_GUICtrlListView_SetBkColor($hListView, 0xffffC0)
_GUICtrlListView_SetTextBkColor($hListView, 0xffffC0)
;ControlHide ( "", "",$hListView )
GUIRegisterMsg($WM_SIZE, "WM_SIZE")
GUISetState()
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
GUIDelete()
Exit
Case $Resizer_Label1a To $Resizer_Label3
GetLabelInfo($nMsg);===>
EndSwitch
WEnd
Func GetLabelInfo($Label)
GUICtrlSetBkColor($Label, 0x0000C0)
$aGUI_Pos = WinGetPos($hForm)
$aClient=WinGetClientSize($hForm)
$aCur_Info = GUIGetCursorInfo($hForm)
$aID_Pos = ControlGetPos($hForm, '', $Label)
$dd= $aID_Pos[0]-$aCur_Info[0]
While $aCur_Info[2]=1
Sleep(10)
$aCur_Info = GUIGetCursorInfo($hForm)
$aCur_Info[0]+=$dd
If $aCur_Info[1]< 50 Then Return
If $aCur_Info[1]>$aClient[1] -73 Then Return
Switch $Label
Case $Resizer_Label1a
$i_Y1a=$aCur_Info[1];-2
$i__Y1a=$aClient[1]-$aCur_Info[1]
Case $Resizer_Label1b
$i_Y1b=$aCur_Info[1]
$i__Y1b=$aClient[1]-$aCur_Info[1]
Case $Resizer_Label1c
$i_Y1c=$aCur_Info[1];-2
$i__Y1c=$aClient[1]-$aCur_Info[1]
Case $Resizer_Label2
If $aCur_Info[0]<10 Then Return
If $aCur_Info[0]>$i_X3 -20 Then Return
$i_X2=$aCur_Info[0];-2
$i__X2=$aClient[0]-$aCur_Info[0]
$i_W1a=$aCur_Info[0]-2-$i_X1a
$i_X1b=$aCur_Info[0]+3
$i_W1b=$i__X2-$i__X3-4
Case $Resizer_Label3
If $aCur_Info[0]<$i_X2 +20 Then Return
If $aCur_Info[0]>$aClient[0]-20 Then Return
$i_X3=$aCur_Info[0];-2
$i__X3=$aClient[0]-$aCur_Info[0]
$i_W1b=$aCur_Info[0]-1-$i_X1B
$i_X1c=$aCur_Info[0]+3
$i_W1c=$aClient[0]-2-($i_X3+3)
EndSwitch
MoveLabels(); ===>
MoveControls()
WEnd
WinMove ( $hForm, "", $aGUI_Pos[0], $aGUI_Pos[1], $aGUI_Pos[2]-10, $aGUI_Pos[3]); Искусственное устранение возбуждения GUIActiveX
WinMove ( $hForm, "", $aGUI_Pos[0], $aGUI_Pos[1], $aGUI_Pos[2] , $aGUI_Pos[3])
GUICtrlSetBkColor($Label, 0xC00000)
EndFunc
Func MoveLabels()
GUICtrlSetPos($Resizer_Label1a, $i_X1a, $i_Y1a, $i_W1a, $i_H1a)
GUICtrlSetPos($Resizer_Label1b, $i_X1b, $i_Y1b, $i_W1b, $i_H1b)
GUICtrlSetPos($Resizer_Label1c, $i_X1c, $i_Y1c, $i_W1c, $i_H1c)
GUICtrlSetPos($Resizer_Label2 , $i_X2 , $i_Y2 , $i_W2 , $i_H2)
GUICtrlSetPos($Resizer_Label3 , $i_X3 , $i_Y3 , $i_W3 , $i_H3)
GUICtrlSetPos($_L0, 0, 2 , $i_wL, 2)
GUICtrlSetPos($_L1, 0, 33 , $i_wL, 2)
GUICtrlSetPos($_L2, 0, $i_yL2, $i_wL, 2)
EndFunc
Func MoveControls()
WinMove($hEdit1, '' , $i_X1a, $i_Y2 , $i_W1a, ($i_Y1a-1)-$i_Y2)
WinMove($hEdit2, '' , $i_X1a, $i_Y1a+3, $i_W1a, ($i_Y2+$i_H2)-($i_Y1a+3))
GUICtrlSetPos($GUIActiveX1, $i_X1b, $i_Y2 , $i_W1b, ($i_Y1b-1)-$i_Y2)
GUICtrlSetPos($GUIActiveX2, $i_X1b, $i_Y1b+3, $i_W1b, ($i_Y2+$i_H2)-($i_Y1b+3))
WinMove($hTreeView, '' , $i_X1c, $i_Y2 , $i_W1c, ($i_Y1c-1)-$i_Y2)
WinMove($hListView, '' , $i_X1c, $i_Y1c+3, $i_W1c, ($i_Y2+$i_H2)-($i_Y1c+3))
EndFunc
Func WM_SIZE($hWnd, $iMsg, $wParam, $lParam)
Local $WC, $HC, $WT, $HT
Switch $hWnd
Case $hForm
$WC = _WinAPI_LoWord($lParam)
$HC = _WinAPI_HiWord($lParam)
; $Resizer_Label3
$i_X3=($WC)-$i__X3
$i_Y3=35
$i_H3=($HC-53)-$i_Y3
; $Resizer_Label2
$i_X2=($WC)-$i__X2
If $i_X2 <10 Then $i_X2=10 ; Добавлено
$i_Y2=35
$i_H2=($HC-53)-$i_Y2
; $Resizer_Label1a
$i_Y1a=($HC-20)-$i__Y1a
$i_W1a=$i_X2-1
If $i_Y1a <10 Then $i_Y1a=70 ; Добавлено
; $Resizer_Label1b
$i_X1b=$i_X2+3
$i_Y1b=($HC-20)-$i__Y1b
If $i_Y1b <10 Then $i_Y1b=70 ; Добавлено
; $Resizer_Label1c
$i_X1c=$i_X3+3
$i_Y1c=($HC-20)-$i__Y1c
If $i_Y1c <10 Then $i_Y1c=70 ; Добавлено
; $_L0 , $_L1, $_L2
$i_yL2=($HC-53)
$i_wL=$WC
MoveLabels()
MoveControls()
Return 0
EndSwitch
Return $GUI_RUNDEFMSG
EndFunc ;==>WM_SIZE
Func Error()
GUIDelete()
EndFunc