fn(args*) { msgbox % Format("foo: {} bar: {}", args.foo, args.bar) } class Cls { fn(args*) { msgbox % Format("foo: {} bar: {}", args.foo, args.bar) } } F1:: fn({foo: "lorem", bar: "ipsum"}*) ; works Cls.fn({foo: "lorem", bar: "ipsum"}*) ; doesn't work return For some reason variadic arguments just ...
class Test { foo() { msgbox "foobar" } bar() { this.foo() } } F1:: test = new Test() test.bar() ; nothing happens return How do you access another method from inside a class? This should be simple, but I just can't get it to work. Are there any detailed and user-friendly documentation/tutorials of ...
Any good libraries for memory reading/writing in AHK?
I found https://github.com/Kalamity/classMemory but it hasn't been updated in 2 years so I'm a bit nervous writing on something that is not very future-proofed.
Thanks, but it doesn't really work very consistently. I usually tap my shortcuts really fast, so 0.5 is usually too slow. After some testing, it seems that I tap my shortcuts at the average of 0.06 seconds. But if I set the timeout to that length, it'd be just as fast as how I'd accidentally tap the...
I want to disable the Win key, but I also have several Win+* hotkeys. Is there a way to disable it without having all the other hotkeys to stop working? I tried the below, but it disables not only the Win key, but also my other hotkeys. LWin:: Return RWin:: Return This code also have the same effect...
Hey jeeswg, I'm trying to use your code from OBS start/stop switcher, but it doesn't seem to be working WinGet, hWnd, ID, OBS ahk_class Qt5QWindowIcon ControlGet, hCtl, Hwnd,, Qt5QWindowIcon10, % "ahk_id " hWnd vAccPath := "client.push_button2" oAcc := Acc_Get("Object", vAccPath, 0, "ahk_id " hCtl) ...
Ok my head isn't really working right now, the script does work, but I still don't understand the logic of how checking the existence of the ahk_group will help check whether or not they're active. To clarify, that line basically checks whether any windows matches with any one of the ahk_class (in t...
Thank you so much, your code works perfectly! Your insights really helped clear things up. I guess there's some kind of empty "gap" between switching windows. I also noticed in Window Spy, there's sometimes a small period between switching windows where the Window info box becomes completely empty. ...
I looked through other forum posts, and it doesn't seem to be the case. From what I gather WinWaitActive ahk_group should wait until any one of the programs in the group is active. While WinWaitNotActive ahk_group should wait until none of the programs in the group are active. But the more I test th...
Here's my code: GroupAdd, test, ahk_class Notepad GroupAdd, test, Task Switching ahk_class MultitaskingViewFrame WinWaitActive ahk_class Notepad WinWaitNotActive ahk_group test MsgBox, Test To replicate my issue, simply run the code, open/activate Notepad, then alt+tab away to any other program othe...
I'm trying to use a code by RHCP from this old forums. It's meant to simulate dropping files into an application https://autohotkey.com/board/topic/41467-make-ahk-drop-files-into-other-applications/page-2#entry638376 DropFiles( FileList, wTitle="", Ctrl="", X=0, Y=0, NCA=0 ) { characterSize := A_IsU...
#SingleInstance, Force #NoEnv SetBatchLines, -1 OnExit, Exit ; Uncomment if Gdip.ahk is not in your standard library ; #Include, Gdip.ahk if (!pToken := Gdip_Startup()) { MsgBox, 48, Gdiplus error!, Gdiplus failed to start. Please ensure you have Gdiplus on your system. ExitApp } return loop { File...
https://autohotkey.com/boards/viewtopic.php?t=2237 I'm trying the code from the above thread #SingleInstance, Force #NoEnv SetBatchLines, -1 OnExit, Exit FileOut := A_Desktop "\MyNewFile.png" ; Uncomment if Gdip.ahk is not in your standard library ; #Include, Gdip.ahk if (!pToken := Gdip_Startup()) ...