Jump to content
Sign in to follow this  
Smudley

Help Refreshing GUI

Recommended Posts

Smudley

I'm lost on this program and I haven't found any post that defines my situation.

When I select Items on the left

post-1789-1249675805272_thumb.png

Its suppose to changr the items on the right

post-1789-12496758067034_thumb.png

But after doing it several times it does this.

post-1789-1249675803989_thumb.png

What am I doing wrong?

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <GuiImageList.au3>
#include <GUIListBox.au3>
#include <GuiStatusBar.au3>
#include <GuiToolbar.au3>
#include <ImageListConstants.au3>
#include <StaticConstants.au3>
#include <ToolbarConstants.au3>
#include <WindowsConstants.au3>


global $UserID, $Group2, $Group3, $Checkbox1, $Checkbox2, $Checkbox3, $Checkbox4, $Checkbox5, $Checkbox6
Global $Label2, $Label3, $Label4, $Label5, $Label6, $Label7, $Label8, $Label9, $Label10, $Input2, $Input3
Global $Input4,$Input5,$Input6,$Input7,$Input8,$Input9,$Button3,$Button4, $List2a, $List3a, $Group2a
Global $Group3a, $Button3a, $Button4a, $Button5a, $Label2a, $Label3a

If $UserID = "" then
    $UserID = @UserName
EndIf

$Version = "1.00"
$SelDomain = @LogonDomain
$ScriptPath = @ScriptDir
Global $User_Array
Global $TmpArray
$adsUser_Exist = 0

Check_Install()
Load_Options()

;Disable Terminal Server settings if TSUserConfig.dll is not found
$WTSUserTest = ObjCreate("UserConfig.TSUserConfig")
If @ERROR then
    $WTSCheck = 0
Else
    $WTSCheck = 1
EndIf
$WTSUserTest = "Nothing"

