#include <GuiConstantsEx.au3>
#include <GuiStatusBar.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <WindowsConstants.au3>
Opt('MustDeclareVars', 1)
Global $iMemo, $MainGUI, $hStatus
Example1()
Func Example1()
Local $hGUI
Local $aParts[3] = [75, 150, -1]
$hGUI = GUICreate("(Example 1) StatusBar Create", 500, 500, -1,-1,$WS_OVERLAPPEDWINDOW)
$iMemo = GUICtrlCreateEdit("一旦最大化,状态栏就无法跟着变化,如何解决", 0, 0, 500, 450, $WS_VSCROLL)
GUICtrlSendMsg($iMemo, $EM_SETREADONLY, True, 0)
GUICtrlSetBkColor($iMemo, 0xFFFFFF)
$hStatus = _GUICtrlStatusBar_Create($hGUI)
_GUICtrlStatusBar_SetParts($hStatus, $aParts)
GUISetState()
GUIRegisterMsg($WM_SIZE, "WM_SIZE")
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
GUISetState(@SW_ENABLE, $MainGUI)
GUIDelete($hGUI)
EndFunc ;==>Example1
Func WM_SIZE($hWnd, $Msg, $wParam, $lParam)
_GUICtrlStatusBar_Resize($hStatus)
Return $GUI_RUNDEFMSG
EndFunc
|