Jump to content
Sign in to follow this  
checlever

Resize child GUI with Main GUI

Recommended Posts

checlever

Hi All,

I'm new to the forum but have been using this great tool for some time. I'm working on an inventory tool to keep track of computers in my company.

I want to have the option to resize the window so that users can see more computers if they need to. I was able to get some windows to resize the way I want them but I could not get the main window to resize because it contains multiple children guis and they are missbehaving. :o

The window is divided in three sections or has three GUIs at a time. Main gui which has the top row and bottom row of buttons, the middle seccion that has buttons to switch between different views (listviews), and the last section that has all the different views. I hope you can see that in the code.

Note: The code I included here is just 300+ lines of the 8000+ lines of the whole program.

To switch between the viewes I tried using a tab interface but I ran into other problems that way and I thought it would be way easier to just create multiple child GUIs inside the Main GUI.

If you have any suggestions on how to improve my code I would appreciate that too.

So the question: How can I enable resizing on main GUI and make all children GUIs to resize with it?

In the code below I have enabled resizing for the main gui and switch gui but once I start enabling the viewtabGUIs I start getting some issues.

I don't know if I have included the code properly as this is my first post :)

Thanks in advanced!!!

#include <GUIConstantsEx.au3>
#Include <GuiComboBox.au3>
#include <WindowsConstants.au3>
#include <StaticConstants.au3>
#include <ListBoxConstants.au3>
#include <ListviewConstants.au3>
#include <EditConstants.au3>
#include <ButtonConstants.au3>
#include <DateTimeConstants.au3>
#Include <GuiRichEdit.au3>
#include <GuiButton.au3>
#Include <File.au3>
#include <Process.au3>
#Include <GuiListView.au3>
#include <GuiEdit.au3>
#include <String.au3>
#include <Word.au3>
#include <Array.au3>
#include <Date.au3>
#include <Excel.au3>
#include <Misc.au3>
#include <INet.au3>
#include <IE.au3>

Opt("GUIOnEventMode", 1)
Opt("WinTitleMatchMode", 2)
;Opt("GuiResizeMode", $GUI_DOCKAUTO)
Opt("GuiResizeMode", 0)

Global $admin = True, $readonly = False
Global $statusgreen = 0xCCFF99 ;0x66FF33 ;color of green status bar
Global $statusyellow = 0xFFFF99 ;color of yellow status bar
Global $statusred = 0xFF9900 ;0xFF0000 ;color of red status bar (orange)
Global $requiredred = 0xDD0000 ;color of font of required fields
Global $labelcolor = 0xCCCCCC ;color of section labels bar (light gray, darker than GUI)

