Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/05/2018 in all areas

  1. Hello Here is my network UDF. Do not yell at me if it already exists ... I hope it will be useful to someone. Please, let me know if you have any problem. All functions that perform modifications required administrator rights Functions list : Internal functions only : Examples : #Include "network.au3" ; List of availables connections/cards #Include <array.au3> ; only for _ArrayDisplay() $infos = _GetNetworkAdapterList() _ArrayDisplay($infos) ; Network card informations for the network connection called "Local Area Network" $infos = _GetNetworkAdapterInfos("Local Area Network") _ArrayDisplay($infos) ; Disable a network connection _DisableNetAdapter("Broadcom NetLink (TM) Gigabit Ethernet") ; OR _DisableNetAdapter("Local Area Network") ; Enable a network connection _EnableNetAdapter("Local Area Network") ; OR _EnableNetAdapter("Broadcom NetLink (TM) Gigabit Ethernet") ; Enable DHCP (for IP Address) _EnableDHCP("Broadcom NetLink (TM) Gigabit Ethernet") ; OR _EnableDHCP("Local Area Network") ; Configure a static IP adress _EnableStatic("Broadcom NetLink (TM) Gigabit Ethernet", "192.168.10.11", "255.255.255.0") ; OR _EnableStatic("Local Area Network", "192.168.10.11", "255.255.255.0") ; Configure the default gateway _SetGateways("Broadcom NetLink (TM) Gigabit Ethernet", "192.168.10.1") ; OR _SetGateways("Local Area Network", "192.168.10.1") ; Configure DNS servers Local $DNS_SERVERS[4] = [ "192.168.100.1", "192.168.100.2", "192.168.100.3", "192.168.100.4" ] _SetDNSServerSearchOrder("Local Area Network", $DNS_SERVERS) ; OR _SetDNSServerSearchOrder("Broadcom NetLink (TM) Gigabit Ethernet", $DNS_SERVERS) ; Configure the DNS domain name _SetDNSDomain ("Local Area Network", "mondomain.loc") ; OR _SetDNSDomain ("Broadcom NetLink (TM) Gigabit Ethernet", "mondomain.loc") ; Configure the DNS suffixes for all connections : Local $DNS_SUFFIXES[2] = [ "mondomain.loc", "mydomain.priv" ] _SetDNSSuffixSearchOrder($DNS_SUFFIXES) ; Clear the DNS cache (like ipconfig /flushdns) _FlushDNS() ; Remove an entry from the DNS cache _FlushDNSEntry("www.autoitscript.com") ; Configure the WINS servers (very old, now ...) _SetWINSServer("Local Area Network", "192.168.100.251", "192.168.100.252") ; OR _SetWINSServer("Broadcom NetLink (TM) Gigabit Ethernet", "192.168.100.251", "192.168.100.252") ; Enable the two options : ; - Register this connection's address in DNS ( first parameter) ; - Use this connection's DNS suffix in DNS registration (second parameter) _SetDynamicDNSRegistration("Local Area Network", True, True) ; Release the DHCP lease _ReleaseDHCPLease() ; Renew the DHCP lease _RenewDHCPLease() ; Sets the Private category to the network connection called "LAN" _SetCategory("LAN", 1) Download link : Network.au3
    1 point
  2. You can get the network name using _GetNetworkAdapterList , get informations with _GetNetworkAdapterInfos, check if the adapter is wireless of not using _IsWirelessAdapter
    1 point
  3. Danp2

    Can't get Mouse click

    Some additional background details might help here. Also, there are other built-in functions for dealing with listboxes. Have you tried _GUICtrlListBox_SelectString along with _GUICtrlListBox_ClickItem or _GUICtrlListView_SetItemSelected?
    1 point
  4. Hallo, this is a better way #include <AutoItConstants.au3> $DG = GetDefaultGateway() While 1 If ProcessExists('chrome.exe') Or ProcessExists('iexplore.exe') Or ProcessExists('firefox.exe') Then If ($DG <> "192.162.1.1") Then Run("route -p change 0.0.0.0 mask 0.0.0.0 192.168.1.1", @SystemDir, @SW_HIDE) $DG = "192.168.1.1" EndIf Else If ($DG <> "192.168.1.2") Then Run("route -p change 0.0.0.0 mask 0.0.0.0 192.168.1.2", @SystemDir, @SW_HIDE) $DG = "192.168.1.2" EndIf EndIf Sleep(1000) WEnd Func GetDefaultGateway() Local $PID = Run("route print", @ScriptDir, @SW_HIDE, $STDOUT_CHILD) Local $out = "" While 1 $out &= StdoutRead($PID) If @error Then ExitLoop WEnd Return StringRegExp($out, "\s*0.0.0.0\s+0.0.0.0\s+(\d+\.\d+\.\d+\.\d+).*", 1)[0] EndFunc ;==>GetDefaultGateway
    1 point
  5. No. Try ContinueLoop.
    1 point
  6. you rock dude! happy programming! You can probably edit the very first post and add SOLVED to the Thread Title so other people searching one day will see how you solved it
    1 point
  7. @BrewManNH because the handle is created in the first instance of my Toolkit. It needs to be activated when a user tries to start a second instance. But on another note, close this thread, I've been looking waaaaaaay to far by trying to restore the window using the handle and everything. I just started from scratch, trying to use the _Singleton()-function to detect an already running instance, but using a way simpler solution to reactivate the window. And. It. Worked. Sometimes when the solution looks to easy, I get fooled. thanks @Earthshine anyways... The code I ended up using: Opt('WinTitleMatchMode',2) Local $SingletonHandle = _Singleton("VSOL ToolKit",1) If $SingletonHandle = 0 Then WinActivate("VSOL ToolKit") Exit EndIf I feel so enormously stupid right now. #sorryforwastingyourtime
    1 point
  8. GUICreate returns a handle, why can't you use that?
    1 point
  9. not suggesting we write it for you. could you try the ProcessExists function so that you can get the handle from process you care about? oh and there are GUI experts here who can probably help you, I just automate stuff, not much of a gui guy
    1 point
  10. JLogan3o13

    RegWrite Issues

    The old topic was a year old; I have split your intrusion into its own topic. What I am adding is that you need to create your own topics so someone from the Moderating team does not have to spend 20 minutes splitting them out.
    1 point
  11. Subz

    RegWrite Issues

    I would normally write it this way, so you're not limited by multiple network connections #RequireAdmin Local $sHKLM = @OSArch = 'x64' ? 'HKLM64' : 'HKLM' Local $sMainKey = $sHKLM & "\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\Profiles", $sSubkey, $i = 1 Local $iCategoryPrivate = 1, $iCategoryPublic = 0 While 1 $sSubkey = RegEnumKey($sMainKey, $i) If @error Then ExitLoop If RegRead($sMainKey & "\" & $sSubkey, "ProfileName") = "Network" Then ;~ Uncomment line below to change category ;~ RegWrite($sMainKey & "\" & $sSubkey, "Category", "REG_DWORD", $iCategoryPrivate) ElseIf RegRead($sMainKey & "\" & $sSubkey, "ProfileName") = "Network 2" Then ;~ Uncomment line below to change category ;~ RegWrite($sMainKey & "\" & $sSubkey, "Category", "REG_DWORD", $iCategoryPrivate) EndIf $i += 1 WEnd
    1 point
  12. @DazGizmo maybe an upgrade will help -> https://www.autoitscript.com/site/autoit-script-editor/downloads/?new
    1 point
  13. sorry to budge in so late, have you noticed that the position of the controls inside tabs are not relative to the tab position? well, what happens if you position the tab outside of the GUI, but leave the controls position unchanged? you get "hidden" tab, with perfectly visible controls: #include <GUIConstantsEx.au3> Example() Func Example() Local $msg GUICreate('"hidden" tab') GUISetBkColor(0x00E0FFFF) GUISetFont(9, 300) GUICtrlCreateTab(1000, 10, 200, 100) ; >>>>>>>>>> x=1000 = outside of the GUI Local $gTab0 = GUICtrlCreateTabItem("tab0") GUICtrlCreateLabel("label0", 30, 80, 50, 20) GUICtrlCreateButton("OK0", 20, 50, 50, 20) GUICtrlCreateInput("default", 80, 50, 70, 20) Local $gTab1 = GUICtrlCreateTabItem("tab----1") GUICtrlCreateLabel("label1", 30, 80, 50, 20) GUICtrlCreateCombo("", 20, 50, 60, 120) GUICtrlSetData(-1, "Trids|CyberSlug|Larry|Jon|Tylo", "Jon") ; default Jon GUICtrlCreateButton("OK1", 80, 50, 50, 20) Local $gTab2 = GUICtrlCreateTabItem("tab2") GUICtrlSetState(-1, $GUI_SHOW) ; will be display first GUICtrlCreateLabel("label2", 30, 80, 50, 20) GUICtrlCreateButton("OK2", 140, 50, 50) GUICtrlCreateTabItem("") ; end tabitem definition GUICtrlCreateLabel("label3", 20, 130, 50, 20) Local $gShowTab0 = GUICtrlCreateButton('show contents of tab 0', 20, 200, 200, 20) Local $gShowTab1 = GUICtrlCreateButton('show contents of tab 1', 20, 230, 200, 20) Local $gShowTab2 = GUICtrlCreateButton('show contents of tab 2', 20, 260, 200, 20) GUISetState() ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE ExitLoop Case $gShowTab0 GUICtrlSetState($gTab0, $GUI_SHOW) Case $gShowTab1 GUICtrlSetState($gTab1, $GUI_SHOW) Case $gShowTab2 GUICtrlSetState($gTab2, $GUI_SHOW) EndSwitch WEnd EndFunc ;==>Example PRO: you avoid the main window focus loss/regain that is apparent when using child GUI's. CON: transparent controls inside tab have their background color as the tab (i.e. white), not as the GUI.
    1 point
  14. You should look again at the Send Command list in the help file. Look at the list of keys. It gives {RSHIFT} for sending the right shift key. The method you are using is not clear to me, nor correct in my opinion.
    1 point
×
×
  • Create New...