Hi, i have this script
I have multiple GUI and i don't want to write everytime all this line. It's possible to create a func like _TitleBar($Title, $Color etc.?
The main problem is the return value for the Case $GUI_EVENT_CLOSE, $hClose and Case $hMinimize, how to do that?
Thanks
[ autoit ]
#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <StaticConstants.au3> Global $GUI = GUICreate("MyGUI", 200, 200, -1, -1, BitOR($WS_POPUPWINDOW, $WS_SYSMENU, $WS_MINIMIZEBOX)) GUISetBkColor(0x00000) $dTitleBarColor = 0x00000 $hTitleBar = GUICtrlCreateLabel("My Test", 0, 4, 140, 25, $SS_NOTIFY, $GUI_WS_EX_PARENTDRAG) GUICtrlSetFont(-1, 11, 500, "Arial") GUICtrlSetColor($hTitleBar, 0xFFFFFF) GUICtrlSetBkColor($hTitleBar, $dTitleBarColor) Local $hClose = GUICtrlCreateLabel(" X", 170, 4, 22, 21) GUICtrlSetFont(-1, 12, 600, -1) GUICtrlSetColor($hClose, 0xFFFFFF) GUICtrlSetBkColor($hClose, $dTitleBarColor) GUICtrlSetTip($hClose, "Close") GUICtrlSetBkColor(-1, $dTitleBarColor) Local $hMinimize = GUICtrlCreateLabel("__", 140, 4, 21, 21) GUICtrlSetFont(-1, 8, 600, 4, "Comic Sans MS") GUICtrlSetColor($hMinimize, 0xFFFFFF) GUICtrlSetBkColor($hMinimize, $dTitleBarColor) GUICtrlSetTip($hMinimize, "Minimize") GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE, $hClose Exit Case $hMinimize GUISetState(@SW_MINIMIZE, $GUI) EndSwitch WEnd
I have multiple GUI and i don't want to write everytime all this line. It's possible to create a func like _TitleBar($Title, $Color etc.?
The main problem is the return value for the Case $GUI_EVENT_CLOSE, $hClose and Case $hMinimize, how to do that?
Thanks