Main()
Func Main()

   ;Golbal declarations
   ;MainGUI section
   Global $searchcombo, $searchinput, $searchbutton, $advsearch, $printcombo, $historybutton, $directorybutton, $itdirectorybutton
   ;Admin section
   Global $usermgmtbutton, $changeslogbutton, $interfacebutton, $viewcompbutton
   ;GUI declarations
   Global $maintabGUI, $quickviewtabGUI, $computertabGUI, $printerstabGUI, $locationtabGUI, $networktabGUI, $videotabGUI, $periphtabGUI, $vconftabGUI, $pericounttabGUI
   ;listview declarations
   Global $listview, $quickviewlistview, $printerlistview, $computerlistview, $locationlistview, $networklistview, $videolistview, $periphlistview, $vconflistview, $pericountlistview
   Global $newnamebutton, $addcompbutton, $editcompbutton, $replacecompbutton, $removecompbutton, $ecyclecompbutton, $addptsrbutton, $complogbutton, $softwarebutton, $pwdresetbutton
   Global $addprinterbutton, $editprinterbutton, $replaceprinterbutton, $assignprinterbutton, $pingprinterbutton, $webprinterbutton
   Global $monitorwarrantybutton
   Global $damebutton, $vncbutton, $dntubutton, $pingcompbutton, $compmgmtbutton, $csharebutton, $systembutton
   Global $statuscolor, $statuslabel
   ;Gui decalration
   Global $mainGUI = GUICreate("Kadlec Inventory ", 1180, 380, -1, -1, BitOr($GUI_SS_DEFAULT_GUI,$WS_SYSMENU,$WS_SIZEBOX,$WS_MAXIMIZEBOX))
   GUISetOnEvent($GUI_EVENT_CLOSE, "On_Close")
   ;GUISetBkColor(0xEEEEEEE, $mainGUI)
   ;Top menus/buttons decalrations
   $searchcombo = GUICtrlCreateCombo("All Fields", 10, 10, 120, 20)
   GUICtrlSetOnEvent(-1, "On_SearchMenu")
   GUICtrlSetData($searchcombo, "Computer Name|IP Address|Department|Location|Role/User|Model|Removed|Ecycled|BCA|Extension|Last Touched|Install Tech", "All Fields")
   GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
   $searchinput = GUICtrlCreateCombo("", 140, 10, 180, 20)
   GUICtrlSetState($searchinput, $GUI_FOCUS)
   GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
   $searchbutton = GUICtrlCreateButton("Search", 320, 10, 70, 20)
   GUICtrlSetOnEvent($searchbutton, "On_Search")
   GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
   $advsearch = GUICtrlCreateButton("Adv. Search", 390, 10, 70, 20)
   GUICtrlSetOnEvent($advsearch, "On_AdvancedSearchGUI")
   GUICtrlSetState(-1, $GUI_DISABLE)
   GUICtrlSetState($searchbutton, $GUI_DEFBUTTON)
   GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
   Global $removedcb = GUICtrlCreateCheckbox("Removed", 465, 10, 70, 20)
   GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
   Global $ecyclecb = GUICtrlCreateCheckbox("Ecycled", 535, 10, 60, 20)
   GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
   $printcombo = GUICtrlCreateCombo("", 820, 10, 90, 20, $CBS_DROPDOWNLIST)
   GUICtrlSetOnEvent(-1, "On_ExportMenu")
   GUICtrlSetData($printcombo, "Export Menu|All Tabs|Quick View|Computer Tab|Location Tab|Network Tab|Video Tab|Peripheral Tab|CSV", "Export Menu")
   GUICtrlSetState(-1, $GUI_DISABLE)
   GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
   $historybutton = GUICtrlCreateButton("History", 920, 10, 80, 20)
   GUICtrlSetOnEvent(-1, "On_HistoryButton")
   GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
   $directorybutton = GUICtrlCreateButton("KC Directory", 1010, 10, 80, 20)
   GUICtrlSetOnEvent(-1, "KCDirectoryButton")
   GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
   $itdirectorybutton = GUICtrlCreateButton("IT Directory", 1090, 10, 80, 20)
   GUICtrlSetOnEvent($itdirectorybutton, "ITDirectoryButton")
   GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
   $damebutton = GUICtrlCreateButton("*DameWare", 10, 335, 80, 20)
   GUICtrlSetOnEvent(-1, "On_Command")
   GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
   $vncbutton = GUICtrlCreateButton("*VNC", 90, 335, 80, 20)
   GUICtrlSetOnEvent(-1, "On_Command")
   GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
   $dntubutton = GUICtrlCreateButton("*NT Utilities", 170, 335, 80, 20)
   GUICtrlSetOnEvent(-1, "On_Command")
   GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
   $compmgmtbutton = GUICtrlCreateButton("Comp Mgmt", 250, 335, 80, 20)
   GUICtrlSetOnEvent(-1, "On_Command")
   GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
   $pingcompbutton = GUICtrlCreateButton("Ping -t", 330, 335, 80, 20)
   GUICtrlSetOnEvent(-1, "On_Command")
   GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
   $csharebutton = GUICtrlCreateButton("\C$", 410, 335, 80, 20)
   GUICtrlSetOnEvent(-1, "On_Command")
   GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
   $systembutton = GUICtrlCreateButton("Systeminfo", 490, 335, 80, 20)
   GUICtrlSetOnEvent(-1, "On_Command")
   GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
   Global $links = GUICtrlCreateCombo("Useful Links", 580, 335, 100, 20, $CBS_DROPDOWNLIST)
   GUICtrlSetData(-1, "System Center|IP Mgmt|prd-eps1|prd-eps2|dc1|dc2|dc3|Remedy|Pano Mgr|vSphere|Wysemanager|SafeGuard|Password Reset|Voice Files")
   GUICtrlSetOnEvent(-1, "On_UsefulLink")
   GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
   If $admin = TRUE Then
      $usermgmtbutton = GUICtrlCreateButton("User Mgmt", 830, 335, 80, 20)
      GUICtrlSetOnEvent(-1, "On_AdminButton")
      GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
      $viewcompbutton = GUICtrlCreateButton("Saved Comp", 910, 335, 80, 20)
      GUICtrlSetOnEvent(-1, "On_AdminButton")
      GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
      $interfacebutton = GUICtrlCreateButton("Edit Menus", 990, 335, 80, 20)
      GUICtrlSetOnEvent(-1, "On_AdminButton")
      GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
      $changeslogbutton = GUICtrlCreateButton("Changes Log", 1070, 335, 80, 20)
      GUICtrlSetOnEvent(-1, "On_AdminButton")
      GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
   EndIf

   $statuslabel = GUICtrlCreateLabel("Ready", 1, 365, 1179, 15, $SS_SUNKEN) ;BitOR($SS_CENTER, $SS_SUNKEN));BitOR($SS_SIMPLE, $SS_SUNKEN))
   GUICtrlSetBkColor($statuslabel, $statusgreen) ;change status light to GREEN
   GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKLEFT + $GUI_DOCKHEIGHT)

   $adminlabel = GUICtrlCreateLabel("Admin", 700, 53, 50, 15, BitOr($SS_NOTIFY, $SS_CENTER))
   GUICtrlSetOnEvent(-1, "On_AdminLabel")
   GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
   GUICtrlSetBkColor($adminlabel, 0xFFCC00)
   $provlabel = GUICtrlCreateLabel("Provider", 750, 53, 50, 15, $SS_CENTER)
   GUICtrlSetOnEvent(-1, "On_ProviderLabel")
   GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
   GUICtrlSetBkColor($provlabel, 0xD1BED8)
   $pmanlabel = GUICtrlCreateLabel("Manager", 800, 53, 50, 15, $SS_CENTER)
   GUICtrlSetOnEvent(-1, "On_ManagerLabel")
   GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
   GUICtrlSetBkColor($pmanlabel, 0xCCFFFF) ;FFFF66
   $remlabel = GUICtrlCreateLabel("Removed", 850, 53, 50, 15, $SS_CENTER)
   GUICtrlSetOnEvent(-1, "On_RemovedLabel")
   GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
   GUICtrlSetBkColor($remlabel, 0xFFFF66) ;AAAAAA
   $bcalabel = GUICtrlCreateLabel("BCA", 950, 53, 50, 15, $SS_CENTER)
   GUICtrlSetOnEvent(-1, "On_BCALabel")
   GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
   GUICtrlSetBkColor($bcalabel, 0xFF0000) ;AAAAAA
   $ecylabel = GUICtrlCreateLabel("Ecycled", 900, 53, 50, 15, $SS_CENTER)
   GUICtrlSetOnEvent(-1, "On_EcycledLabel")
   GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
   GUICtrlSetBkColor($ecylabel, 0x66FF00) ;AAAAAA

   ;-------- Switch Section -------------------------------
   $maintabGUI = GUICreate("", 1180, 70, 0, 0, $WS_CHILD, -1, BitOr($mainGUI,$WS_SIZEBOX));$mainGUI)
   ;GUISetBkColor(0xEEEEEE, $maintabGUI)
   Global $squickviewbutton = GUICtrlCreateButton("Quick View", 10, 50, 70, 20)
   GUICtrlSetOnEvent(-1, "On_Switch")
   GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
   Global $sprinterbutton = GUICtrlCreateButton("Printer Info", 80, 50, 70, 20)
   GUICtrlSetOnEvent(-1, "On_Switch")
   GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
   Global $scomputerbutton = GUICtrlCreateButton("Computer Info", 150, 50, 80, 20)
   GUICtrlSetOnEvent(-1, "On_Switch")
   GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
   Global $slocationbutton = GUICtrlCreateButton("Location Info", 230, 50, 80, 20)
   GUICtrlSetOnEvent(-1, "On_Switch")
   GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
   Global $snetworkbutton = GUICtrlCreateButton("Network Info", 310, 50, 70, 20)
   GUICtrlSetOnEvent(-1, "On_Switch")
   GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
   Global $svideobutton = GUICtrlCreateButton("Video Info", 380, 50, 60, 20)
   GUICtrlSetOnEvent(-1, "On_Switch")
   GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
   Global $speriphbutton = GUICtrlCreateButton("Peripheral Info", 440, 50, 80, 20)
   GUICtrlSetOnEvent(-1, "On_Switch")
   GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
   Global $svconfbutton = GUICtrlCreateButton("Video Conference", 520, 50, 100, 20)
   GUICtrlSetOnEvent(-1, "On_Switch")
   GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
   Global $sncountbutton = GUICtrlCreateButton("Node Count", 620, 50, 70, 20)
   GUICtrlSetOnEvent(-1, "On_Switch")
   GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
   GUISetState()

   ;add column
   ;-------- Quick view section
   $quickviewtabGUI = GUICreate("", 1180, 395, 0, 0, $WS_CHILD, -1, $mainGUI);BitOR($mainGUI, $WS_SIZEBOX))
   ;GUISetBkColor(0xEEEEEEE, $quickviewtabGUI)
   $quickviewlistview = GUICtrlCreateListView("Computer Name|IP Address|Department|Location|Role/User|Extension|Model|Install Date|Last Touched|PT/SR|Removed|Ecycled|BCA|Serv Tag" _
   , 10, 75, 1160, 210)
   GUICtrlSendMsg($quickviewlistview, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_GRIDLINES, $LVS_EX_GRIDLINES)
   ;GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKRIGHT)
   $listview = $quickviewlistview
   $newnamebutton = GUICtrlCreateButton("*Get New Name", 10, 295, 100, 20)
   GUICtrlSetOnEvent(-1, "On_Button")
   ;GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKHEIGHT + $GUI_DOCKWIDTH + $GUI_DOCKLEFT)
   $addcompbutton = GUICtrlCreateButton("Add Computer", 110, 295, 100, 20)
   GUICtrlSetOnEvent(-1, "On_Button")
   ;GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKHEIGHT + $GUI_DOCKWIDTH + $GUI_DOCKLEFT)
   $editcompbutton = GUICtrlCreateButton("Edit Computer", 210, 295, 100, 20)
   GUICtrlSetOnEvent(-1, "On_Button")
   ;GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKHEIGHT + $GUI_DOCKWIDTH + $GUI_DOCKLEFT)
   GUICtrlSetState($editcompbutton, $GUI_DISABLE)
   $replacecompbutton = GUICtrlCreateButton("Replace Computer", 310, 295, 100, 20)
   GUICtrlSetOnEvent(-1, "On_Button")
   ;GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKHEIGHT + $GUI_DOCKWIDTH + $GUI_DOCKLEFT)
   GUICtrlSetState($replacecompbutton, $GUI_DISABLE)
   $removecompbutton = GUICtrlCreateButton("Remove Computer", 410, 295, 100, 20)
   GUICtrlSetOnEvent(-1, "On_Button")
   ;GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKHEIGHT + $GUI_DOCKWIDTH + $GUI_DOCKLEFT)
   GUICtrlSetState($removecompbutton, $GUI_DISABLE)
   $ecyclecompbutton = GUICtrlCreateButton("Ecycle", 510, 295, 100, 20)
   GUICtrlSetOnEvent(-1, "On_Button")
   ;GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKHEIGHT + $GUI_DOCKWIDTH + $GUI_DOCKLEFT)
   GUICtrlSetState($ecyclecompbutton, $GUI_DISABLE)
   $addptsrbutton = GUICtrlCreateButton("Add PT/SR", 620, 295, 100, 20)
   GUICtrlSetOnEvent(-1, "On_Button")
   ;GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKHEIGHT + $GUI_DOCKWIDTH + $GUI_DOCKLEFT)
   GUICtrlSetState(-1, $GUI_DISABLE)
   $complogbutton = GUICtrlCreateButton("Computer Log", 720, 295, 100, 20)
   GUICtrlSetOnEvent(-1, "On_Button")
   ;GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKHEIGHT + $GUI_DOCKWIDTH + $GUI_DOCKLEFT)
   $softwarebutton = GUICtrlCreateButton("Software", 820, 295, 100, 20)
   GUICtrlSetOnEvent(-1, "On_Button")
   ;GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKHEIGHT + $GUI_DOCKWIDTH + $GUI_DOCKLEFT)
   $pwdresetbutton = GUICtrlCreateButton("Pwd Reset", 920, 295, 100, 20)
   GUICtrlSetOnEvent(-1, "On_Button")
   ;GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKHEIGHT + $GUI_DOCKWIDTH + $GUI_DOCKLEFT)
   If $readonly = True Then
      GUICtrlSetState($newnamebutton, $GUI_DISABLE)
      GUICtrlSetState($addcompbutton, $GUI_DISABLE)
   EndIf
   GUISetState()

   ;-------- Printers tab section
   $printerstabGUI = GUICreate("", 1180, 395, 0, 0, $WS_CHILD, -1, $mainGUI);BitOR($mainGUI, $WS_SIZEBOX))
   $printerlistview = GUICtrlCreateListView("Computer Name|Printer Name|IP Address|Location|Server Name|Driver Name|Driver Version|Notes|Is Shared|Share Name|Model|S#" _
   , 10, 75, 1160, 210)
   GUICtrlSendMsg($printerlistview, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_GRIDLINES, $LVS_EX_GRIDLINES)
   ;GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKRIGHT)
   $addprinterbutton = GUICtrlCreateButton("Add Printer", 10, 295, 100, 20)
   GUICtrlSetOnEvent(-1, "On_Button")
   ;GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKHEIGHT + $GUI_DOCKWIDTH + $GUI_DOCKLEFT)
   GUICtrlSetState($addprinterbutton, $GUI_DISABLE)
   $editprinterbutton = GUICtrlCreateButton("Edit Printer", 110, 295, 100, 20)
   GUICtrlSetOnEvent(-1, "On_Button")
   ;GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKHEIGHT + $GUI_DOCKWIDTH + $GUI_DOCKLEFT)
   GUICtrlSetState($editprinterbutton, $GUI_DISABLE)
   $replaceprinterbutton = GUICtrlCreateButton("Replace Printer", 210, 295, 100, 20)
   GUICtrlSetOnEvent(-1, "On_Button")
   ;GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKHEIGHT + $GUI_DOCKWIDTH + $GUI_DOCKLEFT)
   GUICtrlSetState($replaceprinterbutton, $GUI_DISABLE)
   $assignprinterbutton = GUICtrlCreateButton("Assign Printer", 310, 295, 100, 20)
   GUICtrlSetOnEvent(-1, "On_Button")
   ;GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKHEIGHT + $GUI_DOCKWIDTH + $GUI_DOCKLEFT)
   GUICtrlSetState($assignprinterbutton, $GUI_DISABLE)
   $pingprinterbutton = GUICtrlCreateButton("Ping Printer -t", 420, 295, 100, 20)
   GUICtrlSetOnEvent(-1, "On_Button")
   ;GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKHEIGHT + $GUI_DOCKWIDTH + $GUI_DOCKLEFT)
   $webprinterbutton = GUICtrlCreateButton("Web Interface", 520, 295, 100, 20)
   GUICtrlSetOnEvent(-1, "On_Button")
   ;GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKHEIGHT + $GUI_DOCKWIDTH + $GUI_DOCKLEFT)
   If $readonly = True Then
      GUICtrlSetState($addprinterbutton, $GUI_DISABLE)
      GUICtrlSetState($editprinterbutton, $GUI_DISABLE)
      GUICtrlSetState($replaceprinterbutton, $GUI_DISABLE)
      GUICtrlSetState($assignprinterbutton, $GUI_DISABLE)
   EndIf
   ;GUISetState()

   ;-------- Computer tab section
   $computertabGUI = GUICreate("", 1180, 395, 0, 0, $WS_CHILD, -1, $mainGUI);BitOR($mainGUI, $WS_SIZEBOX))
   $computerlistview = GUICtrlCreateListView("Computer Name|IP Address|Model|Type|Service Tag|Install Date|Install Type|Install Tech|Domain|Last Touched|Software|OS|Encryption|HD Model|PT/SR|History/Notes|Removed|Ecycled|BCA|Purchased By" _
   , 10, 75, 1160, 210)
   GUICtrlSendMsg($computerlistview, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_GRIDLINES, $LVS_EX_GRIDLINES)
   ;GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKRIGHT)

   ;-------- Location tab section
   $locationtabGUI = GUICreate("", 1180, 395, 0, 0, $WS_CHILD, -1, $mainGUI);BitOR($mainGUI, $WS_SIZEBOX))
   $locationlistview = GUICtrlCreateListView("Computer Name|Department|Location|Floor|Room|Role/User|Extension" _
   , 10, 75, 1160, 210)
   GUICtrlSendMsg($locationlistview, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_GRIDLINES, $LVS_EX_GRIDLINES)
   ;GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKRIGHT)

   ;-------- Network tab section
   $networktabGUI = GUICreate("", 1180, 395, 0, 0, $WS_CHILD, -1, $mainGUI);BitOR($mainGUI, $WS_SIZEBOX))
   $networklistview = GUICtrlCreateListView("Computer Name|MAC Address|CLoset|Switch Name/IP|Cable ID|Switch Port|Cable Type" _
   , 10, 75, 1160, 210)
   GUICtrlSendMsg($networklistview, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_GRIDLINES, $LVS_EX_GRIDLINES)
   ;GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKRIGHT)

   ;-------- Video tab section
   $videotabGUI = GUICreate("", 1180, 395, 0, 0, $WS_CHILD, -1, $mainGUI);BitOR($mainGUI, $WS_SIZEBOX))
   $videolistview = GUICtrlCreateListView("Computer Name|Video Card|Monitor Qty|Monitor1|Monitor2|Monitor3|Monitor4|Cable Type" _
   , 10, 75, 1160, 210)
   GUICtrlSendMsg($videolistview, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_GRIDLINES, $LVS_EX_GRIDLINES)
   ;GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKRIGHT)
   $monitorwarrantybutton = GUICtrlCreateButton("Check Warranty", 10, 295, 100, 20)
   GUICtrlSetOnEvent(-1, "On_Button")
   ;GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKHEIGHT + $GUI_DOCKWIDTH + $GUI_DOCKLEFT)
   If $readonly = True Then
      GUICtrlSetState($monitorwarrantybutton, $GUI_DISABLE)
   EndIf

   ;-------- Peripherlas tab section
   $periphtabGUI = GUICreate("", 1180, 395, 0, 0, $WS_CHILD, -1, $mainGUI)
   $periphlistview = GUICtrlCreateListView("Computer Name|Default Printer|Network Printer|Local Printer|BCA|Desk Scanner|Barcode Scanner|Speechmic|Webcam|E-sig Pad|Credit Card Reader|Labeler|External DVD|Other" _
   , 10, 75, 1160, 210)
   GUICtrlSendMsg($periphlistview, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_GRIDLINES, $LVS_EX_GRIDLINES)
   ;GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKRIGHT)

   ;-------- Video Conference tab
   $vconftabGUI = GUICreate("", 1180, 395, 0, 0, $WS_CHILD, -1, $mainGUI)
   $vconflistview = GUICtrlCreateListView("Model|Password|Location|Internal IP|External IP|Service Provided By" _
   , 10, 75, 1160, 210)
   GUICtrlSendMsg($vconflistview, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_GRIDLINES, $LVS_EX_GRIDLINES)
   ;GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKRIGHT)

   ;-------- Peripheral Count tab
   $pericounttabGUI = GUICreate("", 1180, 395, 0, 0, $WS_CHILD, -1, $mainGUI)
   $pericountlistview = GUICtrlCreateListView("Network Printers|Local Printers|Desk Scanners|Barcode Scanners|SpeechMics|Webcams|E-sig Pads|Credit Card Readers|Labeler|External DVD|Other|Total" _
   , 10, 75, 1160, 210)
   GUICtrlSendMsg($pericountlistview, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_GRIDLINES, $LVS_EX_GRIDLINES)
   ;GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKRIGHT)

   GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")
   GUICtrlSetState($squickviewbutton, $GUI_DISABLE)
   GUISwitch($mainGUI)
   GUISetState()
   Global $B_DESCENDING[_GUICtrlListView_GetColumnCount($quickviewlistview)]
   While 1
      Sleep(100)
   WEnd

