home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   alt.comp.os.windows-10      Steaming pile of horseshit Windows 10      197,590 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 196,354 of 197,590   
   Marian to All   
   Re: Tutorial: Vastly improving Aloha fre   
   21 Dec 25 17:42:45   
   
   XPost: alt.comp.os.windows-11, alt.comp.microsoft.windows   
   From: marianjones@helpfulpeople.com   
      
   UPDATE:   
      
   This is perfect now! It does everything we needed it to do with Aloha!   
      
   Now that we have the Aloha VPN browser working without constantly shutting   
   off the VPN, the only thing left was to also automatically click away   
   the fat wasted-space "VPN has disconnected" banner (which does nothing but   
   take up space).   
      
   Using Window Spy for AHK, the distance to its "[x]Close" always seemed to   
   be the same number of pixels from the right edge of the Aloha browser   
   window, while the distance from the top edge to its "[x]Close" was always   
   within a small range depending on the window length & width sizing.   
      
   This allowed me to improve the AHK script so that now when it notices the   
   shield went to gray, it turns the shield blue first and then clicks away   
   the wasted-space banner by finding * tapping the center of the closing (X).   
      
    ; C:\data\sys\ahk\alohavpn.ahk   
    ; This is alohavpn.ahk v2p0   
    ; This script automatically launches the Aloha VPN Browser,   
    ; which is set to open only one tab to this web page   
    ; aloha://settings/clearBrowserData   
    ; so the user presses the button to clear browsing data, and   
    ; then this script continuously monitors the VPN shield icon   
    ; by clicking it only if it¢s off (gray)   
    ; to ensure the VPN stays enabled (blue)   
    ; even if the browser window isn't the active window   
    ; and even if the browser window is behind others.   
    ; Behavior: C:\Program Files\AutoHotkey\v2\AutoHotkey64.exe   
    ;  1) Opens Aloha browser   
    ;  2) Clicks VPN (gray) shield icon to enable it (blue);   
    ;  3) Then periodically checks the shield x:y location 140:53;   
    ;  4) If the shield is gray (off), click it; if blue (on), do nothing.   
    ; Notes:   
    ; Limit on comment line length is .......................................   
    ;  Coordinates are relative to the Aloha window (CoordMode "Window").   
    ;  The origin (0,0) is the window top-left corner (incl title/borders).   
    ;  The X increases to the right; the Y increases downward.   
    ;  Works regardless of which monitor the window is on or where it¢s moved.   
    ;  Works regardless of window size.   
    ;  Works on the window regardless if it's active (current focus) or not.   
    ;  Use Window Spy to confirm pixel colors and window-relative coordinates.   
    ;  Clicks use ControlClick so focus isn¢t stolen & the mouse doesn¢t move.   
    ; This TARGET works as a shortcut but it can't be pinned to the taskbar:   
    ;  TARGET=C:\data\sys\ahk\alohavpn.ahk   
    ; This Windows shortcut TARGET can be pinned to the taskbar:   
    ;  "C:\Program Files\AutoHotkey\v2\AutoHotkey64.exe" "C:\data\s   
   s\ahk\alohavpn.ahk"   
    ; Versions   
    ;  v1p0 20250910 59 lines   
    ;   Launches the freeware Aloha VPN Browser [Version 4.9.0.0 (64-bit)]   
    ;   Set the shortcut TARGET = C:\data\sys\ahk\aloha_vpn.ahk   
    ;   This script runs Aloha which opens to clearBrowserData   
    ;       
    ;   This script taps the "Clear data" button on bottom right   
    ;   Then it taps the VPN shield at top to turn the shield on automatically   
    ;  v1p1 20251016 68 lines   
    ;   Taps the shield icon every 30 seconds   
    ;   The probem is that it toggles it off if it had been toggled on   
    ;  v1p2 20251016 75 lines   
    ;   Use "C:\Program Files\AutoHotkey\WindowSpy.ahk" to get the color   
    ;   Click 601, 68 ; this is in the blue/gray part (5895F6/BEBEC4)   
    ;  v1p3 20251016 142 lines   
    ;   If gray, tap it. If blue, don't tap it.   
    ;   Colors from Window Spy (hex RRGGBB)   
    ;    blueHex := 0x5895F6   
    ;    grayHex := 0xBEBEC4   
    ;    tolerance := 30  ; adjust if needed (0-441)   
    ;   ControlClick without moving the visible mouse (no flicker)   
    ;  v1p4 20251016 148 lines   
    ;   Changed the time period from 30 seconds to 1 second   
    ;   30 seconds = 30000, 1 second = 1000   
    ;  v1p5 20251016 127 lines   
    ;   Cleaned up comments   
    ;  v1p6 20251016 161 lines   
    ;   Changed hard-coded path to aloha.exe to be independent of user   
    ;   Added detection of run failure for a more robust watcher   
    ;  v1p7 20251017 175 lines   
    ;   Removed the clear-cookies click to simplify the script.   
    ;   Added the ability to monitor the shield no matter where it is.   
    ;   Changed x:y coordinates relative to the screen top-left origin   
    ;   to x:y (140:53) coordinates relative to the window top-left origin.   
    ;   Screen: 602, 67, Window: 140, 53   
    ;   No matter where the Aloha window is on the monitor, the shield   
    ;   icon will always be at (140,53) relative to the window¢s origin.   
    ;   Client: 132, 53 (default) (i.e., main monitor)   
    ;   Color: 5895F6 (Red=58 Green=95 Blue=F6) (blue)   
    ;   Active windows position   
    ;   Screen: x: 462 y: 14 w: 910	h: 1060   
    ;   Client: x: 470 y: 14 w: 894	h: 1052   
    ;   The shield icon is always (139,54) relative to window origin   
    ;   (or (131,54) in client coordinates).   
    ;   Aloha isn¢t repainting shield icon when the window is unfocused.   
    ;   so we need to force a tiny "change" in aloha to repaint pixels.   
    ;  v1p8 20251020 189 lines   
    ;   Cleaned up the debugging commands   
    ;  v1p9 20251104 178 lines   
    ;   Wrapped the transparency calls in try/catch so they don¢t throw   
    ;   fatal errors if the window disappears.   
    ;   Added a double-check that the hwnd is still valid before   
    ;   calling WinSetTransparent.   
    ;  v2p0 20251221 223 lines   
    ;   add code to close the banner that pops up when the blue shield   
    ;   turns to gray randomly (every few minutes or so) saying:   
    ;    "VPN has been disconnected. For basic accounts, VPN works only   
    ;     in Aloha Broser. Upgrade to Premium to protect your whole computer.   
    ;     (Upgrade to Premium)(Not now)(x)Close"   
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;   
    ; Step 1: Launch Aloha VPN Browser and capture its PID   
    ; The new instance replaces older running instances sans prompting.   
    ; --- Aloha VPN Auto-Enable Script (fixed) ---   
      
    ; --- ALOHA LAUNCH BLOCK START ---   
    #SingleInstance Force   
    localAppData := EnvGet("LOCALAPPDATA")   
    exePath := localAppData . "\Aloha Mobile\Aloha\Application\aloha.exe"   
      
    if !FileExist(exePath) {   
        MsgBox "Aloha executable not found:`n" exePath   
        ExitApp   
    }   
      
    Run(exePath)   
      
    if !WinWait("ahk_class Chrome_WidgetWin_1", , 10) {   
        MsgBox "Aloha started but no window appeared within 10s."   
        ExitApp   
    }   
      
    appPid := WinGetPID("ahk_class Chrome_WidgetWin_1")   
    if !appPid {   
        MsgBox "Could not determine Aloha PID after launch."   
        ExitApp   
    }   
    ; --- ALOHA LAUNCH BLOCK END ---   
      
    Sleep 3000   
      
    CoordMode "Mouse", "Client"   
    CoordMode "Pixel", "Client"   
      
      
   [continued in next message]   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca