|
本帖最后由 ipmitool 于 2017-1-20 08:19 编辑
想請問如何讓這 8 個圖示在當有人點擊, 連線成立後, 就將圖示變成別的, 表示說它現在有人連線中
這裡面 ID1~ID8 共有 8 組不同的使用的帳號#include <GuiToolbar.au3>
#include <GuiMenu.au3>
#include <GuiToolTip.au3>
#include <GUIConstantsEx.au3>
#include <GuiListView.au3>
#include <GUIComboBox.au3>
#include <Constants.au3>
#include <GuiImageList.au3>
#include <EditConstants.au3>
#include <FontConstants.au3>
#include <GuiButton.au3>
#include <File.au3>
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <GuiComboBoxEx.au3>
#include <array.au3>
#include <Excel.au3>
#include <GDIPlus.au3>
#include <ini.au3>
#include <GUIConstants.au3>
#include <WindowsConstants.au3>
#include <ini.au3>
#include <PostMessage_UDF.au3>
Global $iCmdID, $hWndGUI, $MsgID, $wParam, $lParam, $e_idSave, $aStrings[5]
$WinSub = GUICreate("RDP Control Panel", 300, 210, 1, 1, BitOR($WS_MAXIMIZEBOX, $WS_MINIMIZEBOX, $WS_SYSMENU, $WS_GROUP, $WS_TABSTOP), -1);BitOR($WS_CHILD, $WS_MINIMIZEBOX, $WS_CAPTION, $WS_SYSMENU)
$username1="mike1"
$password1="a1!"
$username2="mike2"
$password2="a1!"
$username3="mike3"
$password3="a1!"
$username4="mike4"
$password4="a1!"
$username5="mike5"
$password5="a1!"
$username6="mike6"
$password6="a1!"
$username7="mike7"
$password7="a1!"
$username8="mike8"
$password8="a1!"
;;;;;;;;; Read testconfig.ini ;;;;;;;;;
;$RDPconfig1 = _IniReadSection_line(@ScriptDir & '\RDPconfig.ini', 'RDPconfig')
;$RDPconfig01 = $RDPconfig1[1]
;$RDPconfig2 = _IniReadSection_line(@ScriptDir & '\RDPconfig.ini', 'RDPconfig')
;$RDPconfig02 = $RDPconfig2[2]
;$RDPconfig3 = _IniReadSection_line(@ScriptDir & '\RDPconfig.ini', 'RDPconfig')
;$RDPconfig03 = $RDPconfig3[3]
;$RDPconfig4 = _IniReadSection_line(@ScriptDir & '\RDPconfig.ini', 'RDPconfig')
;$RDPconfig04 = $RDPconfig4[4]
;$RDPconfig5 = _IniReadSection_line(@ScriptDir & '\RDPconfig.ini', 'RDPconfig')
;$RDPconfig05 = $RDPconfig5[5]
;$RDPconfig6 = _IniReadSection_line(@ScriptDir & '\RDPconfig.ini', 'RDPconfig')
;$RDPconfig06 = $RDPconfig6[6]
;$RDPconfig7 = _IniReadSection_line(@ScriptDir & '\RDPconfig.ini', 'RDPconfig')
;$RDPconfig07 = $RDPconfig7[7]
;$RDPconfig8 = _IniReadSection_line(@ScriptDir & '\RDPconfig.ini', 'RDPconfig')
;$RDPconfig08 = $RDPconfig8[8]
;;;;;;;;; Read testconfig.ini ;;;;;;;;;
;###################################################################################
$Button1 = GUICtrlCreateLabel("ID 1", 18, 60, 60, 30)
GUICtrlSetColor(-1, 0x0000FF)
GUICtrlSetBkColor(-1, -2)
GUICtrlSetCursor(-1, 0)
$MenButton1 = GUICtrlCreateButton("", 10, 5, 48, 48, $WS_EX_WINDOWEDGE)
$hImage = _GUIImageList_Create(40, 40, 5, 1, 0)
;if $RDPconfig01 = "" Then
_GUICtrlButton_SetImageList($MenButton1, _set_button_image_maxx(15), 5) ;藍色
;Else
;_GUICtrlButton_SetImageList($MenButton1, _set_button_image_maxx(16), 5)
;EndIf
$Button2 = GUICtrlCreateLabel("ID 2", 88, 60, 60, 30)
GUICtrlSetColor(-1, 0x0000FF)
GUICtrlSetBkColor(-1, -2)
GUICtrlSetCursor(-1, 0)
$MenButton2 = GUICtrlCreateButton("", 80, 5, 48, 48, $WS_EX_WINDOWEDGE)
$hImage = _GUIImageList_Create(40, 40, 5, 1, 0)
;if $RDPconfig02 = "" Then
_GUICtrlButton_SetImageList($MenButton2, _set_button_image_maxx(15), 5)
;Else
;_GUICtrlButton_SetImageList($MenButton2, _set_button_image_maxx(16), 5)
;EndIf
$Button3 = GUICtrlCreateLabel("ID 3", 158, 60, 60, 30)
GUICtrlSetColor(-1, 0x0000FF)
GUICtrlSetBkColor(-1, -2)
GUICtrlSetCursor(-1, 0)
$MenButton3 = GUICtrlCreateButton("", 150, 5, 48, 48, $WS_EX_WINDOWEDGE)
$hImage = _GUIImageList_Create(40, 40, 5, 1, 0)
_GUICtrlButton_SetImageList($MenButton3, _set_button_image_maxx(15), 5)
$Button4 = GUICtrlCreateLabel("ID 4", 228, 60, 60, 30)
GUICtrlSetColor(-1, 0x0000FF)
GUICtrlSetBkColor(-1, -2)
GUICtrlSetCursor(-1, 0)
$MenButton4 = GUICtrlCreateButton("", 220, 5, 48, 48, $WS_EX_WINDOWEDGE)
$hImage = _GUIImageList_Create(40, 40, 5, 1, 0)
_GUICtrlButton_SetImageList($MenButton4, _set_button_image_maxx(15), 5)
;###################################################################################
$Button5 = GUICtrlCreateLabel("ID 5", 18, 145, 60, 30)
GUICtrlSetColor(-1, 0x0000FF)
GUICtrlSetBkColor(-1, -2)
GUICtrlSetCursor(-1, 0)
$MenButton5 = GUICtrlCreateButton("", 10, 90, 48, 48, $WS_EX_WINDOWEDGE)
$hImage = _GUIImageList_Create(40, 40, 5, 1, 0)
_GUICtrlButton_SetImageList($MenButton5, _set_button_image_maxx(15), 5)
$Button6 = GUICtrlCreateLabel("ID 6", 88, 145, 60, 30)
GUICtrlSetColor(-1, 0x0000FF)
GUICtrlSetBkColor(-1, -2)
GUICtrlSetCursor(-1, 0)
$MenButton6 = GUICtrlCreateButton("", 80, 90, 48, 48, $WS_EX_WINDOWEDGE)
$hImage = _GUIImageList_Create(40, 40, 5, 1, 0)
_GUICtrlButton_SetImageList($MenButton6, _set_button_image_maxx(15), 5)
$Button7 = GUICtrlCreateLabel("ID 7", 158, 145, 60, 30)
GUICtrlSetColor(-1, 0x0000FF)
GUICtrlSetBkColor(-1, -2)
GUICtrlSetCursor(-1, 0)
$MenButton7 = GUICtrlCreateButton("", 150, 90, 48, 48, $WS_EX_WINDOWEDGE)
$hImage = _GUIImageList_Create(40, 40, 5, 1, 0)
_GUICtrlButton_SetImageList($MenButton7, _set_button_image_maxx(15), 5)
$Button8 = GUICtrlCreateLabel("ID 8", 228, 145, 60, 30)
GUICtrlSetColor(-1, 0x0000FF)
GUICtrlSetBkColor(-1, -2)
GUICtrlSetCursor(-1, 0)
$MenButton8 = GUICtrlCreateButton("", 220, 90, 48, 48, $WS_EX_WINDOWEDGE)
$hImage = _GUIImageList_Create(40, 40, 5, 1, 0)
_GUICtrlButton_SetImageList($MenButton8, _set_button_image_maxx(15), 5)
;###################################################################################
$Label1 = GUICtrlCreateLabel("_", 0, 82, @DesktopWidth, 1, 0x1000) ;线条的部份
GUICtrlSetResizing(-1,802)
GUISetState()
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
Exit
Case $Button1, $MenButton1
$oRDP = ObjCreate("MsTscAx.MsTscAx")
GUICreate("AU3 RDP1", 1048, 784, -1 , -1, $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)
$GUIActiveX = GUICtrlCreateObj($oRDP, 10, 10, 1024, 768)
GUICtrlSetStyle ( $GUIActiveX, $WS_VISIBLE )
GUICtrlSetResizing ($GUIActiveX,$GUI_DOCKAUTO)
GUISetState()
$oRDP.Server = "127.0.0.2" ;IP
$oRDP.Domain = "" ;登录域
$oRDP.UserName = $username1 ; 用户名
$oRDP.AdvancedSettings2.ClearTextPassword = $password1 ; 密码
$oRDP.FullScreen = False ; 全屏是/否
$oRDP.AdvancedSettings2.RedirectDrives = True ; 本地设备和资源是否被带到远程会话中
$oRDP.AdvancedSettings2.RedirectPrinters = False ; 打印机
$oRDP.AdvancedSettings2.RedirectPorts = False ; LPT1等端口
$oRDP.AdvancedSettings2.RedirectSmartCards = False ; 智能卡身份验证
$oRDP.ConnectingText = "Connecting ..." ;
$oRDP.AdvancedSettings2.EnableAutoReconnect = True
$oRDP.AdvancedSettings2.allowBackgroundInput = true
$oRDP.AdvancedSettings2.ConnectionBarShowRestoreButton = true
$oRDP.AdvancedSettings5.AudioRedirectionMode = 0
$oRDP.Connect()
;$RDPconfig =FileOpen("RDPconfig.ini",1) ; 1:繼續往下寫
; FileWriteLine($RDPconfig, "[RDPconfig]")
; FileWriteLine($RDPconfig, $username1)
; FileWriteLine($RDPconfig, "")
; FileClose("RDPconfig.ini")
;run("RDPscan.exe")
Case $Button2, $MenButton2
$oRDP = ObjCreate("MsTscAx.MsTscAx")
GUICreate("AU3 RDP2", 1048, 784, -1 , -1, $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)
$GUIActiveX = GUICtrlCreateObj($oRDP, 10, 10, 1024, 768)
GUICtrlSetStyle ( $GUIActiveX, $WS_VISIBLE )
GUICtrlSetResizing ($GUIActiveX,$GUI_DOCKAUTO)
GUISetState()
$oRDP.Server = "127.0.0.2" ;IP
$oRDP.Domain = "" ;登录域
$oRDP.UserName = $username2 ; 用户名
$oRDP.AdvancedSettings2.ClearTextPassword = $password2 ; 密码
$oRDP.FullScreen = False ; 全屏是/否
$oRDP.AdvancedSettings2.RedirectDrives = True ; 本地设备和资源是否被带到远程会话中
$oRDP.AdvancedSettings2.RedirectPrinters = False ; 打印机
$oRDP.AdvancedSettings2.RedirectPorts = False ; LPT1等端口
$oRDP.AdvancedSettings2.RedirectSmartCards = False ; 智能卡身份验证
$oRDP.ConnectingText = "Connecting ..." ;
$oRDP.AdvancedSettings2.EnableAutoReconnect = True
$oRDP.AdvancedSettings2.allowBackgroundInput = true
$oRDP.AdvancedSettings2.ConnectionBarShowRestoreButton = true
$oRDP.AdvancedSettings5.AudioRedirectionMode = 0
$oRDP.Connect()
;$RDPconfig =FileOpen("RDPconfig.ini",1) ; 1:繼續往下寫
; FileWriteLine($RDPconfig, "[RDPconfig]")
; FileWriteLine($RDPconfig, $username2)
; FileWriteLine($RDPconfig, "")
;run("RDPscan.exe")
Case $Button3, $MenButton3
$oRDP = ObjCreate("MsTscAx.MsTscAx")
GUICreate("AU3 RDP3", 1048, 784, -1 , -1, $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)
$GUIActiveX = GUICtrlCreateObj($oRDP, 10, 10, 1024, 768)
GUICtrlSetStyle ( $GUIActiveX, $WS_VISIBLE )
GUICtrlSetResizing ($GUIActiveX,$GUI_DOCKAUTO)
GUISetState()
$oRDP.Server = "127.0.0.2" ;IP
$oRDP.Domain = "" ;登录域
$oRDP.UserName = $username3 ; 用户名
$oRDP.AdvancedSettings2.ClearTextPassword = $password3 ; 密码
$oRDP.FullScreen = False ; 全屏是/否
$oRDP.AdvancedSettings2.RedirectDrives = True ; 本地设备和资源是否被带到远程会话中
$oRDP.AdvancedSettings2.RedirectPrinters = False ; 打印机
$oRDP.AdvancedSettings2.RedirectPorts = False ; LPT1等端口
$oRDP.AdvancedSettings2.RedirectSmartCards = False ; 智能卡身份验证
$oRDP.ConnectingText = "Connecting ..." ;
$oRDP.AdvancedSettings2.EnableAutoReconnect = True
$oRDP.AdvancedSettings2.allowBackgroundInput = true
$oRDP.AdvancedSettings2.ConnectionBarShowRestoreButton = true
$oRDP.AdvancedSettings5.AudioRedirectionMode = 0
$oRDP.Connect()
;$RDPconfig =FileOpen("RDPconfig.ini",1) ; 1:繼續往下寫
; FileWriteLine($RDPconfig, "[RDPconfig]")
; FileWriteLine($RDPconfig, $username3)
; FileWriteLine($RDPconfig, "")
;run("RDPscan.exe")
Case $Button4, $MenButton4
$oRDP = ObjCreate("MsTscAx.MsTscAx")
GUICreate("AU3 RDP4", 1048, 784, -1 , -1, $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)
$GUIActiveX = GUICtrlCreateObj($oRDP, 10, 10, 1024, 768)
GUICtrlSetStyle ( $GUIActiveX, $WS_VISIBLE )
GUICtrlSetResizing ($GUIActiveX,$GUI_DOCKAUTO)
GUISetState()
$oRDP.Server = "127.0.0.2" ;IP
$oRDP.Domain = "" ;登录域
$oRDP.UserName = $username4 ; 用户名
$oRDP.AdvancedSettings2.ClearTextPassword = $password4 ; 密码
$oRDP.FullScreen = False ; 全屏是/否
$oRDP.AdvancedSettings2.RedirectDrives = True ; 本地设备和资源是否被带到远程会话中
$oRDP.AdvancedSettings2.RedirectPrinters = False ; 打印机
$oRDP.AdvancedSettings2.RedirectPorts = False ; LPT1等端口
$oRDP.AdvancedSettings2.RedirectSmartCards = False ; 智能卡身份验证
$oRDP.ConnectingText = "Connecting ..." ;
$oRDP.AdvancedSettings2.EnableAutoReconnect = True
$oRDP.AdvancedSettings2.allowBackgroundInput = true
$oRDP.AdvancedSettings2.ConnectionBarShowRestoreButton = true
$oRDP.AdvancedSettings5.AudioRedirectionMode = 0
$oRDP.Connect()
;$RDPconfig =FileOpen("RDPconfig.ini",1) ; 1:繼續往下寫
; FileWriteLine($RDPconfig, "[RDPconfig]")
; FileWriteLine($RDPconfig, $username3)
; FileWriteLine($RDPconfig, "")
;run("RDPscan.exe")
Case $Button5, $MenButton5
$oRDP = ObjCreate("MsTscAx.MsTscAx")
GUICreate("AU3 RDP5", 1048, 784, -1 , -1, $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)
$GUIActiveX = GUICtrlCreateObj($oRDP, 10, 10, 1024, 768)
GUICtrlSetStyle ( $GUIActiveX, $WS_VISIBLE )
GUICtrlSetResizing ($GUIActiveX,$GUI_DOCKAUTO)
GUISetState()
$oRDP.Server = "127.0.0.2" ;IP
$oRDP.Domain = "" ;登录域
$oRDP.UserName = $username5 ; 用户名
$oRDP.AdvancedSettings2.ClearTextPassword = $password5 ; 密码
$oRDP.FullScreen = False ; 全屏是/否
$oRDP.AdvancedSettings2.RedirectDrives = True ; 本地设备和资源是否被带到远程会话中
$oRDP.AdvancedSettings2.RedirectPrinters = False ; 打印机
$oRDP.AdvancedSettings2.RedirectPorts = False ; LPT1等端口
$oRDP.AdvancedSettings2.RedirectSmartCards = False ; 智能卡身份验证
$oRDP.ConnectingText = "Connecting ..." ;
$oRDP.AdvancedSettings2.EnableAutoReconnect = True
$oRDP.AdvancedSettings2.allowBackgroundInput = true
$oRDP.AdvancedSettings2.ConnectionBarShowRestoreButton = true
$oRDP.AdvancedSettings5.AudioRedirectionMode = 0
$oRDP.Connect()
;$RDPconfig =FileOpen("RDPconfig.ini",1) ; 1:繼續往下寫
; FileWriteLine($RDPconfig, "[RDPconfig]")
; FileWriteLine($RDPconfig, $username3)
; FileWriteLine($RDPconfig, "")
;run("RDPscan.exe")
Case $Button6, $MenButton6
$oRDP = ObjCreate("MsTscAx.MsTscAx")
GUICreate("AU3 RDP6", 1048, 784, -1 , -1, $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)
$GUIActiveX = GUICtrlCreateObj($oRDP, 10, 10, 1024, 768)
GUICtrlSetStyle ( $GUIActiveX, $WS_VISIBLE )
GUICtrlSetResizing ($GUIActiveX,$GUI_DOCKAUTO)
GUISetState()
$oRDP.Server = "127.0.0.2" ;IP
$oRDP.Domain = "" ;登录域
$oRDP.UserName = $username6 ; 用户名
$oRDP.AdvancedSettings2.ClearTextPassword = $password6 ; 密码
$oRDP.FullScreen = False ; 全屏是/否
$oRDP.AdvancedSettings2.RedirectDrives = True ; 本地设备和资源是否被带到远程会话中
$oRDP.AdvancedSettings2.RedirectPrinters = False ; 打印机
$oRDP.AdvancedSettings2.RedirectPorts = False ; LPT1等端口
$oRDP.AdvancedSettings2.RedirectSmartCards = False ; 智能卡身份验证
$oRDP.ConnectingText = "Connecting ..." ;
$oRDP.AdvancedSettings2.EnableAutoReconnect = True
$oRDP.AdvancedSettings2.allowBackgroundInput = true
$oRDP.AdvancedSettings2.ConnectionBarShowRestoreButton = true
$oRDP.AdvancedSettings5.AudioRedirectionMode = 0
$oRDP.Connect()
;$RDPconfig =FileOpen("RDPconfig.ini",1) ; 1:繼續往下寫
; FileWriteLine($RDPconfig, "[RDPconfig]")
; FileWriteLine($RDPconfig, $username3)
; FileWriteLine($RDPconfig, "")
;run("RDPscan.exe")
Case $Button7, $MenButton7
$oRDP = ObjCreate("MsTscAx.MsTscAx")
GUICreate("AU3 RDP7", 1048, 784, -1 , -1, $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)
$GUIActiveX = GUICtrlCreateObj($oRDP, 10, 10, 1024, 768)
GUICtrlSetStyle ( $GUIActiveX, $WS_VISIBLE )
GUICtrlSetResizing ($GUIActiveX,$GUI_DOCKAUTO)
GUISetState()
$oRDP.Server = "127.0.0.2" ;IP
$oRDP.Domain = "" ;登录域
$oRDP.UserName = $username7 ; 用户名
$oRDP.AdvancedSettings2.ClearTextPassword = $password7 ; 密码
$oRDP.FullScreen = False ; 全屏是/否
$oRDP.AdvancedSettings2.RedirectDrives = True ; 本地设备和资源是否被带到远程会话中
$oRDP.AdvancedSettings2.RedirectPrinters = False ; 打印机
$oRDP.AdvancedSettings2.RedirectPorts = False ; LPT1等端口
$oRDP.AdvancedSettings2.RedirectSmartCards = False ; 智能卡身份验证
$oRDP.ConnectingText = "Connecting ..." ;
$oRDP.AdvancedSettings2.EnableAutoReconnect = True
$oRDP.AdvancedSettings2.allowBackgroundInput = true
$oRDP.AdvancedSettings2.ConnectionBarShowRestoreButton = true
$oRDP.AdvancedSettings5.AudioRedirectionMode = 0
$oRDP.Connect()
;$RDPconfig =FileOpen("RDPconfig.ini",1) ; 1:繼續往下寫
; FileWriteLine($RDPconfig, "[RDPconfig]")
; FileWriteLine($RDPconfig, $username3)
; FileWriteLine($RDPconfig, "")
;run("RDPscan.exe")
Case $Button8, $MenButton8
$oRDP = ObjCreate("MsTscAx.MsTscAx")
GUICreate("AU3 RDP8", 1048, 784, -1 , -1, $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)
$GUIActiveX = GUICtrlCreateObj($oRDP, 10, 10, 1024, 768)
GUICtrlSetStyle ( $GUIActiveX, $WS_VISIBLE )
GUICtrlSetResizing ($GUIActiveX,$GUI_DOCKAUTO)
GUISetState()
$oRDP.Server = "127.0.0.2" ;IP
$oRDP.Domain = "" ;登录域
$oRDP.UserName = $username8 ; 用户名
$oRDP.AdvancedSettings2.ClearTextPassword = $password8 ; 密码
$oRDP.FullScreen = False ; 全屏是/否
$oRDP.AdvancedSettings2.RedirectDrives = True ; 本地设备和资源是否被带到远程会话中
$oRDP.AdvancedSettings2.RedirectPrinters = False ; 打印机
$oRDP.AdvancedSettings2.RedirectPorts = False ; LPT1等端口
$oRDP.AdvancedSettings2.RedirectSmartCards = False ; 智能卡身份验证
$oRDP.ConnectingText = "Connecting ..." ;
$oRDP.AdvancedSettings2.EnableAutoReconnect = True
$oRDP.AdvancedSettings2.allowBackgroundInput = true
$oRDP.AdvancedSettings2.ConnectionBarShowRestoreButton = true
$oRDP.AdvancedSettings5.AudioRedirectionMode = 0
$oRDP.Connect()
;$RDPconfig =FileOpen("RDPconfig.ini",1) ; 1:繼續往下寫
; FileWriteLine($RDPconfig, "[RDPconfig]")
; FileWriteLine($RDPconfig, $username3)
; FileWriteLine($RDPconfig, "")
;run("RDPscan.exe")
EndSwitch
WEnd
Func _set_button_image_maxx($icon_index)
Local $hImage_Temp = _GUIImageList_Create(40, 40, 5, 3, 6)
_GUIImageList_AddIcon($hImage_Temp, "Shell32.dll", $icon_index, True)
Return $hImage_Temp
EndFunc ;==>_set_button_image_maxx
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?加入
×
|