Search found 1183 matches

by Descolada
29 Mar 2024, 15:17
Forum: Scripts and Functions (v2)
Topic: AutoCorrect for v2
Replies: 145
Views: 16789

Re: AutoCorrect for v2

kunkel321 , apparently AHK doesn't consider only letters [A-Z], but it considers any locale-specific letters as well. It is possible to implement the same method that AHK internally uses, but for simplicity sake I opted to use a regex alternative instead which should give almost the same result. Th...
by Descolada
29 Mar 2024, 08:18
Forum: Ask for Help (v2)
Topic: Help computer wont open Autohotkey_2.0.4_setup
Replies: 6
Views: 464

Re: Help computer wont open Autohotkey_2.0.4_setup

dawidlukasz both versions of AutoHotkey are also unofficially available through Microsoft Store, which shouldn't have any permission issues. However, I also see you are trying to run the setup file from a temporary folder, perhaps the file was was deleted for some reason? Try downloading it to the ...
by Descolada
29 Mar 2024, 03:14
Forum: Scripts and Functions (v2)
Topic: AutoCorrect for v2
Replies: 145
Views: 16789

Re: AutoCorrect for v2

kunkel321 , Jasonosaj , I've written an experimental HotstringRecognizer class which could be used to detect the case of the trigger word. I've also modified the InputBuffer class a bit to account for modifier keys pressed down when the buffering is activated. Please notify me if you find any oddit...
by Descolada
29 Mar 2024, 00:48
Forum: Scripts and Functions (v2)
Topic: Buffered hotstrings
Replies: 11
Views: 1708

Re: Buffered hotstrings

kunkel321 , InputBuffer.Start() increases the internal reference count of active capture sessions, and Stop() decreases it. Once the reference count is 0 (meaning no other part of the code is depending on it being active any longer) the buffer is released. If you want to buffer the whole section of...
by Descolada
28 Mar 2024, 12:55
Forum: Scripts and Functions (v2)
Topic: Buffered hotstrings
Replies: 11
Views: 1708

Re: Buffered hotstrings

kunkel321 , if your code uses the static keyword then the variable gets initialized just once (on the first call), so it shouldn't be an issue. And even if you created it multiple times then it shouldn't cause issues, just be a bit less efficient as all the internal mechanisms get created and destr...
by Descolada
26 Mar 2024, 11:25
Forum: Scripts and Functions (v2)
Topic: [alpha] WinEvent - easily detect window open, close, move, and more
Replies: 56
Views: 4218

Re: [alpha] WinEvent - easily detect window open, close, move, and more

@jschwalbe, I've pushed an update to the library, please see if that fixed the problem.
Btw, are you running Windows 10, and did the halting happen only in Notepad? Did you manage to replicate it in other programs than Notepad?
by Descolada
26 Mar 2024, 11:23
Forum: Tutorials (v2)
Topic: Detect window open and close
Replies: 15
Views: 5977

Re: Detect window open and close

Albireo the purpose of this library is to replace Win... functions with non-blocking ones: while WinWaitActive and such block script execution until the window is in the desired state, WinEvent.Active lets the program do other stuff in the meanwhile and responds only when the window reaches the des...
by Descolada
26 Mar 2024, 11:14
Forum: Ask for Help (v2)
Topic: Sleep(-1) in WinEventProc causes unwanted delays
Replies: 4
Views: 258

Re: Sleep(-1) in WinEventProc causes unwanted delays

lexikos I did some tests as suggested. Starting code (ran in Windows 10, Notepad): #Requires AutoHotkey v2 #SingleInstance HandleWinEvent(*) { ;Critical -1 ;Critical("Off") static Entry := 0 Entry++ OutputDebug Entry "`n" Sleep -1 Entry-- } Esc::ExitApp #HotIf WinActive("Notepad") F2::{ pCallback :...
by Descolada
26 Mar 2024, 04:55
Forum: About This Community
Topic: Autohotkey within the Microsoft Store
Replies: 53
Views: 33625

Re: Autohotkey within the Microsoft Store

Update 2.0.12 The v2 Store Edition has been updated to v2.0.12! Changes/fixes: 1. The package contains AHK v2.0.12, v1.1.37.02, and Ahk2Exe v1.1.37.01c1. 2. Multiple bug fixes such as Explorer right-click new file context menu now containing AutoHotkey Script option 3. Multiple fixes to AutoHotkeyS...
by Descolada
26 Mar 2024, 04:37
Forum: Ask for Help (v2)
Topic: Sleep(-1) in WinEventProc causes unwanted delays
Replies: 4
Views: 258

Re: Sleep(-1) in WinEventProc causes unwanted delays

I'm fairly certain that whatever issue you are trying to demonstrate is not happening when I run your code. I don't see any "halting". I take it you mean there is a pause each time {Enter} is sent. That is exactly what is happening. It is difficult to tell what you are trying to demonstrate, since ...
by Descolada
26 Mar 2024, 00:16
Forum: Ask for Help (v2)
Topic: Sleep(-1) in WinEventProc causes unwanted delays
Replies: 4
Views: 258