EndFunc

Func On_Switch()

   Switch @GUI_CtrlId
      Case $squickviewbutton
         $listview = $quickviewlistview
         GUICtrlSetState($squickviewbutton, $GUI_DISABLE)
         GUICtrlSetState($sprinterbutton, $GUI_ENABLE)
         GUICtrlSetState($scomputerbutton, $GUI_ENABLE)
         GUICtrlSetState($slocationbutton, $GUI_ENABLE)
         GUICtrlSetState($snetworkbutton, $GUI_ENABLE)
         GUICtrlSetState($svideobutton, $GUI_ENABLE)
         GUICtrlSetState($speriphbutton, $GUI_ENABLE)
         GUICtrlSetState($svconfbutton, $GUI_ENABLE)
         GUICtrlSetState($sncountbutton, $GUI_ENABLE)
         GUISetState(@SW_SHOW,$quickviewtabGUI)
         GUISetState(@SW_HIDE,$printerstabGUI)
         GUISetState(@SW_HIDE,$computertabGUI)
         GUISetState(@SW_HIDE,$locationtabGUI)
         GUISetState(@SW_HIDE,$networktabGUI)
         GUISetState(@SW_HIDE,$videotabGUI)
         GUISetState(@SW_HIDE,$periphtabGUI)
         GUISetState(@SW_HIDE,$vconftabGUI)
         GUISetState(@SW_HIDE,$pericounttabGUI)
      Case $sprinterbutton
         $listview = $printerlistview
         GUICtrlSetState($squickviewbutton, $GUI_ENABLE)
         GUICtrlSetState($sprinterbutton, $GUI_DISABLE)
         GUICtrlSetState($scomputerbutton, $GUI_ENABLE)
         GUICtrlSetState($slocationbutton, $GUI_ENABLE)
         GUICtrlSetState($snetworkbutton, $GUI_ENABLE)
         GUICtrlSetState($svideobutton, $GUI_ENABLE)
         GUICtrlSetState($speriphbutton, $GUI_ENABLE)
         GUICtrlSetState($svconfbutton, $GUI_ENABLE)
         GUICtrlSetState($sncountbutton, $GUI_ENABLE)
         GUISetState(@SW_HIDE,$quickviewtabGUI)
         GUISetState(@SW_SHOW,$printerstabGUI)
         GUISetState(@SW_HIDE,$computertabGUI)
         GUISetState(@SW_HIDE,$locationtabGUI)
         GUISetState(@SW_HIDE,$networktabGUI)
         GUISetState(@SW_HIDE,$videotabGUI)
         GUISetState(@SW_HIDE,$periphtabGUI)
         GUISetState(@SW_HIDE,$vconftabGUI)
         GUISetState(@SW_HIDE,$pericounttabGUI)
      Case $scomputerbutton
         $listview = $computerlistview
         GUICtrlSetState($squickviewbutton, $GUI_ENABLE)
         GUICtrlSetState($sprinterbutton, $GUI_ENABLE)
         GUICtrlSetState($scomputerbutton, $GUI_DISABLE)
         GUICtrlSetState($slocationbutton, $GUI_ENABLE)
         GUICtrlSetState($snetworkbutton, $GUI_ENABLE)
         GUICtrlSetState($svideobutton, $GUI_ENABLE)
         GUICtrlSetState($speriphbutton, $GUI_ENABLE)
         GUICtrlSetState($svconfbutton, $GUI_ENABLE)
         GUICtrlSetState($sncountbutton, $GUI_ENABLE)
         GUISetState(@SW_HIDE,$quickviewtabGUI)
         GUISetState(@SW_HIDE,$printerstabGUI)
         GUISetState(@SW_SHOW,$computertabGUI)
         GUISetState(@SW_HIDE,$locationtabGUI)
         GUISetState(@SW_HIDE,$networktabGUI)
         GUISetState(@SW_HIDE,$videotabGUI)
         GUISetState(@SW_HIDE,$periphtabGUI)
         GUISetState(@SW_HIDE,$vconftabGUI)
         GUISetState(@SW_HIDE,$pericounttabGUI)
      Case $slocationbutton
         $listview = $locationlistview
         GUICtrlSetState($squickviewbutton, $GUI_ENABLE)
         GUICtrlSetState($sprinterbutton, $GUI_ENABLE)
         GUICtrlSetState($scomputerbutton, $GUI_ENABLE)
         GUICtrlSetState($slocationbutton, $GUI_DISABLE)
         GUICtrlSetState($snetworkbutton, $GUI_ENABLE)
         GUICtrlSetState($svideobutton, $GUI_ENABLE)
         GUICtrlSetState($speriphbutton, $GUI_ENABLE)
         GUICtrlSetState($svconfbutton, $GUI_ENABLE)
         GUICtrlSetState($sncountbutton, $GUI_ENABLE)
         GUISetState(@SW_HIDE,$quickviewtabGUI)
         GUISetState(@SW_HIDE,$printerstabGUI)
         GUISetState(@SW_HIDE,$computertabGUI)
         GUISetState(@SW_SHOW,$locationtabGUI)
         GUISetState(@SW_HIDE,$networktabGUI)
         GUISetState(@SW_HIDE,$videotabGUI)
         GUISetState(@SW_HIDE,$periphtabGUI)
         GUISetState(@SW_HIDE,$vconftabGUI)
         GUISetState(@SW_HIDE,$pericounttabGUI)
      Case $snetworkbutton
         $listview = $networklistview
         GUICtrlSetState($squickviewbutton, $GUI_ENABLE)
         GUICtrlSetState($sprinterbutton, $GUI_ENABLE)
         GUICtrlSetState($scomputerbutton, $GUI_ENABLE)
         GUICtrlSetState($slocationbutton, $GUI_ENABLE)
         GUICtrlSetState($snetworkbutton, $GUI_DISABLE)
         GUICtrlSetState($svideobutton, $GUI_ENABLE)
         GUICtrlSetState($speriphbutton, $GUI_ENABLE)
         GUICtrlSetState($svconfbutton, $GUI_ENABLE)
         GUICtrlSetState($sncountbutton, $GUI_ENABLE)
         GUISetState(@SW_HIDE,$quickviewtabGUI)
         GUISetState(@SW_HIDE,$printerstabGUI)
         GUISetState(@SW_HIDE,$computertabGUI)
         GUISetState(@SW_HIDE,$locationtabGUI)
         GUISetState(@SW_SHOW,$networktabGUI)
         GUISetState(@SW_HIDE,$videotabGUI)
         GUISetState(@SW_HIDE,$periphtabGUI)
         GUISetState(@SW_HIDE,$vconftabGUI)
         GUISetState(@SW_HIDE,$pericounttabGUI)
      Case $svideobutton
         $listview = $videolistview
         GUICtrlSetState($squickviewbutton, $GUI_ENABLE)
         GUICtrlSetState($sprinterbutton, $GUI_ENABLE)
         GUICtrlSetState($scomputerbutton, $GUI_ENABLE)
         GUICtrlSetState($slocationbutton, $GUI_ENABLE)
         GUICtrlSetState($snetworkbutton, $GUI_ENABLE)
         GUICtrlSetState($svideobutton, $GUI_DISABLE)
         GUICtrlSetState($speriphbutton, $GUI_ENABLE)
         GUICtrlSetState($svconfbutton, $GUI_ENABLE)
         GUICtrlSetState($sncountbutton, $GUI_ENABLE)
         GUISetState(@SW_HIDE,$quickviewtabGUI)
         GUISetState(@SW_HIDE,$printerstabGUI)
         GUISetState(@SW_HIDE,$computertabGUI)
         GUISetState(@SW_HIDE,$locationtabGUI)
         GUISetState(@SW_HIDE,$networktabGUI)
         GUISetState(@SW_SHOW,$videotabGUI)
         GUISetState(@SW_HIDE,$periphtabGUI)
         GUISetState(@SW_HIDE,$vconftabGUI)
         GUISetState(@SW_HIDE,$pericounttabGUI)
      Case $speriphbutton
         $listview = $periphlistview
         GUICtrlSetState($squickviewbutton, $GUI_ENABLE)
         GUICtrlSetState($sprinterbutton, $GUI_ENABLE)
         GUICtrlSetState($scomputerbutton, $GUI_ENABLE)
         GUICtrlSetState($slocationbutton, $GUI_ENABLE)
         GUICtrlSetState($snetworkbutton, $GUI_ENABLE)
         GUICtrlSetState($svideobutton, $GUI_ENABLE)
         GUICtrlSetState($speriphbutton, $GUI_DISABLE)
         GUICtrlSetState($svconfbutton, $GUI_ENABLE)
         GUICtrlSetState($sncountbutton, $GUI_ENABLE)
         GUISetState(@SW_HIDE,$quickviewtabGUI)
         GUISetState(@SW_HIDE,$printerstabGUI)
         GUISetState(@SW_HIDE,$computertabGUI)
         GUISetState(@SW_HIDE,$locationtabGUI)
         GUISetState(@SW_HIDE,$networktabGUI)
         GUISetState(@SW_HIDE,$videotabGUI)
         GUISetState(@SW_SHOW,$periphtabGUI)
         GUISetState(@SW_HIDE,$vconftabGUI)
         GUISetState(@SW_HIDE,$pericounttabGUI)
      Case $svconfbutton
         GUICtrlSetState($squickviewbutton, $GUI_ENABLE)
         GUICtrlSetState($sprinterbutton, $GUI_ENABLE)
         GUICtrlSetState($scomputerbutton, $GUI_ENABLE)
         GUICtrlSetState($slocationbutton, $GUI_ENABLE)
         GUICtrlSetState($snetworkbutton, $GUI_ENABLE)
         GUICtrlSetState($svideobutton, $GUI_ENABLE)
         GUICtrlSetState($speriphbutton, $GUI_ENABLE)
         GUICtrlSetState($svconfbutton, $GUI_DISABLE)
         GUICtrlSetState($sncountbutton, $GUI_ENABLE)
         GUISetState(@SW_HIDE,$quickviewtabGUI)
         GUISetState(@SW_HIDE,$printerstabGUI)
         GUISetState(@SW_HIDE,$computertabGUI)
         GUISetState(@SW_HIDE,$locationtabGUI)
         GUISetState(@SW_HIDE,$networktabGUI)
         GUISetState(@SW_HIDE,$videotabGUI)
         GUISetState(@SW_HIDE,$periphtabGUI)
         GUISetState(@SW_SHOW,$vconftabGUI)
         GUISetState(@SW_HIDE,$pericounttabGUI)
         If $loaded = False Then
            For $i = 1 To $vconfArray[0]
               $vcItem[$i] = GUICtrlCreateListViewItem($vconfArray[$i], $vconflistview)
            Next
            $loaded = True
         EndIf
      Case $sncountbutton
         GUICtrlSetState($squickviewbutton, $GUI_ENABLE)
         GUICtrlSetState($sprinterbutton, $GUI_ENABLE)
         GUICtrlSetState($scomputerbutton, $GUI_ENABLE)
         GUICtrlSetState($slocationbutton, $GUI_ENABLE)
         GUICtrlSetState($snetworkbutton, $GUI_ENABLE)
         GUICtrlSetState($svideobutton, $GUI_ENABLE)
         GUICtrlSetState($speriphbutton, $GUI_ENABLE)
         GUICtrlSetState($svconfbutton, $GUI_ENABLE)
         GUICtrlSetState($sncountbutton, $GUI_DISABLE)
         GUISetState(@SW_HIDE,$quickviewtabGUI)
         GUISetState(@SW_HIDE,$printerstabGUI)
         GUISetState(@SW_HIDE,$computertabGUI)
         GUISetState(@SW_HIDE,$locationtabGUI)
         GUISetState(@SW_HIDE,$networktabGUI)
         GUISetState(@SW_HIDE,$videotabGUI)
         GUISetState(@SW_HIDE,$periphtabGUI)
         GUISetState(@SW_HIDE,$vconftabGUI)
         GUISetState(@SW_SHOW,$pericounttabGUI)
         If $periloaded = False Then
            $periItem[0] = GUICtrlCreateListViewItem($periphstring, $pericountlistview)
            $periloaded = True
         EndIf
   EndSwitch

