Sign in to follow this  
Followers 0
monte

redraw (refresh) screen

3 posts in this topic




#2 ·  Posted (edited)

look at the width settings for the checkboxes, and please put the main part of the program before the functions for readability

#include <GUIConstants.au3>
#notrayicon
$checkRun = "Emc Script0"
If WinExists($checkRun) Then Exit

GUICreate("Emc Script", 350, 210)

$button1 = GUICtrlCreateIcon("C:\progra~1\privateArk.bmp", -1, 10, 10)
$button2 = GUICtrlCreateIcon("C:\Program Files\lotus\notes\notes.exe", -1, 10, 75)

$sdCheck = GUICtrlCreateCheckbox("W", 17, 108, 30, 20)

$button3 = GUICtrlCreateIcon("C:\progra~1\visio.ico", -1, 50, 10)
$button4 = GUICtrlCreateIcon("C:\progra~1\damewa~1\damewa~1\DNTU.exe", -1, 90, 10)
$button5 = GUICtrlCreateIcon("%SystemRoot%\system32\mstsc.exe", -1, 130, 10)
$button15 = GUICtrlCreateIcon("C:\Program Files\humicon.exe", 82, 170, 10)
$button6 = GUICtrlCreateIcon("C:\Program Files\humicon.exe", 11, 50, 75)

$humCheck = GUICtrlCreateCheckbox("H", 53, 108, 30)
$autoCheck = GUICtrlCreateCheckbox("A", 53, 125, 30)

$button7 = GUICtrlCreateIcon("C:\progra~1\damewa~1\damewa~1\DNTU.exe", 22, 130, 75)
$button8 = GUICtrlCreateIcon("C:\progra~1\telnet.ico", -1, 170, 75)
$button9 = GUICtrlCreateIcon("Shell32.dll", 8, 90, 75)
$diskCheck = GUICtrlCreateCheckbox("S", 96, 108, 30, 20)
$button13 = GUICtrlCreateIcon("C:\Program Files\humicon.exe", 95, 210, 10)
$button10 = GUICtrlCreateButton("Emcid", 130, 130, 40, 20)
$button11 = GUICtrlCreateButton("Master alert", 180, 130, 70, 20)
$button12 = GUICtrlCreateButton("Nslookup", 260, 130, 60, 20)
$button14 = GUICtrlCreateButton("Mmc", 10, 160, 30, 20)
$button16 = GUICtrlCreateButton("Vendor", 100, 190, 50, 20)
$button17 = GUICtrlCreateButton("Knowledge Rep", 50, 160, 90, 20)
$button18 = GUICtrlCreateButton("Ip Admin", 150, 160, 60, 20)
$button19 = GUICtrlCreateButton("Emc Admin", 220, 160, 80, 20)
$button20 = GUICtrlCreateButton("Cluster Admin", 10, 190, 80, 20)
$button21 = GUICtrlCreateButton("Dial Bkups", 160, 190, 60, 20)
$button22 = GUICtrlCreateButton("Circuit Db", 230, 190, 60, 20)


GUISetState()

While 1
    $msg = GUIGetMsg()
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    Select
        Case $msg = $button1
            privateArk()
        Case $msg = $button2
            serverDatabase($sdCheck)
        Case $msg = $button6
            myping($humCheck, $autoCheck)
        Case $msg = $button7
            cmd()
        Case $msg = $button3
            netmaps()
        Case $msg = $button5
            rdp()
        Case $msg = $button4
            dameware()
        Case $msg = $button8
            telnet()
        Case $msg = $button9
            disk($diskCheck)
        Case $msg = $button10
            emcid()
        Case $msg = $button11
            masterAlert()
        Case $msg = $button12
            nslookup()
        Case $msg = $button13
            uptime()
        Case $msg = $button14
            mmc()
        Case $msg = $button15
            trace()
        Case $msg = $button16
            vendor()
        Case $msg = $button17
            knowledge()
        Case $msg = $button18
            ipAdmin()
        Case $msg = $button19
            emcAdmin()
        Case $msg = $button20
            cluadmin()
        Case $msg = $button21
            who()
        Case $msg = $button22
            circuitDb()
            
    EndSelect
WEnd


