ToggleNic, and DuMeter

Post your working scripts, libraries and tools
User avatar
megnatar
Posts: 71
Joined: 27 Oct 2014, 20:49
GitHub: Megnatar
Location: The Netherlands

Re: Turn Network device on/off by application

26 Jul 2016, 12:19

Update:
Moved the bandwidth meter to the top side of the monitor.
Converted the units B/KiB/MB from the bandwidth meter to the correct values.
Rounded up the units to two decimal points.

ToDo:
Change the bandwidth meter tooltip to a gui, so it can be placed anywhere on the screen.
User avatar
megnatar
Posts: 71
Joined: 27 Oct 2014, 20:49
GitHub: Megnatar
Location: The Netherlands

Re: Turn Network device on/off by application

30 Jul 2016, 04:39

UpDate:
Replaced the fixed tooltip that displayed the bandwidth, for a small borderless and draggable gui.
Also it now only shows killo bytes and Mega bytes where needed. The previous version also displayed the bandwidth in bytes.
But of course a byte is just to small. Making the unit to jump from byte to killo byte all the time, like coo coo..
Its much easier on the eye now.
User avatar
Wickster
Posts: 21
Joined: 19 Apr 2014, 23:02

Re: Turn Network device on/off by application

02 Aug 2016, 22:50

thanks for all the hard work and all the updates. keep em coming!
User avatar
megnatar
Posts: 71
Joined: 27 Oct 2014, 20:49
GitHub: Megnatar
Location: The Netherlands

Re: Turn Network device on/off by application

04 Aug 2016, 14:20

Update:
- Re ordered the placement of the D/U meter gui in the script so it now loads almost instantly.
- Margin/Section based gui
- A integer zero is not displayed in the D/U meter. So the number updates or downgrades nicely but never jumps back to zero.
User avatar
megnatar
Posts: 71
Joined: 27 Oct 2014, 20:49
GitHub: Megnatar
Location: The Netherlands

Re: Turn Network device on/off by application

12 Aug 2016, 11:38

UpDate:
- Black border added.
- Better GUI drag handling. The whole background window now handles the dragging while before it was each text control.
- The script 'remembers' in between sessions and script exit/next run, if DU meter was running. Disables the DU meter when NIC is shutdown. And enables it once more when NIC is switched on.
User avatar
megnatar
Posts: 71
Joined: 27 Oct 2014, 20:49
GitHub: Megnatar
Location: The Netherlands

Re: Turn Network device on/off by application

13 Aug 2016, 12:39

thanks for all the hard work and all the updates. keep em coming!
You're welcome!
User avatar
megnatar
Posts: 71
Joined: 27 Oct 2014, 20:49
GitHub: Megnatar
Location: The Netherlands

Re: Turn Network device on/off by application | Du Meter

17 Aug 2016, 20:13

Beta UpDate:
- For the tooltip it: retrieves wan-ip when used from behind a router. Simply by using ping
- Moved some code around here and there.
User avatar
megnatar
Posts: 71
Joined: 27 Oct 2014, 20:49
GitHub: Megnatar
Location: The Netherlands

Re: Turn Network device on/off by application | Du Meter

13 Sep 2016, 17:49

Update:
ToggleNic v1.0.2

Changed or added:
- Improved the way to discover the WAN ip. It now works flawless.
- Added a function to update status info, to prevent endless code repetition.
- Simplified the way to fill the drop down list with all found network devices.
- A right click on the DU window will also display the tray menu.
- Reduced the number of, same lines of code.
- Slightly changed the DU-meter GUI
- The status of tray icon and tooltip will always update. Regardless if the nic is disabled/enabled by the script.
User avatar
megnatar
Posts: 71
Joined: 27 Oct 2014, 20:49
GitHub: Megnatar
Location: The Netherlands

Re: Turn Network device on/off by application | Du Meter

17 Sep 2016, 12:15

Error:
Image
If you downloaded a updated version of this script, then it might help to delete the settings.ini.
I changed it recently and variable IconFile now needs to be a Global variable since it's used in function StatusUpDate().
Remember that the file with allowed apps will also be removed! So make a backup!

Maybe its a good idea to let the script take care of this in future releases by checking version numbers....