EndFunc

Func On_Close()

   Switch @GUI_WinHandle ; See which GUI sent the CLOSE message
      Case $mainGUI
         GUIDelete($mainGUI)
         Exit ; If it was this GUI - we exit
   EndSwitch

EndFunc ;==> End of On_Close()

Share this post


Link to post
Share on other sites
water

Welcome to AutoIt and the forum!

If you search the forum for "child parent gui" you will find some threads about moving parent and child GUI in parallel.

This might give you an idea how to modify for resizing the GUIs.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
checlever

Hi there!

Thanks for your reply. I have looked into  $WS_EX_MDICHILD before but for some reason when I use it, it moves the child GUI outside the Parent GUI. I have searched the forums for some time now and have not found what I'm looking for that is why I decided to show my code to see if someone can see what I'm doing wrong or have suggestions on a different way to do it. I'll do a search for "child parent gui" to see if I find something that I have not seen before. I usually search for child parent gui resizing, or resize child with parent or something of that sort.  

The program works, I just want to add the resizing functionality to it.

Thanks again!

Share this post


Link to post
Share on other sites
FireFox

Hi,

it moves the child GUI outside the Parent GUI.

What do you mean?

Can you write a small reproducer? (using the $WS_EX_MDICHILD exstyle)

Br, FireFox.

Edited by FireFox

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
BrewManNH

You can also use GUIRegisterMsg with the $WM_SYSCOMMAND to monitor whether the GUI is being resized and resize your child gui along with it. You can also use $WM_GETMINMAXINFO to monitor the size of the GUI and use that to prevent the GUI from being made too large or too small. There are examples of these windows messages being used to do this that should help.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites
checlever

Hi,

What do you mean?

Can you write a small reproducer? (using the $WS_EX_MDICHILD exstyle)

Br, FireFox.

 

if in my code I do (line 195 of code I posted)

 $quickviewtabGUI = GUICreate("", 1180, 395, 0, 0, $WS_EX_MDICHILD, -1, $mainGUI)

When I run it it displays the main window and then a new window is created outside the main window with the child gui.

Maybe I'm not using it properly?

Share this post


Link to post
Share on other sites
checlever

You can also use GUIRegisterMsg with the $WM_SYSCOMMAND to monitor whether the GUI is being resized and resize your child gui along with it. You can also use $WM_GETMINMAXINFO to monitor the size of the GUI and use that to prevent the GUI from being made too large or too small. There are examples of these windows messages being used to do this that should help.

 

Thank you. I'll look into GUIResiterMsg with the $WM_SYSCOMMAND to see if I can make it work that way. I have to mention that with the code I've posted, if I enable the resizing code for $quickviewGUI (line 195) to something like this:

$quickviewtabGUI = GUICreate("", 1180, 395, 0, 0, $WS_CHILD, -1, BitOR($mainGUI, $WS_SIZEBOX))

when I resize the main window, child guis get resized the way I want them, but when I click to switch to a different view (tab) then the window disapears. So I'm thinking I have to change something to my On_Switch() function? Monitoring whether the GUI is being resized and then resize my child GUIs makes sense, maybe that is what I'm missing. When I switch between child GUIs maybe I have to pass the new size?

Thanks again!

Share this post


Link to post
Share on other sites
FireFox

Something like this I guess :

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

#region GUI
Local $hGUI = 0, $hGUIChild = 0

$hGUI = GUICreate("MyGUI", Default, Default, -1, -1, BitOR($GUI_SS_DEFAULT_GUI, $WS_SIZEBOX))

$hGUIChild = GUICreate("", 200, 200, 100, 100, $WS_CHILD, -1, $hGUI)
GUISetBkColor(0xFF0000, $hGUIChild)
GUISetState(@SW_SHOWNOACTIVATE, $hGUIChild)

GUIRegisterMsg($WM_SIZE, "WM_SIZE")
GUISetState(@SW_SHOW, $hGUI)
#endregion