Func privateArk()
    $vServerClip = ClipGet()
    $vServerString = StringSplit($vServerClip, @TAB)
    $vServer = $vServerString[22]
    WinActivate("PrivateArk")
    Send("{F10}tf")
    Send($vServer)
    Send("{TAB}a")
    Send("{ENTER}")
    Sleep(1000)
    Send("{ENTER}")
EndFunc  ;==>privateArk

Func serverDatabase($sdCheck)
    $vServerClip = ClipGet()
    $vServerString = StringSplit($vServerClip, @TAB)
    $vServer = $vServerString[22]
    If GUICtrlRead($sdCheck) = $GUI_UNCHECKED Then
        RunWait("C:\progra~1\lotus\notes\notes.exe myserver/server/folder!!netops\db.nsf")
        WinActivate("Server History")
        Sleep(100)
        Send("{F10}vw")
        Sleep(100)
        Send($vServer)
        Send("{ENTER}{ENTER}")
    Else
        Dim $site[5]
        $vServerClip = ClipGet()
        $vServerString = StringSplit($vServerClip, @TAB)
        $vServer = $vServerString[22]
        $site0 = " /c Start https://myserver/000/000/tmp"
        $site00 = StringReplace($site0, "tmp", $vServer)
        $site[1] = @ComSpec
        $site[2] = $site00
        $site[3] = ""
        $site[4] = @SW_SHOW
        Run($site[1] & $site[2], $site[3], $site[4])
    EndIf
EndFunc  ;==>serverDatabase

Func emcid()
    Dim $site[5]
    $vServerClip = ClipGet()
    $vServerString = StringSplit($vServerClip, @TAB)
    $vServer = $vServerString[17]
    $site0 = " /c Start http://myserver/ens/emcid%20reference.nsf/...D/aServer"
    $site00 = StringReplace($site0, "aServer", $vServer)
    $site[1] = @ComSpec
    $site[2] = $site00
    $site[3] = ""
    $site[4] = @SW_SHOW
    Run($site[1] & $site[2], $site[3], $site[4])
EndFunc  ;==>emcid

Func masterAlert()
    $vServerClip = ClipGet()
    $vServerString = StringSplit($vServerClip, @TAB)
    $vServerS = $vServerString[23]
    $vServer = StringLeft($vServerS, 30)
    Run(@ComSpec & " /c \\comp\drive$\em\master~1.xls", "", @SW_HIDE)
    WinActivate("microsoft excel-master alert")
    Sleep(2000)
    Send("{f10}ef")
    Send("{TAB}{ENTER}")
    Send($vServer)
    Send("{TAB}{TAB}")
    Send("w")
    Send("{ENTER}{ENTER}")
EndFunc  ;==>masterAlert

Func nslookup()
    Dim $aMy[5]
    $vServerClip = ClipGet()
    $vServerString = StringSplit($vServerClip, @TAB)
    $vServer = $vServerString[22]
    $mycmd = " /c nslookup tserver& pause"
    $mycmd0 = StringReplace($mycmd, "tserver", $vServer)
    $aMy[1] = @ComSpec
    $aMy[2] = $mycmd0
    Run($aMy[1] & $aMy[2])
EndFunc  ;==>nslookup

Func myping($humCheck, $autoCheck)
    Dim $aMy[5]
    $vServerClip = ClipGet()
    $vServerString = StringSplit($vServerClip, @TAB)
    $vServer = $vServerString[22]
    If GUICtrlRead($autoCheck) = $GUI_CHECKED Then
        
    EndIf
    If GUICtrlRead($humCheck) = $GUI_CHECKED Then
        RunWait("C:\progra~1\Hummingbird\Connectivity\7.10\Accessories\pingw.exe")
        WinActivate("ping")
        Sleep(2000)
        Send($vServer)
        Send("{ENTER}")
    EndIf
    If (GUICtrlRead($humCheck) = $GUI_UNCHECKED And GUICtrlRead($autoCheck) = $GUI_UNCHECKED) Then
        $mycmd = " /c ping tserver count 1& pause"
        $mycmd0 = StringReplace($mycmd, "tserver", $vServer)
        $aMy[1] = @ComSpec
        $aMy[2] = $mycmd0
        Run($aMy[1] & $aMy[2])
    EndIf
EndFunc  ;==>myping

Func cmd()
    Run(@ComSpec & " /k")
