#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include $MainGUI = GUICreate("Main GUI", 337, 21, -1, 7, -1, BitOR($WS_EX_TOPMOST, $WS_EX_WINDOWEDGE)) $File = GUICtrlCreateMenu("&File") $Exit = GUICtrlCreateMenuItem("Exit", $File) $Menu = GUICtrlCreateMenu("&Menu") $SecondGUI = GUICtrlCreateMenuItem("Second GUI", $Menu) $Help = GUICtrlCreateMenu("&Help") $About = GUICtrlCreateMenuItem("About", $Help) GUISetFont(12, 400, 0, "MS Sans Serif") GUISetBkColor(0xB4B4B4) $DummyLabel = GUICtrlCreateLabel("", 32, 112, 4, 4) Dim $MainGUI_AccelTable[2][2] = [["^!f", $File], ["^!m", $Menu]] GUISetAccelerators($MainGUI_AccelTable) GUISetState(@SW_SHOW) $About1 = GUICreate("About", 246, 288, -1, -1, $WS_SYSMENU, BitOR($WS_EX_TOPMOST, $WS_EX_WINDOWEDGE)) GUICtrlSetResizing(-1, 0) $Version = GUICtrlCreateLabel("Version 1.0", 175, 266, 57, 17) $Dev = GUICtrlCreateLabel("Developed by SantaClaus", 23, 191, 200, 24) GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif") $CA = GUICtrlCreateLabel("www.google.ca", 22, 216, 200, 20) GUICtrlSetFont(-1, 10, 800, 4, "MS Sans Serif") GUICtrlSetColor(-1, 0x0078D7) GUICtrlSetCursor(-1, 0) $COM = GUICtrlCreateLabel("www.google.com", 31, 235, 179, 20) GUICtrlSetFont(-1, 10, 800, 4, "MS Sans Serif") GUICtrlSetColor(-1, 0x0078D7) GUICtrlSetCursor(-1, 0) ; Set resize mode for controls Opt("GUIResizeMode", $GUI_DOCKAUTO) Local $iGUIInitSize = 343 $SecondG = GUICreate("Second GUI", $iGUIInitSize, 611, -1, -1, BitOR($GUI_SS_DEFAULT_GUI, $WS_SIZEBOX, $WS_THICKFRAME), BitOR($WS_EX_TOPMOST, $WS_EX_WINDOWEDGE)) GUISetFont(12, 400, 0, "MS Sans Serif") GUISetBkColor(0xFFFFFF) $SELECTOPTION = GUICtrlCreateCombo("Select OPTION", 8, 16, 121, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL)) GUICtrlSetData(-1, "Option1|Options2") GUICtrlSetFont(-1, 12, 0, 0, "MS Sans Serif") GUICtrlSetCursor(-1, 0) $OPTIONLIST = GUICtrlCreateList("", 8, 64, 325, 524, BitOR($LBS_NOSEL, $WS_VSCROLL)) GUICtrlSetFont(-1, 12, 0, 0, "MS Sans Serif") $iLast_Control = GUICtrlCreateDummy() GUISetState(@SW_HIDE) GUIRegisterMsg($WM_SIZE, "_WM_SIZE") _GUITWO() While 1 $aMsg = GUIGetMsg(1) Switch $aMsg[1] Case $MainGUI Switch $aMsg[0] Case $GUI_EVENT_CLOSE ;WinKill("About") Exit Case $Exit Exit Case $About GUISetState(@SW_DISABLE, $MainGUI) _QGAbout($About1) GUISetState(@SW_ENABLE, $MainGUI) Case $SecondGUI _GUITWO() EndSwitch Case $SecondG Switch $aMsg[0] Case $GUI_EVENT_CLOSE GUISetState(@SW_HIDE, $SecondG) EndSwitch EndSwitch WEnd Func _QGAbout($AboutGUI) GUISetState(@SW_SHOW, $AboutGUI) While 1 $nMsg = GUIGetMsg(1) If $nMsg[1] = $AboutGUI Then Switch $nMsg[0] Case $GUI_EVENT_CLOSE GUISetState(@SW_HIDE, $AboutGUI) ExitLoop Case $CA ShellExecute("www.google.ca") Case $COM ShellExecute("www.google.com") EndSwitch EndIf WEnd EndFunc ;==>_QGAbout Func _GUITWO() GUISetState(@SW_SHOW, $SecondG) EndFunc ;==>_GUITWO Func _WM_SIZE($hWnd, $iMsg, $wParam, $lParam) #forceref $iMsg, $wParam, $lParam If $hWnd = $SecondG Then ; Calculate required font size Local $aGUI_Size = WinGetClientSize($SecondG) $iFontSize = Int(2 * (.25 + (8 * $aGUI_Size[0] / $iGUIInitSize))) / 2 ; Reset font size for all controls on main GUI For $i = 0 To $iLast_Control GUICtrlSetFont($i, $iFontSize) Next EndIf EndFunc ;==>_WM_SIZE