While GUIGetMsg() <> $GUI_EVENT_CLOSE
Sleep(10)
WEnd

Func WM_SIZE($hWnd, $iMsg, $wParam, $lParam)
Local $nWidth = BitAND($lParam, 0xFFFF)
Local $nHeight = BitShift($lParam, 16)

WinMove($hGUIChild, 0, 100, 100, $nWidth - 200, $nHeight - 200)

Return $GUI_RUNDEFMSG
EndFunc
Note: Next time, please post a working code. I had to comment some lines to get it working.

Br, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
checlever

Something like this I guess :

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

#region GUI
Local $hGUI = 0, $hGUIChild = 0

$hGUI = GUICreate("MyGUI", Default, Default, -1, -1, BitOR($GUI_SS_DEFAULT_GUI, $WS_SIZEBOX))

$hGUIChild = GUICreate("", 200, 200, 100, 100, $WS_CHILD, -1, $hGUI)
GUISetBkColor(0xFF0000, $hGUIChild)
GUISetState(@SW_SHOWNOACTIVATE, $hGUIChild)

GUIRegisterMsg($WM_SIZE, "WM_SIZE")
GUISetState(@SW_SHOW, $hGUI)
#endregion

While GUIGetMsg() <> $GUI_EVENT_CLOSE
Sleep(10)
WEnd

Func WM_SIZE($hWnd, $iMsg, $wParam, $lParam)
Local $nWidth = BitAND($lParam, 0xFFFF)
Local $nHeight = BitShift($lParam, 16)

WinMove($hGUIChild, 0, 100, 100, $nWidth - 200, $nHeight - 200)

Return $GUI_RUNDEFMSG
EndFunc
Note: Next time, please post a working code. I had to comment some lines to get it working.

Br, FireFox.

 

 

This looks promising. I'll study it to see how I can implement it on my code. Thank you very much.

As for my code, I created a new .au3 file and copied-pasted the code from my post and it ran just fine. Maybe I'm using a different (older) version?

Thanks again!!! And if anybody else has any other ideas or suggestions please let me know. I'm on learning mode right now ;)

Share this post


Link to post
Share on other sites
checlever

Something like this I guess :

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

#region GUI
Local $hGUI = 0, $hGUIChild = 0

$hGUI = GUICreate("MyGUI", Default, Default, -1, -1, BitOR($GUI_SS_DEFAULT_GUI, $WS_SIZEBOX))

$hGUIChild = GUICreate("", 200, 200, 100, 100, $WS_CHILD, -1, $hGUI)
GUISetBkColor(0xFF0000, $hGUIChild)
GUISetState(@SW_SHOWNOACTIVATE, $hGUIChild)

GUIRegisterMsg($WM_SIZE, "WM_SIZE")
GUISetState(@SW_SHOW, $hGUI)
#endregion

While GUIGetMsg() <> $GUI_EVENT_CLOSE
Sleep(10)
WEnd

Func WM_SIZE($hWnd, $iMsg, $wParam, $lParam)
Local $nWidth = BitAND($lParam, 0xFFFF)
Local $nHeight = BitShift($lParam, 16)

WinMove($hGUIChild, 0, 100, 100, $nWidth - 200, $nHeight - 200)

Return $GUI_RUNDEFMSG
EndFunc
Note: Next time, please post a working code. I had to comment some lines to get it working.

Br, FireFox.

 

 

That worked perfectly!!! Thank you very very very much!!! I just had to change some parameters and add the rest of the children to the function and listo!!! You are awesome!!!

I will still try to get it working with a tab view as I think it will look better. But for now I'll keep switching between GUIs.

Thanks again!

Here is the working code in case anybody else is wondering about this: (autoit version 3.3.8.1)

#include <GUIConstantsEx.au3>
#Include <GuiComboBox.au3>
#include <WindowsConstants.au3>
#include <StaticConstants.au3>
#include <ListBoxConstants.au3>
#include <ListviewConstants.au3>
#include <EditConstants.au3>
#include <ButtonConstants.au3>
#include <DateTimeConstants.au3>
#Include <GuiRichEdit.au3>
#include <GuiButton.au3>
#Include <File.au3>
#include <Process.au3>
#Include <GuiListView.au3>
#include <GuiEdit.au3>
#include <String.au3>
#include <Word.au3>
#include <Array.au3>
#include <Date.au3>
#include <Excel.au3>
#include <Misc.au3>
#include <INet.au3>
#include <IE.au3>

Opt("GUIOnEventMode", 1)
Opt("WinTitleMatchMode", 2)
;Opt("GuiResizeMode", $GUI_DOCKAUTO)
Opt("GuiResizeMode", 0)

Global $admin = True, $readonly = False
Global $statusgreen = 0xCCFF99 ;0x66FF33 ;color of green status bar
Global $statusyellow = 0xFFFF99 ;color of yellow status bar
Global $statusred = 0xFF9900 ;0xFF0000 ;color of red status bar (orange)
Global $requiredred = 0xDD0000 ;color of font of required fields
Global $labelcolor = 0xCCCCCC ;color of section labels bar (light gray, darker than GUI)

