Ok found a permanent fix for this. Sorry for double posting, just wanted to make a clear statement.
The code in my previous post will work but has the issue of running the program each time, and in the case of NetLimiter 4 for some reason more than one instance of the program can be run at the same time. So if you run NetLimiter 3 times in your script, you will end up 3 instances of NetLimiter. qBitTorrent has another issue where using TrayIcon_Button() would not work so I settled on running qbittorrent everytime since only one instance of qbittorrent can be running at any given time.
What I did to fix this is to DISABLE minimize to tray but i kept close to tray ENABLED. That way when I send a WinActivate command the program shows up normally and does not show me a blank window.
Code below if anyone is interested (however as stated above, I think its fixed not thanks to the script but thanks to that setting change in the program):
Code: Select all
showNetlimiter()
{
DetectHiddenWindows, On
isHidden := WinExist("ahk_exe NLClientApp.exe")
DetectHiddenWindows, Off
isNotHidden := WinExist("ahk_exe NLClientApp.exe")
if isHidden and !isNotHidden
{
TrayIcon_Button("NLClientApp.exe", "L", true)
}
else
WinActivate, ahk_exe NLClientApp.exe
WinWaitActive, ahk_exe NLClientApp.exe
; Very specific coordinates and size, would look very bad on your monitor (edit to your liking)
WinMove, ahk_exe NLClientApp.exe, , 2490, 1129, 517, 336
}
showQbittorrent()
{
if WinExist("ahk_exe qbittorrent.exe")
WinActivate, ahk_exe qbittorrent.exe
else
{
Run, C:\Program Files\qBittorrent\qbittorrent.exe
WinWait, ahk_exe qbittorrent.exe
WinActivate, ahk_exe qbittorrent.exe
}
WinWaitActive, ahk_exe qbittorrent.exe
; Very specific coordinates and size, would look very bad on your monitor (edit to your liking)
WinMove, ahk_exe qbittorrent.exe, , 1913, 1129, 592, 338
}