Hello All ,
I am new in this forum and I need a script AutoHotKey that sends Left click to Betternet VPN desktop application for windows to connect and disconnect (it is free to download). I ve tried my self many scripts but it seems that the application detects automated clicks and doesnt allow it (knowing that a simple mouse left click is just fine to connect/disconnect to the vpn)
Here is my last script that I used (suggested by a memeber in Discord who I thanks by the way) :
Sleep, 3000
Send, {Lbutton Down}
Send, {Lbutton Up}
I also tried other combinations .
Please I really need your help.
Thank you so much.
Cant left click in an application button
-
- Posts: 2
- Joined: 09 Aug 2019, 14:17
Cant left click in an application button
- Attachments
-
- betternet.JPG (20.54 KiB) Viewed 1561 times
- Sir Teddy the First
- Posts: 94
- Joined: 05 Aug 2019, 12:31
- Contact:
Re: Cant left click in an application button
Hi,
I downloaded the app but unfortunately, this is not a solution.
This is the script I used:
But the problem is: It does not work.
And it's not like your suggestion, that the application might block any automated clicks, it's rather that AHK itself stops working as soon as you activate that window.
The Clicking works fine until I add the "WinActivate" part, then the mouse won't move a single pixel.
But the script is able to get the applications active stats, which is very strange and I've never seen something like this before.
This problem is definetively not as simple as it seems.
It might have something to do with the fact that the class is "HwndWrapper". This is probably not a normal window, rather something similar to the Adobe Creative Cloud Window.
I downloaded the app but unfortunately, this is not a solution.
This is the script I used:
Code: Select all
#SingleInstance Force
CoordMode, Mouse, Client
DetectHiddenWindows On
WinActivate, ahk_class HwndWrapper[Betternet.exe;;b60a3822-1de3-4a13-84f3-57da579f214d]
WinGetActiveStats, Title, Width, Height, X, Y
MsgBox % Title ", " Width ", " Height ", " X ", " Y
Click, 125, 315
return
;ahk_exe Betternet.exe; 125 315 (Coordinates relative to client window)
And it's not like your suggestion, that the application might block any automated clicks, it's rather that AHK itself stops working as soon as you activate that window.
The Clicking works fine until I add the "WinActivate" part, then the mouse won't move a single pixel.
But the script is able to get the applications active stats, which is very strange and I've never seen something like this before.
This problem is definetively not as simple as it seems.
It might have something to do with the fact that the class is "HwndWrapper". This is probably not a normal window, rather something similar to the Adobe Creative Cloud Window.
Re: Cant left click in an application button
Since it wasn't mentioned, if anyone tried to run the script as admin, I'll just remind you of this possibility.
(Afaik, it is possible, to get the window stats of an elevated window with a non-elevated script, so this would still fit the description so far)
(Afaik, it is possible, to get the window stats of an elevated window with a non-elevated script, so this would still fit the description so far)
Re: Cant left click in an application button
Code: Select all
I've never seen something like this before
Re: Cant left click in an application button
Again, this seems to make perfect sense when your script is not running as admin and you try to interact with an elevated window/program.
Try this (run once as admin and once as non-admin):
Code: Select all
run taskmgr.exe ; starts task manager
WinWaitActive ahk_exe Taskmgr.exe
WinGetActiveStats, Title, Width, Height, X, Y
MsgBox % Title ", " Width ", " Height ", " X ", " Y ; works in both cases
return
Space::Click, 125, 300
1::MouseMove, 250, 100
Re: Cant left click in an application button
I guess you are right gregster , unfortunately i uninstalled betternet and now my PC went into a " windows is repairing your system " loop
On top of that my system backup ( only a few days old ) refuses to recover it because " the backup is made with a newer windows version " ????
So i will spend the evening with a clear install of ...... everythingq .......
On top of that my system backup ( only a few days old ) refuses to recover it because " the backup is made with a newer windows version " ????
So i will spend the evening with a clear install of ...... everythingq .......
-
- Posts: 2
- Joined: 09 Aug 2019, 14:17
Re: Cant left click in an application button
Your are awsome guys thank you very much.
I ve created a shortcut of the script and in propreties , in advanced (tab = ShortCut )run it as Admin and it works
I ve created a shortcut of the script and in propreties , in advanced (tab = ShortCut )run it as Admin and it works
Who is online
Users browsing this forum: scriptor2016 and 278 guests