EndFunc  ;==>cmd

Func telnet()
    Dim $aMy[5]
    $vServerClip = ClipGet()
    $vServerString = StringSplit($vServerClip, @TAB)
    $vServer = $vServerString[22]
    $mycmd = " /c telnet tserver"
    $mycmd0 = StringReplace($mycmd, "tserver", $vServer)
    $aMy[1] = @ComSpec
    $aMy[2] = $mycmd0
    Run($aMy[1] & $aMy[2])
EndFunc  ;==>telnet

Func uptime()
    Dim $aMy[5]
    $vServerClip = ClipGet()
    $vServerString = StringSplit($vServerClip, @TAB)
    $vServer = $vServerString[22]
    $mycmd = " /c C:\windows\uptime tserver& pause"
    $mycmd0 = StringReplace($mycmd, "tserver", $vServer)
    $aMy[1] = @ComSpec
    $aMy[2] = $mycmd0
    Run($aMy[1] & $aMy[2])
EndFunc  ;==>uptime

Func mmc()
    Dim $aMy[5]
    $vServerClip = ClipGet()
    $vServerString = StringSplit($vServerClip, @TAB)
    $vServer = $vServerString[22]
    $mycmd = " /c compmgmt.msc /computer=\\tserver"
    $mycmd0 = StringReplace($mycmd, "tserver", $vServer)
    $aMy[1] = @ComSpec
    $aMy[2] = $mycmd0
    $aMy[3] = ""
    $aMy[4] = @SW_HIDE
    Run($aMy[1] & $aMy[2], $aMy[3], $aMy[4])
EndFunc  ;==>mmc

Func netmaps()
    Dim $site[5]
    Dim $primary
    Dim $secondary
    $k = RegRead("HKEY_CURRENT_USER\Control Panel\Mouse", "SwapMouseButtons")
    If $k = 1 Then
        $primary = "right"
        $secondary = "left"
    Else
        $primary = "left"
        $secondary = "right"
    EndIf
    $vServerClip = ClipGet()
    $vServerString = StringSplit($vServerClip, @TAB)
    $vServer = $vServerString[22]
    $myServer = StringLeft($vServer, 5)
    Run(@ComSpec & " /c start http://myserver/WebDev/netmap.nsf/000/...earchView", "", @SW_HIDE)
    Dim $aMy[5]
    Sleep(2000)
    WinSetState("search this view", "", @SW_MAXIMIZE)
    WinActivate("search this view")
    Sleep(200)
    Send("!{SPACE}x")
    Sleep(100)
    Send("{TAB}")
    Sleep(100)
    Send($myServer)
    Send("*")
    Send("{ENTER}")
    Sleep(1500)
    MouseClick($primary, 64, 221, 1, 0)
    Sleep(1500)
    Send("{END}")
    MouseClick($primary, 506, 639, 1, 0)
    Sleep(100)
EndFunc  ;==>netmaps


Func trace()
    Dim $aMy[5]
    $vServerClip = ClipGet()
    $vServerString = StringSplit($vServerClip, @TAB)
    $vServer = $vServerString[22]
    $mycmd = " /c tracert tserver& pause"
    $mycmd0 = StringReplace($mycmd, "tserver", $vServer)
    $aMy[1] = @ComSpec
    $aMy[2] = $mycmd0
    Run($aMy[1] & $aMy[2])
EndFunc  ;==>trace

Func rdp()
    Dim $aMy[5]
    $vServerClip = ClipGet()
    $vServerString = StringSplit($vServerClip, @TAB)
    $vServer = $vServerString[22]
    $mycmd = " /c mstsc.exe /v:tserver& pause"
    $mycmd0 = StringReplace($mycmd, "tserver", $vServer)
    $aMy[1] = @ComSpec
    $aMy[2] = $mycmd0
    $aMy[3] = ""
    $aMy[4] = @SW_HIDE
    Run($aMy[1] & $aMy[2], $aMy[3], $aMy[4])
EndFunc  ;==>rdp