Code: Select all

	;Checking if operating system is windows10 or not. Icons are only tested on win10 and 7.
	If(A_OSVersion >= 10 ){
		IconEnabled := 13
		IconDisabled := 1
	}Else{
		IconEnabled := 28
		IconDisabled := 13
	}

Thank you!
Megnatar
Last edited by megnatar on 17 Sep 2016, 13:17, edited 3 times in total.
User avatar
megnatar
Posts: 71
Joined: 27 Oct 2014, 20:49
GitHub: Megnatar
Location: The Netherlands

Re: Turn Network device on/off by application | Du Meter

17 Sep 2016, 12:37

Update:

Changed or added:
- Fixed some minor bugs.
- Removed unused vars.
- Removed functions that are called only once and added there "function" as regular code.
- Removed the empty gui text control with the gLable that controlled gui dragging. A function now controls gui dragging and is triggered by OnMessage WM_LBUTTONDOWN.
- Combined some math operations to a single line, where before the where multi line.
- Added a slider control to change the DuMeter update interval. It can be set between 500ms and 3sec in steps of 500ms. 500 to 1000 to 1500 and so on ...
- Added a Idle timer for DuMeter using A_TickCount. It changes the gui text and update interval after 1minute of inactivity (I'm not sure if i'm satisfied with it, I might remove it)
User avatar
megnatar
Posts: 71
Joined: 27 Oct 2014, 20:49
GitHub: Megnatar
Location: The Netherlands

Re: Turn Network device on/off by application | Du Meter

25 Sep 2016, 16:34

Update: 1.0.3 beta

Changed or added:
- Added option to disable auto toggle by app
- Added option to never hide DU Meter
- Replaced notepad for adding/removing new apps with a ListView
- Retrieving WAN-IP is now language independent and also faster since its all done in memory. I removed the file operations
User avatar
megnatar
Posts: 71
Joined: 27 Oct 2014, 20:49
GitHub: Megnatar
Location: The Netherlands

Re: Turn Network device on/off by application | Du Meter

25 Mar 2018, 07:20

Update to V2.0.1
- Automagically detects if you're behind a router.
- Code makes more sense, and is improved to a more expressive style.
- Tray status icons now show when the nic is On, Off or No network connection available.
- Compatibility added for win8
- Fixed wrong disabled icon on win8
- Added a check to see if the 1st DNS-IP is not local.
User avatar
megnatar
Posts: 71
Joined: 27 Oct 2014, 20:49
GitHub: Megnatar
Location: The Netherlands

Re: ToggleNic v2.0.3 --> Toggles Network device by application | and DuMeter

01 Apr 2018, 18:19

Update to V2.0.3
- Replaced the loop that monitored when a allowed application was launched or closed,
for a shell message monitor. The monitor checks if each new launched application is in
the allowed list or not. Thus reducing CPU usage nearly to zero
WeetIkVeel
Posts: 1
Joined: 23 Jun 2018, 02:42

Re: ToggleNic v2.0.5 --> Toggles Network device by application | and DuMeter

23 Jun 2018, 02:47

Hello megnatar,

cool script, it works great
User avatar
megnatar
Posts: 71
Joined: 27 Oct 2014, 20:49
GitHub: Megnatar
Location: The Netherlands

Re: ToggleNic v2.0.5 --> Toggles Network device by application | and DuMeter

26 Jun 2018, 14:59

Thank You ! :)
burque505
Posts: 630
Joined: 22 Jan 2017, 19:37

Re: ToggleNic v2.0.5 --> Toggles Network device by application | and DuMeter

26 Jun 2018, 15:43

You're really staying on top of this, thanks for sharing! :bravo:
Regards,
burque505
User avatar
megnatar
Posts: 71
Joined: 27 Oct 2014, 20:49
GitHub: Megnatar
Location: The Netherlands

Re: ToggleNic v2.0.5 --> Toggles Network device by application | and DuMeter

27 Jun 2018, 08:28

You're really staying on top of this, thanks for sharing! :bravo:
Regards,
burque505
Thanks for the support!
Its much appreciated

Return to “Scripts and Functions”

Who is online

Users browsing this forum: gwarble, Wicked and 41 guests