Je viens vers vous pour m'aider à optimiser ma StatusBar.
Je souhaiterai caresser l’espoir de pouvoir redimensionner ($WS_SIZEBOX) ma Gui proprement et avec fluidité (GUIRegisterMsg)
Malheureusement je n'y arrive pas et c'est pas faute d'avoir cherché sur la toile, je n'ai rien trouvé (de fonctionnel).
Je sais que çà se joue à pas grand chose mais là je sèche
Pouvez-vous m'aider, merci.
Code : Tout sélectionner
#include <GuiConstantsEx.au3> #include <GuiStatusBar.au3> #include <WindowsConstants.au3> #include <ProgressConstants.au3> Global $hStatus, $hProgress, $hProgress2, $hGUI, $progress, $progress2, $fSize = False _Main() Func _Main() Local $hInput, $input Local $aParts[4] = [80, 160, 300, -1] ; Create GUI $hGUI = GUICreate("StatusBar Embed Control", 400, 300) GUISetStyle(BitOR($WS_MINIMIZEBOX, $WS_MAXIMIZEBOX, $WS_SIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU)) $hStatus = _GUICtrlStatusBar_Create($hGUI) _GUICtrlStatusBar_SetMinHeight($hStatus, 20) _GUICtrlStatusBar_SetParts($hStatus, $aParts) _GUICtrlStatusBar_SetText($hStatus, "Part 1") _GUICtrlStatusBar_SetText($hStatus, "Part 2", 1) ; Embed a progress bar $progress = GUICtrlCreateProgress(10, 10, 100, 15, $PBS_SMOOTH) $hProgress = GUICtrlGetHandle($progress) _GUICtrlStatusBar_EmbedControl($hStatus, 2, $hProgress) ;~ ; *** Warning *** Resizing the window with the following enabled will hard crash AutoIt. $progress2 = GUICtrlCreateButton( "Encoder", 0, 0, -1, -1) ;~ $progress2 = GUICtrlCreateProgress(0, 0, 100, 15, $PBS_MARQUEE) $hProgress2 = GUICtrlGetHandle($progress2) _GUICtrlStatusBar_EmbedControl($hStatus, 3, $hProgress2) _SendMessage($hProgress2, $PBM_SETMARQUEE, True, 200) GUIRegisterMsg($WM_SIZE, "WM_SIZE") GUISetState() Do If $fSize Then _GUICtrlStatusBar_EmbedControl($hStatus, 2, $hProgress) _GUICtrlStatusBar_EmbedControl($hStatus, 3, $hProgress2) $fSize = False EndIf Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc ;==>_Main ; Resize the status bar when GUI size changes Func WM_SIZE($hWnd, $iMsg, $iwParam, $ilParam) _GUICtrlStatusBar_Resize($hStatus) $fSize = True GUICtrlSetPos($progress2, -100, -100) ; hide the marquee off the window until the status bar part is big enough to hold it. Return $GUI_RUNDEFMSG EndFunc ;==>WM_SIZE