Func disk($diskCheck)
    Dim $aMy[5]
    $vServerClip = ClipGet()
    $vServerString = StringSplit($vServerClip, @TAB)
    $vServer = $vServerString[22]
    $vSummary = $vServerString[23]
    $myDisk = StringMid($vSummary, 19, 1)
    If GUICtrlRead($diskCheck) = $GUI_UNCHECKED Then
        $mycmd = " /c explorer \\tserver\tmpDrive$"
        $mycmd0 = StringReplace($mycmd, "tserver", $vServer)
        $mycmd1 = StringReplace($mycmd0, "tmpDrive", $myDisk)
        $aMy[1] = @ComSpec
        $aMy[2] = $mycmd1
        $aMy[3] = ""
        $aMy[4] = @SW_HIDE
        Run($aMy[1] & $aMy[2], $aMy[3], $aMy[4])
    Else
        $mycmd2 = "\\tserver\tmpDrive$"
        $mycmd3 = StringReplace($mycmd2, "tserver", $vServer)
        $mycmd4 = StringReplace($mycmd3, "tmpDrive", $myDisk)
        $myTotal = DriveSpaceTotal($mycmd4)
        $myFree = DriveSpaceFree($mycmd4)
        MsgBox(4096, "Space Utilization:", "Total Space:" & @TAB & $myTotal & " MB" & @CR & @CR & "Free Space:" & @TAB & $myFree & " MB")
    EndIf
EndFunc  ;==>disk

Func dameware()
    Dim $site[5]
    Dim $primary
    Dim $secondary
    $k = RegRead("HKEY_CURRENT_USER\Control Panel\Mouse", "SwapMouseButtons")
    If $k = 1 Then
        $primary = "right"
        $secondary = "left"
    Else
        $primary = "left"
        $secondary = "right"
    EndIf
    $vServerClip = ClipGet()
    $vServerString = StringSplit($vServerClip, @TAB)
    $vServer = $vServerString[22]
    Run(@ComSpec & " /c C:\progra~1\damewa~1\damewa~1\dntu.exe")
    Sleep(2000)
    WinActivate("dameware")
    Sleep(100)
    Send("{END}")
    Sleep(500)
    MouseClick($secondary, 75, 526, 1, 0)
    Send("{DOWN}")
    Send("{ENTER}")
    Send($vServer)
    Send("{ENTER}")
    Sleep(100)
EndFunc  ;==>dameware

Func vendor()
    RunWait("C:\progra~1\lotus\notes\notes.exe myserver/server/folder!!ens\vendor support.nsf")
    WinActivate("Vendor")
EndFunc  ;==>vendor

Func knowledge()
    RunWait("C:\progra~1\lotus\notes\notes.exe myserver/server/folder!!public\emc_kr.nsf")
    WinActivate("emc knowledge")
EndFunc  ;==>knowledge

Func ipAdmin()
    RunWait("C:\progra~1\lotus\notes\notes.exe myserver/server/folder!!mail\ipadmin.nsf")
    WinActivate("emc knowledge")
EndFunc  ;==>ipAdmin

Func emcAdmin()
    RunWait("C:\progra~1\lotus\notes\notes.exe myserver/server/folder!!mail\eadmin.nsf")
    WinActivate("emc knowledge")
EndFunc  ;==>emcAdmin

Func cluadmin()
    Dim $aMy[5]
    $mycmd = " /c cluadmin"
    $aMy[1] = @ComSpec
    $aMy[2] = $mycmd
    $aMy[3] = ""
    $aMy[4] = @SW_HIDE
    Run($aMy[1] & $aMy[2], $aMy[3], $aMy[4])
    Sleep(500)
    WinActivate("cluster")
EndFunc  ;==>cluadmin

Func who()
    Dim $aMy[5]
    $mycmd = " /c \\comp\path$\perl\bin\who.pl"
    $aMy[1] = @ComSpec
    $aMy[2] = $mycmd
    $aMy[3] = ""
    $aMy[4] = @SW_SHOW
    Run($aMy[1] & $aMy[2], $aMy[3], $aMy[4])
EndFunc  ;==>who

Func circuitDb()
    RunWait("C:\progra~1\lotus\notes\notes.exe myserver/server/folder!!edo\ens dci.nsf")
    WinActivate("ens data")
EndFunc  ;==>circuitDb
Edited by gafrost

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

Thanks, gafrost! I overlooked the size of my first checkbox. I removed all size paramaters from my checkboxes and everything looks good. Thanks so much!

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  
Followers 0