Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

What is the INSTANCE in control ID????

$
0
0
What is the INSTANCE in control ID????
And how can i use it in controlclick ID???
I want to Remove a netwok adapter from network connections.but Controlclick is not doing click on yes  
button of confirm connection delete.Please guide me..........
[ autoit ]         
#NoTrayIcon #compiler_icon=itlifesaver.ico #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <process.au3> $COMPANY_NAME = "HM-LINK" ; name of the pppoe icon, friendly description $SERVICE_NAME = "HM" ; name of the pppoe service configured in NAS/Mikrotik Local $font $timeout=00 ;Restart TimeOut $DELAY = 250 ; Run Network Setup Run("control ncpa.cpl") WinWaitActive("Network Connections") ; Check if PPPOE dialer by same name already exists, since it'll break script later if Windows add's a number at the end of the name... $ControlID = ControlListView("Network Connections", "", "SysListView321", "FindItem", $COMPANY_NAME, "AACABLE - DIALER SERVICE") WinClose("Network Connections") If $ControlID <> -1 Then $frmInformation1 = GUICreate("Uninstall Process", 325, 80, 190, 110) $btnOK1 = GUICtrlCreateButton("Remove", 260, 50, 60, 25, 0x0001) $lblInfo1 = GUICtrlCreateLabel("Acount is already exist Do you want to delete it...", 10, 8, 250, 40) $lblInfo1 = GUICtrlSetFont($lblInfo1, 9, 800) $lblInfo2 = GUICtrlCreateLabel(" If you have not any Problem do't click on Remove", 10, 55, 245, 17, 0x1000) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $btnOK1 If $ControlID <> -1 Then ; Check if PPPOE dialer by same name already exists, since it'll break script later if Windows add's a number at the end of the name... $ControlID1 = ControlListView("Network Connections", "", "SysListView321", "FindItem", $COMPANY_NAME, "AACABLE - DIALER SERVICE")&$ControlID>0 $answer = MsgBox(4, "HM-LINK 03216592390", "Are You Sure to Delete Account of "& $COMPANY_NAME &"?") If $answer = 7 Then Exit WinClose("Uninstall Process") Else Sleep($DELAY) Send("!{F4}") Send("!{F4}") Sleep($DELAY) Send("!{F4}") Send("!{F4}") Sleep($DELAY) Send("{ESc}") Sleep($DELAY) Run("control ncpa.cpl") WinWaitActive("Network Connections") ControlListView("Network Connections", "", "SysListView321", "Select", $ControlID1) ControlSend("Network Connections","","","{Del}") Sleep($DELAY) ControlClick("Confirm Connection Delete", "", "[Button; Yes]") Sleep($DELAY) WinClose("Network Connections") Sleep($DELAY) FileDelete(@DesktopCommonDir & "\HM-LINK.lnk"); if COMPANY_NAME changed see it............................................................. Sleep($DELAY) FileDelete(@StartupCommonDir & "\HM-LINK 03216592390.lnk"); if COMPANY_NAME changed see it............................................................. Sleep($DELAY) $answer1 = MsgBox(4, "Computer Restart 03216592390","You Must Restart Your Computer! Are You Sure To Restart Computer?") If $answer1 = 6 Then WinClose("Computer Restart 03216592390") Sleep($DELAY) Shutdown(2) Else WinClose("Uninstall Process") Sleep($DELAY) WinClose("Computer Restart 03216592390") ExitLoop EndIf EndIf EndIf Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd GUISetState(@SW_HIDE) Exit EndIf

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>