Sleep(-1) in WinEventProc causes unwanted delays

#Requires AutoHotkey v2 #SingleInstance global TotalSleepCount := 0, pCallback := CallbackCreate(HandleWinEvent, "C Fast", 7) HandleWinEvent(hWinEventHook, event, hwnd, idObject, idChild, idEventThread, dwmsEventTime) { global TotalSleepCount += 1 Sleep -1 ; commenting this fixes the issue } #HotIf...
by Descolada
25 Mar 2024, 10:48
Forum: Ask for Help (v2)
Topic: How to obtain the memory address of a variable in AutoHotkey v2?
Replies: 28
Views: 1611

Re: How to obtain the memory address of a variable in AutoHotkey v2?

iseahound low_word := -1, high_word := -2, dword := MAKELPARAM(low_word, high_word) MsgBox dword "`n" GET_Y_LPARAM(dword) "`n" GET_X_LPARAM(dword) ; SHORT and INT GET_Y_LPARAM(lp) => ((lp&0xFFFFFFFF)<<32>>48) GET_X_LPARAM(lp) => ((lp&0xFFFFFFFF)<<48>>48) MAKELPARAM(l, h) => (l<<48>>>48)|(h<<48>>>32...
by Descolada
25 Mar 2024, 10:22
Forum: Tutorials (v2)
Topic: Detect window open and close
Replies: 15
Views: 5977

Re: Detect window open and close

Albireo , yes, you could use SetWinEventHook with EVENT_OBJECT_SHOW, or an easier method would be using my WinEvent class: #requires AutoHotkey v2 #include WinEvent.ahk WinEvent.Show(AIMS_Showed, "AIMS ahk_exe !!!!.exe ahk_class TShellForm", 1) Try Run aProg.file, aProg.path, "Max", &AimsPID catch ...
by Descolada
25 Mar 2024, 08:44
Forum: Ask for Help (v2)
Topic: How to obtain the memory address of a variable in AutoHotkey v2?
Replies: 28
Views: 1611

Re: How to obtain the memory address of a variable in AutoHotkey v2?

@iseahound 32-bit AHK uses 64-bit integers as well, so the following still works as expected:

Code: Select all

#Requires AutoHotkey v2 32-bit
MsgBox "Running " (A_PtrSize = 4 ? "32-bit" : "64-bit")
MsgBox 0xFFFF << 48 >> 48
by Descolada
24 Mar 2024, 13:57
Forum: Bug Reports
Topic: InputHook "suppress" doesn't suppress backspace Topic is solved
Replies: 3
Views: 590

InputHook "suppress" doesn't suppress backspace Topic is solved

F1::{ ih := InputHook("V") ih.KeyOpt("{All}", "S") ih.Start() } F2::ExitApp Run script, press F1, press backspace. Expected result: backspace is suppressed because of ih.KeyOpt("{All}", "S") Actual result: backspace is let through If the InputHook is created with the "B0" option then backspace is a...
by Descolada
24 Mar 2024, 12:16
Forum: Scripts and Functions (v2)
Topic: UIA v2
Replies: 385
Views: 58075

Re: UIA v2

fenchai browser automation with UIA is highly unreliable, because in addition to webpages user interface changing, also the browsers UIA tree tends to change with browser updates. I've needed to adapt and change UIA v2 UIA_Browser multiple times because of this. I am not updating v1 UIA_Interface a...
by Descolada
24 Mar 2024, 06:48
Forum: Bug Reports
Topic: WinTitle with multiple ahk_id uses only last one Topic is solved
Replies: 6
Views: 518

WinTitle with multiple ahk_id uses only last one Topic is solved

Not sure if this is expected behavior or a bug, but a WinTitle with multiple ahk_id's only uses the last one: list := WinGetList() hwnd1 := WinGetList()[1] hwnd2 := WinGetList()[2] MsgBox WinExist("ahk_id " hwnd1 " ahk_id " hwnd2) outputs hwnd2, whereas I would've have expected 0 (a window can't hav...
by Descolada
24 Mar 2024, 06:32
Forum: Scripts and Functions (v2)
Topic: [alpha] WinEvent - easily detect window open, close, move, and more
Replies: 56
Views: 4218

Re: [alpha] WinEvent - easily detect window open, close, move, and more

@eugenesv I've added WinEvent.Pause(), WinEvent.IsPaused, EventHook.Pause() and EventHook.IsPaused, so now you can use something like #p::WinEvent.Pause(-1), Pause(-1) ; Win+P.

@Spitzi the latest update should have fixed that issue.
by Descolada
23 Mar 2024, 07:14
Forum: Scripts and Functions (v2)
Topic: [alpha] WinEvent - easily detect window open, close, move, and more
Replies: 56
Views: 4218

Re: [alpha] WinEvent - easily detect window open, close, move, and more

eugenesv it doesn't make much sense because Suspend applies to hotkeys and hotstrings (WinEvents are neither); and Pause pauses the current thread, whereas WinEvents are launched via SetTimer as new threads. If you wish you can use Thread "NoTimers" to disable the callbacks for the duration of the ...

Go to advanced search