Main()
Func Main()

   ;Golbal declarations
   ;MainGUI section
   Global $searchcombo, $searchinput, $searchbutton, $advsearch, $printcombo, $historybutton, $directorybutton, $itdirectorybutton
   ;Admin section
   Global $usermgmtbutton, $changeslogbutton, $interfacebutton, $viewcompbutton
   ;GUI declarations
   Global $maintabGUI, $quickviewtabGUI, $computertabGUI, $printerstabGUI, $locationtabGUI, $networktabGUI, $videotabGUI, $periphtabGUI, $vconftabGUI, $pericounttabGUI
   ;listview declarations
   Global $listview, $quickviewlistview, $printerlistview, $computerlistview, $locationlistview, $networklistview, $videolistview, $periphlistview, $vconflistview, $pericountlistview
   Global $newnamebutton, $addcompbutton, $editcompbutton, $replacecompbutton, $removecompbutton, $ecyclecompbutton, $addptsrbutton, $complogbutton, $softwarebutton, $pwdresetbutton
   Global $addprinterbutton, $editprinterbutton, $replaceprinterbutton, $assignprinterbutton, $pingprinterbutton, $webprinterbutton
   Global $monitorwarrantybutton
   Global $damebutton, $vncbutton, $dntubutton, $pingcompbutton, $compmgmtbutton, $csharebutton, $systembutton
   Global $statuscolor, $statuslabel
   ;Gui decalration
   Global $mainGUI = GUICreate("Kadlec Inventory ", 1180, 380, -1, -1, BitOr($GUI_SS_DEFAULT_GUI,$WS_SYSMENU,$WS_SIZEBOX,$WS_MAXIMIZEBOX))
   GUISetOnEvent($GUI_EVENT_CLOSE, "On_Close")
   ;GUISetBkColor(0xEEEEEEE, $mainGUI)
   ;Top menus/buttons decalrations
   $searchcombo = GUICtrlCreateCombo("All Fields", 10, 10, 120, 20)
   GUICtrlSetOnEvent(-1, "On_SearchMenu")
   GUICtrlSetData($searchcombo, "Computer Name|IP Address|Department|Location|Role/User|Model|Removed|Ecycled|BCA|Extension|Last Touched|Install Tech", "All Fields")
   GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
   $searchinput = GUICtrlCreateCombo("", 140, 10, 180, 20)
   GUICtrlSetState($searchinput, $GUI_FOCUS)
   GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
   $searchbutton = GUICtrlCreateButton("Search", 320, 10, 70, 20)
   GUICtrlSetOnEvent($searchbutton, "On_Search")
   GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
   $advsearch = GUICtrlCreateButton("Adv. Search", 390, 10, 70, 20)
   GUICtrlSetOnEvent($advsearch, "On_AdvancedSearchGUI")
   GUICtrlSetState(-1, $GUI_DISABLE)
   GUICtrlSetState($searchbutton, $GUI_DEFBUTTON)
   GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
   Global $removedcb = GUICtrlCreateCheckbox("Removed", 465, 10, 70, 20)
   GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
   Global $ecyclecb = GUICtrlCreateCheckbox("Ecycled", 535, 10, 60, 20)
   GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
   $printcombo = GUICtrlCreateCombo("", 820, 10, 90, 20, $CBS_DROPDOWNLIST)
   GUICtrlSetOnEvent(-1, "On_ExportMenu")
   GUICtrlSetData($printcombo, "Export Menu|All Tabs|Quick View|Computer Tab|Location Tab|Network Tab|Video Tab|Peripheral Tab|CSV", "Export Menu")
   GUICtrlSetState(-1, $GUI_DISABLE)
   GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
   $historybutton = GUICtrlCreateButton("History", 920, 10, 80, 20)
   GUICtrlSetOnEvent(-1, "On_HistoryButton")
   GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
   $directorybutton = GUICtrlCreateButton("KC Directory", 1010, 10, 80, 20)
   GUICtrlSetOnEvent(-1, "KCDirectoryButton")
   GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
   $itdirectorybutton = GUICtrlCreateButton("IT Directory", 1090, 10, 80, 20)
   GUICtrlSetOnEvent($itdirectorybutton, "ITDirectoryButton")
   GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
   $damebutton = GUICtrlCreateButton("*DameWare", 10, 335, 80, 20)
   GUICtrlSetOnEvent(-1, "On_Command")
   GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
   $vncbutton = GUICtrlCreateButton("*VNC", 90, 335, 80, 20)
   GUICtrlSetOnEvent(-1, "On_Command")
   GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
   $dntubutton = GUICtrlCreateButton("*NT Utilities", 170, 335, 80, 20)
   GUICtrlSetOnEvent(-1, "On_Command")
   GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
   $compmgmtbutton = GUICtrlCreateButton("Comp Mgmt", 250, 335, 80, 20)
   GUICtrlSetOnEvent(-1, "On_Command")
   GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
   $pingcompbutton = GUICtrlCreateButton("Ping -t", 330, 335, 80, 20)
   GUICtrlSetOnEvent(-1, "On_Command")
   GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
   $csharebutton = GUICtrlCreateButton("\C$", 410, 335, 80, 20)
   GUICtrlSetOnEvent(-1, "On_Command")
   GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
   $systembutton = GUICtrlCreateButton("Systeminfo", 490, 335, 80, 20)
   GUICtrlSetOnEvent(-1, "On_Command")
   GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
   Global $links = GUICtrlCreateCombo("Useful Links", 580, 335, 100, 20, $CBS_DROPDOWNLIST)
   GUICtrlSetData(-1, "System Center|IP Mgmt|prd-eps1|prd-eps2|dc1|dc2|dc3|Remedy|Pano Mgr|vSphere|Wysemanager|SafeGuard|Password Reset|Voice Files")
   GUICtrlSetOnEvent(-1, "On_UsefulLink")
   GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
   If $admin = TRUE Then
      $usermgmtbutton = GUICtrlCreateButton("User Mgmt", 830, 335, 80, 20)
      GUICtrlSetOnEvent(-1, "On_AdminButton")
      GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
      $viewcompbutton = GUICtrlCreateButton("Saved Comp", 910, 335, 80, 20)
      GUICtrlSetOnEvent(-1, "On_AdminButton")
      GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
      $interfacebutton = GUICtrlCreateButton("Edit Menus", 990, 335, 80, 20)
      GUICtrlSetOnEvent(-1, "On_AdminButton")
      GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
      $changeslogbutton = GUICtrlCreateButton("Changes Log", 1070, 335, 80, 20)
      GUICtrlSetOnEvent(-1, "On_AdminButton")
      GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
   EndIf

   $statuslabel = GUICtrlCreateLabel("Ready", 1, 365, 1179, 15, $SS_SUNKEN) ;BitOR($SS_CENTER, $SS_SUNKEN));BitOR($SS_SIMPLE, $SS_SUNKEN))
   GUICtrlSetBkColor($statuslabel, $statusgreen) ;change status light to GREEN
   GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKLEFT + $GUI_DOCKHEIGHT)

   $adminlabel = GUICtrlCreateLabel("Admin", 700, 53, 50, 15, BitOr($SS_NOTIFY, $SS_CENTER))
   GUICtrlSetOnEvent(-1, "On_AdminLabel")
   GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
   GUICtrlSetBkColor($adminlabel, 0xFFCC00)
   $provlabel = GUICtrlCreateLabel("Provider", 750, 53, 50, 15, $SS_CENTER)
   GUICtrlSetOnEvent(-1, "On_ProviderLabel")
   GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
   GUICtrlSetBkColor($provlabel, 0xD1BED8)
   $pmanlabel = GUICtrlCreateLabel("Manager", 800, 53, 50, 15, $SS_CENTER)
   GUICtrlSetOnEvent(-1, "On_ManagerLabel")
   GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
   GUICtrlSetBkColor($pmanlabel, 0xCCFFFF) ;FFFF66
   $remlabel = GUICtrlCreateLabel("Removed", 850, 53, 50, 15, $SS_CENTER)
   GUICtrlSetOnEvent(-1, "On_RemovedLabel")
   GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
   GUICtrlSetBkColor($remlabel, 0xFFFF66) ;AAAAAA
   $bcalabel = GUICtrlCreateLabel("BCA", 950, 53, 50, 15, $SS_CENTER)
   GUICtrlSetOnEvent(-1, "On_BCALabel")
   GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
   GUICtrlSetBkColor($bcalabel, 0xFF0000) ;AAAAAA
   $ecylabel = GUICtrlCreateLabel("Ecycled", 900, 53, 50, 15, $SS_CENTER)
   GUICtrlSetOnEvent(-1, "On_EcycledLabel")
   GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
   GUICtrlSetBkColor($ecylabel, 0x66FF00) ;AAAAAA

   ;-------- Switch Section -------------------------------
   $maintabGUI = GUICreate("", 1180, 70, 0, 0, $WS_CHILD, -1, BitOr($mainGUI,$WS_SIZEBOX));$mainGUI)
   ;GUISetBkColor(0xEEEEEE, $maintabGUI)
   Global $squickviewbutton = GUICtrlCreateButton("Quick View", 10, 50, 70, 20)
   GUICtrlSetOnEvent(-1, "On_Switch")
   GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
   Global $sprinterbutton = GUICtrlCreateButton("Printer Info", 80, 50, 70, 20)
   GUICtrlSetOnEvent(-1, "On_Switch")
   GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
   Global $scomputerbutton = GUICtrlCreateButton("Computer Info", 150, 50, 80, 20)
   GUICtrlSetOnEvent(-1, "On_Switch")
   GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
   Global $slocationbutton = GUICtrlCreateButton("Location Info", 230, 50, 80, 20)
   GUICtrlSetOnEvent(-1, "On_Switch")
   GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
   Global $snetworkbutton = GUICtrlCreateButton("Network Info", 310, 50, 70, 20)
   GUICtrlSetOnEvent(-1, "On_Switch")
   GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
   Global $svideobutton = GUICtrlCreateButton("Video Info", 380, 50, 60, 20)
   GUICtrlSetOnEvent(-1, "On_Switch")
   GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
   Global $speriphbutton = GUICtrlCreateButton("Peripheral Info", 440, 50, 80, 20)
   GUICtrlSetOnEvent(-1, "On_Switch")
   GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
   Global $svconfbutton = GUICtrlCreateButton("Video Conference", 520, 50, 100, 20)
   GUICtrlSetOnEvent(-1, "On_Switch")
   GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
   Global $sncountbutton = GUICtrlCreateButton("Node Count", 620, 50, 70, 20)
   GUICtrlSetOnEvent(-1, "On_Switch")
   GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
   GUISetState()

   ;add column
   ;-------- Quick view section
   $quickviewtabGUI = GUICreate("", 1180, 395, 0, 0, $WS_CHILD, -1, $mainGUI);BitOR($mainGUI, $WS_SIZEBOX))
   ;GUISetBkColor(0xEEEEEEE, $quickviewtabGUI)
   $quickviewlistview = GUICtrlCreateListView("Computer Name|IP Address|Department|Location|Role/User|Extension|Model|Install Date|Last Touched|PT/SR|Removed|Ecycled|BCA|Serv Tag" _
   , 10, 75, 1160, 210)
   GUICtrlSendMsg($quickviewlistview, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_GRIDLINES, $LVS_EX_GRIDLINES)
   GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKRIGHT)
   $listview = $quickviewlistview
   $newnamebutton = GUICtrlCreateButton("*Get New Name", 10, 295, 100, 20)
   GUICtrlSetOnEvent(-1, "On_Button")
   GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKHEIGHT + $GUI_DOCKWIDTH + $GUI_DOCKLEFT)
   $addcompbutton = GUICtrlCreateButton("Add Computer", 110, 295, 100, 20)
   GUICtrlSetOnEvent(-1, "On_Button")
   GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKHEIGHT + $GUI_DOCKWIDTH + $GUI_DOCKLEFT)
   $editcompbutton = GUICtrlCreateButton("Edit Computer", 210, 295, 100, 20)
   GUICtrlSetOnEvent(-1, "On_Button")
   GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKHEIGHT + $GUI_DOCKWIDTH + $GUI_DOCKLEFT)
   GUICtrlSetState($editcompbutton, $GUI_DISABLE)
   $replacecompbutton = GUICtrlCreateButton("Replace Computer", 310, 295, 100, 20)
   GUICtrlSetOnEvent(-1, "On_Button")
   GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKHEIGHT + $GUI_DOCKWIDTH + $GUI_DOCKLEFT)
   GUICtrlSetState($replacecompbutton, $GUI_DISABLE)
   $removecompbutton = GUICtrlCreateButton("Remove Computer", 410, 295, 100, 20)
   GUICtrlSetOnEvent(-1, "On_Button")
   GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKHEIGHT + $GUI_DOCKWIDTH + $GUI_DOCKLEFT)
   GUICtrlSetState($removecompbutton, $GUI_DISABLE)
   $ecyclecompbutton = GUICtrlCreateButton("Ecycle", 510, 295, 100, 20)
   GUICtrlSetOnEvent(-1, "On_Button")
   GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKHEIGHT + $GUI_DOCKWIDTH + $GUI_DOCKLEFT)
   GUICtrlSetState($ecyclecompbutton, $GUI_DISABLE)
   $addptsrbutton = GUICtrlCreateButton("Add PT/SR", 620, 295, 100, 20)
   GUICtrlSetOnEvent(-1, "On_Button")
   GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKHEIGHT + $GUI_DOCKWIDTH + $GUI_DOCKLEFT)
   GUICtrlSetState(-1, $GUI_DISABLE)
   $complogbutton = GUICtrlCreateButton("Computer Log", 720, 295, 100, 20)
   GUICtrlSetOnEvent(-1, "On_Button")
   GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKHEIGHT + $GUI_DOCKWIDTH + $GUI_DOCKLEFT)
   $softwarebutton = GUICtrlCreateButton("Software", 820, 295, 100, 20)
   GUICtrlSetOnEvent(-1, "On_Button")
   GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKHEIGHT + $GUI_DOCKWIDTH + $GUI_DOCKLEFT)
   $pwdresetbutton = GUICtrlCreateButton("Pwd Reset", 920, 295, 100, 20)
   GUICtrlSetOnEvent(-1, "On_Button")
   GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKHEIGHT + $GUI_DOCKWIDTH + $GUI_DOCKLEFT)
   If $readonly = True Then
      GUICtrlSetState($newnamebutton, $GUI_DISABLE)
      GUICtrlSetState($addcompbutton, $GUI_DISABLE)
   EndIf
   GUISetState()

   ;-------- Printers tab section
   $printerstabGUI = GUICreate("", 1180, 395, 0, 0, $WS_CHILD, -1, $mainGUI);BitOR($mainGUI, $WS_SIZEBOX))
   $printerlistview = GUICtrlCreateListView("Computer Name|Printer Name|IP Address|Location|Server Name|Driver Name|Driver Version|Notes|Is Shared|Share Name|Model|S#" _
   , 10, 75, 1160, 210)
   GUICtrlSendMsg($printerlistview, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_GRIDLINES, $LVS_EX_GRIDLINES)
   GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKRIGHT)
   $addprinterbutton = GUICtrlCreateButton("Add Printer", 10, 295, 100, 20)
   GUICtrlSetOnEvent(-1, "On_Button")
   GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKHEIGHT + $GUI_DOCKWIDTH + $GUI_DOCKLEFT)
   GUICtrlSetState($addprinterbutton, $GUI_DISABLE)
   $editprinterbutton = GUICtrlCreateButton("Edit Printer", 110, 295, 100, 20)
   GUICtrlSetOnEvent(-1, "On_Button")
   GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKHEIGHT + $GUI_DOCKWIDTH + $GUI_DOCKLEFT)
   GUICtrlSetState($editprinterbutton, $GUI_DISABLE)
   $replaceprinterbutton = GUICtrlCreateButton("Replace Printer", 210, 295, 100, 20)
   GUICtrlSetOnEvent(-1, "On_Button")
   GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKHEIGHT + $GUI_DOCKWIDTH + $GUI_DOCKLEFT)
   GUICtrlSetState($replaceprinterbutton, $GUI_DISABLE)
   $assignprinterbutton = GUICtrlCreateButton("Assign Printer", 310, 295, 100, 20)
   GUICtrlSetOnEvent(-1, "On_Button")
   GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKHEIGHT + $GUI_DOCKWIDTH + $GUI_DOCKLEFT)
   GUICtrlSetState($assignprinterbutton, $GUI_DISABLE)
   $pingprinterbutton = GUICtrlCreateButton("Ping Printer -t", 420, 295, 100, 20)
   GUICtrlSetOnEvent(-1, "On_Button")
   GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKHEIGHT + $GUI_DOCKWIDTH + $GUI_DOCKLEFT)
   $webprinterbutton = GUICtrlCreateButton("Web Interface", 520, 295, 100, 20)
   GUICtrlSetOnEvent(-1, "On_Button")
   GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKHEIGHT + $GUI_DOCKWIDTH + $GUI_DOCKLEFT)
   If $readonly = True Then
      GUICtrlSetState($addprinterbutton, $GUI_DISABLE)
      GUICtrlSetState($editprinterbutton, $GUI_DISABLE)
      GUICtrlSetState($replaceprinterbutton, $GUI_DISABLE)
      GUICtrlSetState($assignprinterbutton, $GUI_DISABLE)
   EndIf
   ;GUISetState()

   ;-------- Computer tab section
   $computertabGUI = GUICreate("", 1180, 395, 0, 0, $WS_CHILD, -1, $mainGUI);BitOR($mainGUI, $WS_SIZEBOX))
   $computerlistview = GUICtrlCreateListView("Computer Name|IP Address|Model|Type|Service Tag|Install Date|Install Type|Install Tech|Domain|Last Touched|Software|OS|Encryption|HD Model|PT/SR|History/Notes|Removed|Ecycled|BCA|Purchased By" _
   , 10, 75, 1160, 210)
   GUICtrlSendMsg($computerlistview, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_GRIDLINES, $LVS_EX_GRIDLINES)
   GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKRIGHT)

   ;-------- Location tab section
   $locationtabGUI = GUICreate("", 1180, 395, 0, 0, $WS_CHILD, -1, $mainGUI);BitOR($mainGUI, $WS_SIZEBOX))
   $locationlistview = GUICtrlCreateListView("Computer Name|Department|Location|Floor|Room|Role/User|Extension" _
   , 10, 75, 1160, 210)
   GUICtrlSendMsg($locationlistview, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_GRIDLINES, $LVS_EX_GRIDLINES)
   GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKRIGHT)

   ;-------- Network tab section
   $networktabGUI = GUICreate("", 1180, 395, 0, 0, $WS_CHILD, -1, $mainGUI);BitOR($mainGUI, $WS_SIZEBOX))
   $networklistview = GUICtrlCreateListView("Computer Name|MAC Address|CLoset|Switch Name/IP|Cable ID|Switch Port|Cable Type" _
   , 10, 75, 1160, 210)
   GUICtrlSendMsg($networklistview, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_GRIDLINES, $LVS_EX_GRIDLINES)
   GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKRIGHT)

   ;-------- Video tab section
   $videotabGUI = GUICreate("", 1180, 395, 0, 0, $WS_CHILD, -1, $mainGUI);BitOR($mainGUI, $WS_SIZEBOX))
   $videolistview = GUICtrlCreateListView("Computer Name|Video Card|Monitor Qty|Monitor1|Monitor2|Monitor3|Monitor4|Cable Type" _
   , 10, 75, 1160, 210)
   GUICtrlSendMsg($videolistview, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_GRIDLINES, $LVS_EX_GRIDLINES)
   GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKRIGHT)
   $monitorwarrantybutton = GUICtrlCreateButton("Check Warranty", 10, 295, 100, 20)
   GUICtrlSetOnEvent(-1, "On_Button")
   GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKHEIGHT + $GUI_DOCKWIDTH + $GUI_DOCKLEFT)
   If $readonly = True Then
      GUICtrlSetState($monitorwarrantybutton, $GUI_DISABLE)
   EndIf

   ;-------- Peripherlas tab section
   $periphtabGUI = GUICreate("", 1180, 395, 0, 0, $WS_CHILD, -1, $mainGUI)
   $periphlistview = GUICtrlCreateListView("Computer Name|Default Printer|Network Printer|Local Printer|BCA|Desk Scanner|Barcode Scanner|Speechmic|Webcam|E-sig Pad|Credit Card Reader|Labeler|External DVD|Other" _
   , 10, 75, 1160, 210)
   GUICtrlSendMsg($periphlistview, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_GRIDLINES, $LVS_EX_GRIDLINES)
   GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKRIGHT)

   ;-------- Video Conference tab
   $vconftabGUI = GUICreate("", 1180, 395, 0, 0, $WS_CHILD, -1, $mainGUI)
   $vconflistview = GUICtrlCreateListView("Model|Password|Location|Internal IP|External IP|Service Provided By" _
   , 10, 75, 1160, 210)
   GUICtrlSendMsg($vconflistview, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_GRIDLINES, $LVS_EX_GRIDLINES)
   GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKRIGHT)

   ;-------- Peripheral Count tab
   $pericounttabGUI = GUICreate("", 1180, 395, 0, 0, $WS_CHILD, -1, $mainGUI)
   $pericountlistview = GUICtrlCreateListView("Network Printers|Local Printers|Desk Scanners|Barcode Scanners|SpeechMics|Webcams|E-sig Pads|Credit Card Readers|Labeler|External DVD|Other|Total" _
   , 10, 75, 1160, 210)
   GUICtrlSendMsg($pericountlistview, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_GRIDLINES, $LVS_EX_GRIDLINES)
   GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKRIGHT)

   GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")
   GUIRegisterMsg($WM_SIZE, "WM_SIZE")
   GUICtrlSetState($squickviewbutton, $GUI_DISABLE)
   GUISwitch($mainGUI)
   GUISetState()
   Global $B_DESCENDING[_GUICtrlListView_GetColumnCount($quickviewlistview)]
   While 1
      Sleep(100)
   WEnd