;Make sure the logged on user has a profile
If Not FileExists($ScriptPath & "\Profiles\" & $UserID & ".ini") then
    If IniRead($ScriptPath & "\Config.ini","General","Used", "") = 0 then
        FileCopy ($ScriptPath & "\Profiles\Default.ini", $ScriptPath & "\Profiles\" & $UserID & ".ini")
        MsgBox ( 0, $UserID & " Profile Created", "This is the first time this program has been run.  A new profile has been created for this user.")
    Else
        MsgBox ( 0, "No Profile Defined - " & $UserID, "You cannot use this utility until there is a profile defined for this UserID.")
        Exit 103
    EndIf
EndIf

#Region ### START Koda GUI section ### Form=D:\kixtart\UsrMgr\AutoIT\UsrMgrMain.kxf
$Form1_1 = GUICreate("User Manager - ", 601, 512, -1, -1)
GUISetFont(9, 400, 0, "Verdana")
$ImageList1 = _GUIImageList_Create(32, 32, 5)
_GUIImageList_AddIcon($ImageList1, "D:\kixtart\UsrMgr\AutoIT\adduser2.ico", 0, True)
_GUIImageList_AddIcon($ImageList1, "D:\kixtart\UsrMgr\AutoIT\deleteuser2.ico", 0, True)
_GUIImageList_AddIcon($ImageList1, "D:\kixtart\UsrMgr\AutoIT\domain.ico", 0, True)
_GUIImageList_AddIcon($ImageList1, "D:\kixtart\UsrMgr\AutoIT\Process1.ico", 0, True)
_GUIImageList_AddIcon($ImageList1, "D:\kixtart\UsrMgr\AutoIT\Reload.ico", 0, True)
_GUIImageList_AddIcon($ImageList1, "D:\kixtart\UsrMgr\AutoIT\Save.ico", 0, True)
$ToolBar1 = _GUICtrlToolbar_Create($Form1_1, 0)
_GUICtrlToolbar_SetImageList($ToolBar1, $ImageList1)
_GUICtrlToolbar_AddButton($ToolBar1, 0, 5)
_GUICtrlToolbar_AddButton($ToolBar1, 0, 3)
_GUICtrlToolbar_AddButton($ToolBar1, 0, 6)
_GUICtrlToolbar_AddButton($ToolBar1, 0, 2)
_GUICtrlToolbar_AddButton($ToolBar1, 0, 7)
_GUICtrlToolbar_AddButton($ToolBar1, 0, 0)
_GUICtrlToolbar_AddButton($ToolBar1, 0, 1)
_GUICtrlToolbar_AddButton($ToolBar1, 0, 4)
$List1 = GUICtrlCreateList("", 0, 56, 137, 398, $WS_BORDER)
GUICtrlSetData(-1, "General|Group Membership|Email|Terminal Server|User Properties|User Notes")
$Group1 = GUICtrlCreateGroup("UserID:", 144, 48, 449, 65)
GUICtrlSetFont(-1, 9, 800, 0, "Verdana")
$Label1 = GUICtrlCreateLabel("Username:", 152, 72, 73, 18)
GUICtrlSetFont(-1, 9, 400, 0, "Verdana")
$Input1 = GUICtrlCreateInput("", 224, 72, 161, 22)
GUICtrlSetFont(-1, 9, 400, 0, "Verdana")
$Button1 = GUICtrlCreateButton("Search", 400, 72, 75, 25, 0)
GUICtrlSetFont(-1, 9, 400, 0, "Verdana")
$Button2 = GUICtrlCreateButton("User Lookup", 488, 72, 99, 25, 0)
GUICtrlSetFont(-1, 9, 400, 0, "Verdana")
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Label11 = GUICtrlCreateLabel("Current Domain:", 10, 464, 109, 18)
GUICtrlSetFont(-1, 9, 800, 0, "Verdana")
$Label12 = GUICtrlCreateLabel(@LogonDomain, 130, 464, 90, 18)
$MenuItem1 = GUICtrlCreateMenu("&File")
$MenuItem5 = GUICtrlCreateMenuItem("&Exit", $MenuItem1)
$MenuItem2 = GUICtrlCreateMenu("&Log")
$MenuItem6 = GUICtrlCreateMenuItem("&Show Log", $MenuItem2)
$MenuItem7 = GUICtrlCreateMenuItem("&Clear Log", $MenuItem2)
$MenuItem3 = GUICtrlCreateMenu("&Tools")
$MenuItem9 = GUICtrlCreateMenuItem("&Options", $MenuItem3)
$MenuItem8 = GUICtrlCreateMenuItem("&Security", $MenuItem3)
$MenuItem4 = GUICtrlCreateMenu("&Help")
$MenuItem10 = GUICtrlCreateMenuItem("&About", $MenuItem4)
GUICtrlSetState ( $List1, $GUI_CHECKED)

GUISetState(@SW_SHOW)

#EndRegion ### END Koda GUI section ###
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $List1
            $menutext = GUICtrlRead($List1)
            Select
                Case $menutext = "General"
                    _group_hide()
                    _general_show()

                    $Group2 = GUICtrlCreateGroup("Details:", 144, 120, 449, 329)
                    GUICtrlSetFont(-1, 9, 800, 0, "Verdana")
                    $Group3 = GUICtrlCreateGroup("", 200, 328, 337, 113)
                    $Checkbox1 = GUICtrlCreateCheckbox("Account Disabled", 208, 344, 129, 17)
                    GUICtrlSetFont(-1, 9, 400, 0, "Verdana")
                    $Checkbox2 = GUICtrlCreateCheckbox("Account Locked", 208, 376, 129, 17)
                    GUICtrlSetFont(-1, 9, 400, 0, "Verdana")
                    $Checkbox3 = GUICtrlCreateCheckbox("Password Expired", 208, 408, 137, 17)
                    GUICtrlSetFont(-1, 9, 400, 0, "Verdana")
                    $Checkbox4 = GUICtrlCreateCheckbox("User cannot change PW", 352, 344, 177, 17)
                    GUICtrlSetFont(-1, 9, 400, 0, "Verdana")
                    $Checkbox5 = GUICtrlCreateCheckbox("Password never expires", 352, 376, 177, 17)
                    GUICtrlSetFont(-1, 9, 400, 0, "Verdana")
                    $Checkbox6 = GUICtrlCreateCheckbox("Allow Dialin / VPN", 352, 408, 145, 17)
                    GUICtrlSetFont(-1, 9, 400, 0, "Verdana")
                    GUICtrlCreateGroup("", -99, -99, 1, 1)
                    $Label2 = GUICtrlCreateLabel("Full Name:", 152, 152, 65, 17)
                    GUICtrlSetFont(-1, 8, 400, 0, "Verdana")
                    $Label3 = GUICtrlCreateLabel("Description:", 152, 176, 73, 17)
                    GUICtrlSetFont(-1, 8, 400, 0, "Verdana")
                    $Label4 = GUICtrlCreateLabel("Expire Date:", 152, 208, 76, 17)
                    GUICtrlSetFont(-1, 8, 400, 0, "Verdana")
                    $Label5 = GUICtrlCreateLabel("Logon To:", 152, 248, 61, 17)
                    GUICtrlSetFont(-1, 8, 400, 0, "Verdana")
                    $Label6 = GUICtrlCreateLabel("Password:", 384, 152, 63, 17)
                    GUICtrlSetFont(-1, 8, 400, 0, "Verdana")
                    $Label7 = GUICtrlCreateLabel("Confirm:", 384, 184, 55, 17)
                    GUICtrlSetFont(-1, 8, 400, 0, "Verdana")
                    $Label8 = GUICtrlCreateLabel("Logon Script:", 384, 216, 80, 17)
                    GUICtrlSetFont(-1, 8, 400, 0, "Verdana")
                    $Label9 = GUICtrlCreateLabel("Bad Logins:", 384, 248, 71, 17)
                    GUICtrlSetFont(-1, 8, 400, 0, "Verdana")
                    $Input2 = GUICtrlCreateInput("", 232, 144, 121, 21)
                    GUICtrlSetFont(-1, 8, 400, 0, "Verdana")
                    $Input3 = GUICtrlCreateInput("", 232, 176, 121, 21)
                    GUICtrlSetFont(-1, 8, 400, 0, "Verdana")
                    $Input4 = GUICtrlCreateInput("", 232, 208, 81, 21)
                    GUICtrlSetFont(-1, 8, 400, 0, "Verdana")
                    $Input5 = GUICtrlCreateInput("", 232, 240, 121, 21)
                    GUICtrlSetFont(-1, 8, 400, 0, "Verdana")
                    $Input6 = GUICtrlCreateInput("", 464, 144, 121, 21)
                    GUICtrlSetFont(-1, 8, 400, 0, "Verdana")
                    $Input7 = GUICtrlCreateInput("", 464, 176, 121, 21)
                    GUICtrlSetFont(-1, 8, 400, 0, "Verdana")
                    $Input8 = GUICtrlCreateInput("", 464, 208, 121, 21)
                    GUICtrlSetFont(-1, 8, 400, 0, "Verdana")
                    $Input9 = GUICtrlCreateInput("", 464, 240, 121, 21)
                    GUICtrlSetFont(-1, 8, 400, 0, "Verdana")
                    $Label10 = GUICtrlCreateLabel("mm/dd/yyyy", 320, 216, 58, 14)
                    GUICtrlSetFont(-1, 6, 400, 0, "Verdana")
                    $Button3 = GUICtrlCreateButton("Add", 232, 272, 51, 25, 0)
                    GUICtrlSetFont(-1, 9, 400, 0, "Verdana")
                    $Button4 = GUICtrlCreateButton("Del", 288, 272, 51, 25, 0)
                    GUICtrlSetFont(-1, 9, 400, 0, "Verdana")
                    GUICtrlCreateGroup("", -99, -99, 1, 1)
                
                Case $menutext = "Group Membership"
                    _general_hide()                
                    _group_show()

                    $List2a = GUICtrlCreateList("", 144, 120, 192, 286, BitOR($LBS_SORT,$LBS_STANDARD,$WS_VSCROLL,$WS_BORDER))
                    $List3a = GUICtrlCreateList("", 400, 120, 192, 286, BitOR($LBS_SORT,$LBS_STANDARD,$WS_VSCROLL,$WS_BORDER))
                    $Group2a = GUICtrlCreateGroup("", 336, 112, 65, 297)
                    $Button3a = GUICtrlCreateButton("<-----", 344, 256, 51, 25, 0)
                    $Button4a = GUICtrlCreateButton("----->", 344, 288, 51, 25, 0)
                    GUICtrlCreateGroup("", -99, -99, 1, 1)
                    $Group3a = GUICtrlCreateGroup("", 144, 408, 449, 49)
                    $Button5a = GUICtrlCreateButton("Set", 160, 424, 43, 25, 0)
                    GUICtrlSetFont(-1, 8, 400, 0, "Verdana")
                    $Label2a = GUICtrlCreateLabel("Primary Group:", 216, 432, 106, 18)
                    GUICtrlSetFont(-1, 9, 800, 0, "Verdana")
                    $Label3a = GUICtrlCreateLabel("Label3", 328, 432, 118, 18)
                
                Case $menutext = "Email"
                Case $menutext = "Terminal Server"
                Case $menutext = "User Properties"
                Case $menutext = "User Notes"
                            
            Endselect
            

    EndSwitch
WEnd


Func Check_Install() ;Done
    If Not FileExists($ScriptPath & "\Config.ini") then
        IniWrite($ScriptPath & "\Config.ini","ExcludeGroups","Groups","Administrators,Domain Admins")
        IniWrite($ScriptPath & "\Config.ini","NewUserOU","Domain","MyDomain.com")
        IniWrite($ScriptPath & "\Config.ini","NewUserOU","MyDomain","DC=MyDomain,DC=com")
        IniWrite($ScriptPath & "\Config.ini","Email","Domains","MyDomain.com")
        IniWrite($ScriptPath & "\Config.ini","Email","HomeDB1","CN=Mailbox Store (MAILSERVER),CN=Primary Storage Group,CN=InformationStore,")
        IniWrite($ScriptPath & "\Config.ini","Email","HomeDB2","CN=MAILSERVER,CN=Servers,CN=First Administrative Group,CN=Administrative Groups,")
        IniWrite($ScriptPath & "\Config.ini","Email","HomeDB3","CN=MyDomain,CN=Microsoft Exchange,CN=Services,CN=Configuration,")
        IniWrite($ScriptPath & "\Config.ini","Email","HomeDB4","DC=MyDomain,DC=com")
    EndIf
    If Not FileExists($ScriptPath & "\Log") then
        DirCreate($ScriptPath & "\Log")
    EndIF
    If Not FileExists($ScriptPath & "\Profiles") then
        DirCreate($ScriptPath & "\Profiles")
        IniWrite($ScriptPath & "\Profiles\Default.ini","Values","0","No Access")
        IniWrite($ScriptPath & "\Profiles\Default.ini","Values","1","Full Access")
        IniWrite($ScriptPath & "\Profiles\Default.ini","Values","2","View-only Access")
        IniWrite($ScriptPath & "\Profiles\Default.ini","Options","AllowDelEmail","1")
        IniWrite($ScriptPath & "\Profiles\Default.ini","Options","AllowSaveWithNotes","1")
        IniWrite($ScriptPath & "\Profiles\Default.ini","Global","tlbSave","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","Global","tlbStatus","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","Global","tlbChgDomain","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","Global","tlbCreateUser","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","Global","tlbDeleteUser","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","Global","tlbRenameUser","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","Global","lblUserName","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","Global","txtUserName","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","Global","cmdSearch","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","Global","cmdAdvSearch","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","Global","cmdUserLookup","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","Global","frmMain.mnuLog_Show","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","Global","frmMain.mnuLog_Clear","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","Global","frmMain.mnuTools_Options","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","Global","frmMain.mnuTools_Security","1")
        IniWrite($ScriptPath & "\Profiles\Default.ini","Global","grpGeneral","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","Global","grpGroups","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","Global","grpEmail","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","Global","grpWTS","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","Global","grpUser","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","Global","grpNotes","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","General","lblFullName","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","General","txtFullName","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","General","lblDesc","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","General","txtDesc","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","General","lblExpire","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","General","txtExpire","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","General","lblExpire2","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","General","lblLogonTo","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","General","cboLogonTo","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","General","cmdAdd_LogonTo","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","General","cmdDel_LogonTo","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","General","lblPW","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","General","txtPW","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","General","lblPW2","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","General","txtPW2","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","General","lblScript","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","General","txtScript","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","General","lblBadCnt","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","General","txtBadCnt","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","General","chkAcctDisabled","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","General","chkAcctLocked","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","General","chkPWExpired","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","General","chkNoPWChange","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","General","chkNoPWExpire","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","General","chkAllowDialin","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","Group Membership","lstGroup1","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","Group Membership","lstGroup2","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","Group Membership","cmdGroup_Add","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","Group Membership","cmdGroup_Del","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","Group Membership","lblPrimaryGrp","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","Group Membership","cmdSetPrimaryGrp","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","Group Membership","cmdAddHiddenGroup","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","Email","lblEmail","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","Email","lstEmailAddr","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","Email","cmdEmail_Add","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","Email","cmdEmail_Del","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","Email","cmdEmail_Ren","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","Email","chkAcctExists","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","Email","chkAutoUpdAddr","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","Email","cmdEmail_SetReply","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","Email","lblEmail_Reply","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","Email","lblSendLen","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","Email","txtSendLen","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","Email","lblRecvLen","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","Email","txtRecvLen","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","Terminal Server","lblWTSProfileDir","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","Terminal Server","txtWTSProfileDir","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","Terminal Server","lblWTSHomeDir","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","Terminal Server","txtWTSHomeDir","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","Terminal Server","lblWTSHomeDrive","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","Terminal Server","txtWTSHomeDrive","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","Terminal Server","chkAllowWTS","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","User Properties","lblProfileDir","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","User Properties","txtProfileDir","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","User Properties","lblHomeDir","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","User Properties","txtHomeDir","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","User Properties","lblHomeDrive","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","User Properties","txtHomeDrive","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","User Properties","lblLastPWChg","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","User Properties","txtLastPWChg","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","User Properties","lblTitle","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","User Properties","txtTitle","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","User Properties","lblDepartment","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","User Properties","txtDepartment","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","User Properties","lblCompany","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","User Properties","txtCompany","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","User Properties","lblOffice","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","User Properties","txtOffice","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","User Properties","lblTeleWork","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","User Properties","txtTeleWork","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","User Properties","lblTeleHome","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","User Properties","txtTeleHome","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","User Properties","lblTelePager","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","User Properties","txtTelePager","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","User Properties","lblTeleMobile","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","User Properties","txtTeleMobile","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","User Properties","lblTeleFax","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","User Properties","txtTeleFax","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","User Properties","lblTeleIPPhone","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","User Properties","txtTeleIPPhone","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","User Notes","lblNotes","2")
        IniWrite($ScriptPath & "\Profiles\Default.ini","User Notes","txtNotes","2")
        FileCopy ($ScriptPath & "\Profiles\Default.ini", $ScriptPath & "\Profiles\" & $UserID & ".ini")
    EndIf

EndFunc

Func Load_Options(); Done
    $Groups2Exclude = IniRead($ScriptPath & "\Config.ini","ExcludeGroups","Groups","")
    $NewUserOU = IniRead($ScriptPath & "\Config.ini","NewUserOU",$SelDomain, "")
    $AllowSave = IniRead($ScriptPath & "\Profiles\" & $UserID & ".ini","Options","AllowSaveWithNotes", "")
    $AddUser2Mailbox = IniRead($ScriptPath & "\Config.ini","Email","NewActAddUsrSec", "")
    $AddUser2MailboxAut = IniRead($ScriptPath & "\Config.ini","Email","NewActAddUsrAut", "")
    $HomeDB1 = IniRead($ScriptPath & "\Config.ini","Email","HomeDB1", "")
    $HomeDB2 = IniRead($ScriptPath & "\Config.ini","Email","HomeDB2", "")
    $HomeDB3 = IniRead($ScriptPath & "\Config.ini","Email","HomeDB3", "")
    $HomeDB4 = IniRead($ScriptPath & "\Config.ini","Email","HomeDB4", "")

EndFunc

 Func _general_show() 
    GUICtrlSetState ( $Group2, $GUI_SHOW )
    GUICtrlSetState ( $Group3, $GUI_SHOW )
    GUICtrlSetState ( $Checkbox1, $GUI_SHOW )
    GUICtrlSetState ( $Checkbox2, $GUI_SHOW )
    GUICtrlSetState ( $Checkbox3, $GUI_SHOW )
    GUICtrlSetState ( $Checkbox4, $GUI_SHOW )
    GUICtrlSetState ( $Checkbox5, $GUI_SHOW )
    GUICtrlSetState ( $Checkbox6, $GUI_SHOW )
    GUICtrlSetState ( $Label2, $GUI_SHOW )
    GUICtrlSetState ( $Label3, $GUI_SHOW )
    GUICtrlSetState ( $Label4, $GUI_SHOW )
    GUICtrlSetState ( $Label5, $GUI_SHOW )
    GUICtrlSetState ( $Label6, $GUI_SHOW )
    GUICtrlSetState ( $Label7, $GUI_SHOW )
    GUICtrlSetState ( $Label8, $GUI_SHOW )
    GUICtrlSetState ( $Label9, $GUI_SHOW )
    GUICtrlSetState ( $Label9, $GUI_SHOW )
    GUICtrlSetState ( $Label10, $GUI_SHOW )
    GUICtrlSetState ( $Input2, $GUI_SHOW )
    GUICtrlSetState ( $Input3, $GUI_SHOW )
    GUICtrlSetState ( $Input4, $GUI_SHOW )
    GUICtrlSetState ( $Input5, $GUI_SHOW )
    GUICtrlSetState ( $Input6, $GUI_SHOW )
    GUICtrlSetState ( $Input7, $GUI_SHOW )
    GUICtrlSetState ( $Input8, $GUI_SHOW )
    GUICtrlSetState ( $Input9, $GUI_SHOW )
    GUICtrlSetState ( $Button3, $GUI_SHOW )
    GUICtrlSetState ( $Button4, $GUI_SHOW )
     
 EndFunc

Func _general_hide()

    GUICtrlSetState ( $Group2, $GUI_HIDE )
    GUICtrlSetState ( $Group3, $GUI_HIDE )
    GUICtrlSetState ( $Checkbox1, $GUI_HIDE )
    GUICtrlSetState ( $Checkbox2, $GUI_HIDE )
    GUICtrlSetState ( $Checkbox3, $GUI_HIDE )
    GUICtrlSetState ( $Checkbox4, $GUI_HIDE )
    GUICtrlSetState ( $Checkbox5, $GUI_HIDE )
    GUICtrlSetState ( $Checkbox6, $GUI_HIDE )
    GUICtrlSetState ( $Label2, $GUI_HIDE )
    GUICtrlSetState ( $Label3, $GUI_HIDE )
    GUICtrlSetState ( $Label4, $GUI_HIDE )
    GUICtrlSetState ( $Label5, $GUI_HIDE )
    GUICtrlSetState ( $Label6, $GUI_HIDE )
    GUICtrlSetState ( $Label7, $GUI_HIDE )
    GUICtrlSetState ( $Label8, $GUI_HIDE )
    GUICtrlSetState ( $Label9, $GUI_HIDE )
    GUICtrlSetState ( $Label9, $GUI_HIDE )
    GUICtrlSetState ( $Label10, $GUI_HIDE )
    GUICtrlSetState ( $Input2, $GUI_HIDE )
    GUICtrlSetState ( $Input3, $GUI_HIDE )
    GUICtrlSetState ( $Input4, $GUI_HIDE )
    GUICtrlSetState ( $Input5, $GUI_HIDE )
    GUICtrlSetState ( $Input6, $GUI_HIDE )
    GUICtrlSetState ( $Input7, $GUI_HIDE )
    GUICtrlSetState ( $Input8, $GUI_HIDE )
    GUICtrlSetState ( $Input9, $GUI_HIDE )
    GUICtrlSetState ( $Button3, $GUI_HIDE )
    GUICtrlSetState ( $Button4, $GUI_HIDE )

EndFunc

Func _group_hide()
    GUICtrlSetState ( $List2a, $GUI_HIDE )
    GUICtrlSetState ( $List3a, $GUI_HIDE )
    GUICtrlSetState ( $Group2a, $GUI_HIDE )
    GUICtrlSetState ( $Group3a, $GUI_HIDE )
    GUICtrlSetState ( $Button3a, $GUI_HIDE )
    GUICtrlSetState ( $Button4a, $GUI_HIDE )
    GUICtrlSetState ( $Button5a, $GUI_HIDE )
    GUICtrlSetState ( $Label2a, $GUI_HIDE )
    GUICtrlSetState ( $Label3a, $GUI_HIDE )

EndFunc

Func _group_show()
    GUICtrlSetState ( $List2a, $GUI_SHOW )
    GUICtrlSetState ( $List3a, $GUI_SHOW )
    GUICtrlSetState ( $Group2a, $GUI_SHOW )
    GUICtrlSetState ( $Group3a, $GUI_SHOW )
    GUICtrlSetState ( $Button3a, $GUI_SHOW )
    GUICtrlSetState ( $Button4a, $GUI_SHOW )
    GUICtrlSetState ( $Button5a, $GUI_SHOW )
    GUICtrlSetState ( $Label2a, $GUI_SHOW )
    GUICtrlSetState ( $Label3a, $GUI_SHOW )

EndFunc

-= Smudley =-

Share this post


Link to post
Share on other sites
martin

I'm lost on this program and I haven't found any post that defines my situation.

....

What am I doing wrong?

It looks like you are creating controls repeatedly with the same variable name and generating lots of controls you don't want. For example you create $List2a, then maybe you show $list2a then you create $list2a again. When you hide $list2a you hide the last one created but the previous one now has no variable for its ID and so you can no longer control it.

I think you should either

only create a control once and then hide or show it (preferred IMO)

OR

every time you create a new $varABC make sure any old $varABC is deleted first.


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.