EndFunc

Func On_Switch()

   Switch @GUI_CtrlId
      Case $squickviewbutton
         $listview = $quickviewlistview
         GUICtrlSetState($squickviewbutton, $GUI_DISABLE)
         GUICtrlSetState($sprinterbutton, $GUI_ENABLE)
         GUICtrlSetState($scomputerbutton, $GUI_ENABLE)
         GUICtrlSetState($slocationbutton, $GUI_ENABLE)
         GUICtrlSetState($snetworkbutton, $GUI_ENABLE)
         GUICtrlSetState($svideobutton, $GUI_ENABLE)
         GUICtrlSetState($speriphbutton, $GUI_ENABLE)
         GUICtrlSetState($svconfbutton, $GUI_ENABLE)
         GUICtrlSetState($sncountbutton, $GUI_ENABLE)
         GUISetState(@SW_SHOW,$quickviewtabGUI)
         GUISetState(@SW_HIDE,$printerstabGUI)
         GUISetState(@SW_HIDE,$computertabGUI)
         GUISetState(@SW_HIDE,$locationtabGUI)
         GUISetState(@SW_HIDE,$networktabGUI)
         GUISetState(@SW_HIDE,$videotabGUI)
         GUISetState(@SW_HIDE,$periphtabGUI)
         GUISetState(@SW_HIDE,$vconftabGUI)
         GUISetState(@SW_HIDE,$pericounttabGUI)
      Case $sprinterbutton
         $listview = $printerlistview
         GUICtrlSetState($squickviewbutton, $GUI_ENABLE)
         GUICtrlSetState($sprinterbutton, $GUI_DISABLE)
         GUICtrlSetState($scomputerbutton, $GUI_ENABLE)
         GUICtrlSetState($slocationbutton, $GUI_ENABLE)
         GUICtrlSetState($snetworkbutton, $GUI_ENABLE)
         GUICtrlSetState($svideobutton, $GUI_ENABLE)
         GUICtrlSetState($speriphbutton, $GUI_ENABLE)
         GUICtrlSetState($svconfbutton, $GUI_ENABLE)
         GUICtrlSetState($sncountbutton, $GUI_ENABLE)
         GUISetState(@SW_HIDE,$quickviewtabGUI)
         GUISetState(@SW_SHOW,$printerstabGUI)
         GUISetState(@SW_HIDE,$computertabGUI)
         GUISetState(@SW_HIDE,$locationtabGUI)
         GUISetState(@SW_HIDE,$networktabGUI)
         GUISetState(@SW_HIDE,$videotabGUI)
         GUISetState(@SW_HIDE,$periphtabGUI)
         GUISetState(@SW_HIDE,$vconftabGUI)
         GUISetState(@SW_HIDE,$pericounttabGUI)
      Case $scomputerbutton
         $listview = $computerlistview
         GUICtrlSetState($squickviewbutton, $GUI_ENABLE)
         GUICtrlSetState($sprinterbutton, $GUI_ENABLE)
         GUICtrlSetState($scomputerbutton, $GUI_DISABLE)
         GUICtrlSetState($slocationbutton, $GUI_ENABLE)
         GUICtrlSetState($snetworkbutton, $GUI_ENABLE)
         GUICtrlSetState($svideobutton, $GUI_ENABLE)
         GUICtrlSetState($speriphbutton, $GUI_ENABLE)
         GUICtrlSetState($svconfbutton, $GUI_ENABLE)
         GUICtrlSetState($sncountbutton, $GUI_ENABLE)
         GUISetState(@SW_HIDE,$quickviewtabGUI)
         GUISetState(@SW_HIDE,$printerstabGUI)
         GUISetState(@SW_SHOW,$computertabGUI)
         GUISetState(@SW_HIDE,$locationtabGUI)
         GUISetState(@SW_HIDE,$networktabGUI)
         GUISetState(@SW_HIDE,$videotabGUI)
         GUISetState(@SW_HIDE,$periphtabGUI)
         GUISetState(@SW_HIDE,$vconftabGUI)
         GUISetState(@SW_HIDE,$pericounttabGUI)
      Case $slocationbutton
         $listview = $locationlistview
         GUICtrlSetState($squickviewbutton, $GUI_ENABLE)
         GUICtrlSetState($sprinterbutton, $GUI_ENABLE)
         GUICtrlSetState($scomputerbutton, $GUI_ENABLE)
         GUICtrlSetState($slocationbutton, $GUI_DISABLE)
         GUICtrlSetState($snetworkbutton, $GUI_ENABLE)
         GUICtrlSetState($svideobutton, $GUI_ENABLE)
         GUICtrlSetState($speriphbutton, $GUI_ENABLE)
         GUICtrlSetState($svconfbutton, $GUI_ENABLE)
         GUICtrlSetState($sncountbutton, $GUI_ENABLE)
         GUISetState(@SW_HIDE,$quickviewtabGUI)
         GUISetState(@SW_HIDE,$printerstabGUI)
         GUISetState(@SW_HIDE,$computertabGUI)
         GUISetState(@SW_SHOW,$locationtabGUI)
         GUISetState(@SW_HIDE,$networktabGUI)
         GUISetState(@SW_HIDE,$videotabGUI)
         GUISetState(@SW_HIDE,$periphtabGUI)
         GUISetState(@SW_HIDE,$vconftabGUI)
         GUISetState(@SW_HIDE,$pericounttabGUI)
      Case $snetworkbutton
         $listview = $networklistview
         GUICtrlSetState($squickviewbutton, $GUI_ENABLE)
         GUICtrlSetState($sprinterbutton, $GUI_ENABLE)
         GUICtrlSetState($scomputerbutton, $GUI_ENABLE)
         GUICtrlSetState($slocationbutton, $GUI_ENABLE)
         GUICtrlSetState($snetworkbutton, $GUI_DISABLE)
         GUICtrlSetState($svideobutton, $GUI_ENABLE)
         GUICtrlSetState($speriphbutton, $GUI_ENABLE)
         GUICtrlSetState($svconfbutton, $GUI_ENABLE)
         GUICtrlSetState($sncountbutton, $GUI_ENABLE)
         GUISetState(@SW_HIDE,$quickviewtabGUI)
         GUISetState(@SW_HIDE,$printerstabGUI)
         GUISetState(@SW_HIDE,$computertabGUI)
         GUISetState(@SW_HIDE,$locationtabGUI)
         GUISetState(@SW_SHOW,$networktabGUI)
         GUISetState(@SW_HIDE,$videotabGUI)
         GUISetState(@SW_HIDE,$periphtabGUI)
         GUISetState(@SW_HIDE,$vconftabGUI)
         GUISetState(@SW_HIDE,$pericounttabGUI)
      Case $svideobutton
         $listview = $videolistview
         GUICtrlSetState($squickviewbutton, $GUI_ENABLE)
         GUICtrlSetState($sprinterbutton, $GUI_ENABLE)
         GUICtrlSetState($scomputerbutton, $GUI_ENABLE)
         GUICtrlSetState($slocationbutton, $GUI_ENABLE)
         GUICtrlSetState($snetworkbutton, $GUI_ENABLE)
         GUICtrlSetState($svideobutton, $GUI_DISABLE)
         GUICtrlSetState($speriphbutton, $GUI_ENABLE)
         GUICtrlSetState($svconfbutton, $GUI_ENABLE)
         GUICtrlSetState($sncountbutton, $GUI_ENABLE)
         GUISetState(@SW_HIDE,$quickviewtabGUI)
         GUISetState(@SW_HIDE,$printerstabGUI)
         GUISetState(@SW_HIDE,$computertabGUI)
         GUISetState(@SW_HIDE,$locationtabGUI)
         GUISetState(@SW_HIDE,$networktabGUI)
         GUISetState(@SW_SHOW,$videotabGUI)
         GUISetState(@SW_HIDE,$periphtabGUI)
         GUISetState(@SW_HIDE,$vconftabGUI)
         GUISetState(@SW_HIDE,$pericounttabGUI)
      Case $speriphbutton
         $listview = $periphlistview
         GUICtrlSetState($squickviewbutton, $GUI_ENABLE)
         GUICtrlSetState($sprinterbutton, $GUI_ENABLE)
         GUICtrlSetState($scomputerbutton, $GUI_ENABLE)
         GUICtrlSetState($slocationbutton, $GUI_ENABLE)
         GUICtrlSetState($snetworkbutton, $GUI_ENABLE)
         GUICtrlSetState($svideobutton, $GUI_ENABLE)
         GUICtrlSetState($speriphbutton, $GUI_DISABLE)
         GUICtrlSetState($svconfbutton, $GUI_ENABLE)
         GUICtrlSetState($sncountbutton, $GUI_ENABLE)
         GUISetState(@SW_HIDE,$quickviewtabGUI)
         GUISetState(@SW_HIDE,$printerstabGUI)
         GUISetState(@SW_HIDE,$computertabGUI)
         GUISetState(@SW_HIDE,$locationtabGUI)
         GUISetState(@SW_HIDE,$networktabGUI)
         GUISetState(@SW_HIDE,$videotabGUI)
         GUISetState(@SW_SHOW,$periphtabGUI)
         GUISetState(@SW_HIDE,$vconftabGUI)
         GUISetState(@SW_HIDE,$pericounttabGUI)
      Case $svconfbutton
         GUICtrlSetState($squickviewbutton, $GUI_ENABLE)
         GUICtrlSetState($sprinterbutton, $GUI_ENABLE)
         GUICtrlSetState($scomputerbutton, $GUI_ENABLE)
         GUICtrlSetState($slocationbutton, $GUI_ENABLE)
         GUICtrlSetState($snetworkbutton, $GUI_ENABLE)
         GUICtrlSetState($svideobutton, $GUI_ENABLE)
         GUICtrlSetState($speriphbutton, $GUI_ENABLE)
         GUICtrlSetState($svconfbutton, $GUI_DISABLE)
         GUICtrlSetState($sncountbutton, $GUI_ENABLE)
         GUISetState(@SW_HIDE,$quickviewtabGUI)
         GUISetState(@SW_HIDE,$printerstabGUI)
         GUISetState(@SW_HIDE,$computertabGUI)
         GUISetState(@SW_HIDE,$locationtabGUI)
         GUISetState(@SW_HIDE,$networktabGUI)
         GUISetState(@SW_HIDE,$videotabGUI)
         GUISetState(@SW_HIDE,$periphtabGUI)
         GUISetState(@SW_SHOW,$vconftabGUI)
         GUISetState(@SW_HIDE,$pericounttabGUI)
         If $loaded = False Then
            For $i = 1 To $vconfArray[0]
               $vcItem[$i] = GUICtrlCreateListViewItem($vconfArray[$i], $vconflistview)
            Next
            $loaded = True
         EndIf
      Case $sncountbutton
         GUICtrlSetState($squickviewbutton, $GUI_ENABLE)
         GUICtrlSetState($sprinterbutton, $GUI_ENABLE)
         GUICtrlSetState($scomputerbutton, $GUI_ENABLE)
         GUICtrlSetState($slocationbutton, $GUI_ENABLE)
         GUICtrlSetState($snetworkbutton, $GUI_ENABLE)
         GUICtrlSetState($svideobutton, $GUI_ENABLE)
         GUICtrlSetState($speriphbutton, $GUI_ENABLE)
         GUICtrlSetState($svconfbutton, $GUI_ENABLE)
         GUICtrlSetState($sncountbutton, $GUI_DISABLE)
         GUISetState(@SW_HIDE,$quickviewtabGUI)
         GUISetState(@SW_HIDE,$printerstabGUI)
         GUISetState(@SW_HIDE,$computertabGUI)
         GUISetState(@SW_HIDE,$locationtabGUI)
         GUISetState(@SW_HIDE,$networktabGUI)
         GUISetState(@SW_HIDE,$videotabGUI)
         GUISetState(@SW_HIDE,$periphtabGUI)
         GUISetState(@SW_HIDE,$vconftabGUI)
         GUISetState(@SW_SHOW,$pericounttabGUI)
         If $periloaded = False Then
            $periItem[0] = GUICtrlCreateListViewItem($periphstring, $pericountlistview)
            $periloaded = True
         EndIf
   EndSwitch

EndFunc

Func WM_SIZE($hWnd, $iMsg, $wParam, $lParam)
   Local $nWidth = BitAND($lParam, 0xFFFF)
   Local $nHeight = BitShift($lParam, 16)

   WinMove($quickviewtabGUI, 0, 0, 0, $nWidth, $nHeight)
   WinMove($printerstabGUI, 0, 0, 0, $nWidth, $nHeight)
   WinMove($computertabGUI, 0, 0, 0, $nWidth, $nHeight)
   WinMove($locationtabGUI, 0, 0, 0, $nWidth, $nHeight)
   WinMove($networktabGUI, 0, 0, 0, $nWidth, $nHeight)
   WinMove($videotabGUI, 0, 0, 0, $nWidth, $nHeight)
   WinMove($periphtabGUI, 0, 0, 0, $nWidth, $nHeight)
   WinMove($vconftabGUI, 0, 0, 0, $nWidth, $nHeight)
   WinMove($pericounttabGUI, 0, 0, 0, $nWidth, $nHeight)

   Return $GUI_RUNDEFMSG
EndFunc

Func On_Close()

   Switch @GUI_WinHandle ; See which GUI sent the CLOSE message
      Case $mainGUI
         GUIDelete($mainGUI)
         Exit ; If it was this GUI - we exit
   EndSwitch

EndFunc ;==> End of On_Close()

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×