Search found 9355 matches

by lexikos
Today, 04:19
Forum: AutoHotkey Development
Topic: Typed properties - experimental build available
Replies: 65
Views: 10635

Re: Typed properties - experimental build available

If __value returns 0 for a null pointer, there will be ambiguity when the type is int*. A property of type int* would not return the int value; it would return an int*. How would you get the pointer value if it was automatically dereferenced? Don't be confused by the fact that a RECT.Pointer proper...
by lexikos
Today, 03:00
Forum: Ask for Help (v2)
Topic: static initialization, function auto-execution? Topic is solved
Replies: 3
Views: 78

Re: static initialization, function auto-execution? Topic is solved

mikeyww that is only about initialization of classes and property initializers in a class. It does not relate to static variables in a function, although the differences from v1 (and relation to initialization of global variables mentioned in the quote) are similar. The use of static to auto-execut...
by lexikos
Yesterday, 04:28
Forum: AutoHotkey Development
Topic: Typed properties - experimental build available
Replies: 65
Views: 10635

Re: Typed properties - experimental build available

thqby literally just removing the getter would defeat half the point. A field or return value of type RECT.Pointer is supposed to return a pointer-to-RECT, which behaves as a RECT. The object which has the __value property is an implementation detail hidden from the script by __value; it does not b...
by lexikos
Yesterday, 03:54
Forum: Ask for Help (v2)
Topic: Sleep(-1) in WinEventProc causes unwanted delays
Replies: 4
Views: 152

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

F3 sends the string fewer times because otherwise the script would run too long (because of the halting). Conversely, if there's no halting, F3 will complete faster. Why send so many keystrokes in F2? Better to write it so that the expected results are the same for both. Then you can say that F3 sh...
by lexikos
26 Mar 2024, 04:07
Forum: Ask for Help (v2)
Topic: Sleep(-1) in WinEventProc causes unwanted delays
Replies: 4
Views: 152

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. It is difficult to tell what you are trying to demonstrate, since the two hotkeys don't do the same th...
by lexikos
25 Mar 2024, 17:08
Forum: Bug Reports
Topic: WinTitle with multiple ahk_id uses only last one
Replies: 5
Views: 128

Re: WinTitle with multiple ahk_id uses only last one

@lmstearn I don't know what you're on about. I already explained why specifying ahk_id multiple times will not work.
by lexikos
25 Mar 2024, 17:05
Forum: Ask for Help (v2)
Topic: Passing GUI events to another GUI / letting GUI events fall through
Replies: 12
Views: 301

Re: Passing GUI events to another GUI / letting GUI events fall through

No, avoiding references to the GUI itself being passed indirectly back into the GUI (via an event handler or assigned property) is essential to avoid circular references. You can use bound functions and closures that refer to objects which don't directly or indirectly have any counted reference to t...
by lexikos
25 Mar 2024, 16:55
Forum: Ask for Help (v2)
Topic: How to obtain the memory address of a variable in AutoHotkey v2?
Replies: 20
Views: 608

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

MAKELPARAM is an alias for MAKELONG, which is defined as ((LONG)(((WORD)(((DWORD_PTR)(a)) & 0xffff)) | ((DWORD)((WORD)(((DWORD_PTR)(b)) & 0xffff))) << 16)) . If you take out the typecasts, you have ((a) & 0xffff) | (((b) & 0xffff) << 16) , which does in fact produce the correct result. Would iseahou...
by lexikos
25 Mar 2024, 07:49
Forum: Bug Reports
Topic: WinTitle with multiple ahk_id uses only last one
Replies: 5
Views: 128

Re: WinTitle with multiple ahk_id uses only last one

It is by design. WinExist wasn't intended to be used that way. Checks if the specified window exists Use ahk_id HWND ... to identify a window or control by its unique ID. The ahk_id criterion can also be combined with other criteria that the given window must match. You can't specify multiple window...
by lexikos
25 Mar 2024, 06:59
Forum: Ask for Help (v2)
Topic: How to obtain the memory address of a variable in AutoHotkey v2?
Replies: 20
Views: 608

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

iseahound I said nothing about LOWORD or "HIGH WORD" (or HIWORD). The correct macros to use for retrieving signed values that have been packed into message parameters are recommended in the documentation for the relevant messages. For instance, GET_X_LPARAM and GET_Y_LPARAM are recommended for use ...
by lexikos
25 Mar 2024, 06:17
Forum: Ask for Help (v2)
Topic: Trouble installing V2
Replies: 6
Views: 173

Re: Trouble installing V2

I have confirmed one possible cause of the "Access denied" error (at that specific line) is being denied write access to the subfolder of %APPDATA%\Microsoft\Crypto\RSA where the private key would be stored. Check that you (or the Administrators group) have write permission to that subfolder (the na...
by lexikos
24 Mar 2024, 16:50
Forum: Ask for Help (v2)
Topic: How to obtain the memory address of a variable in AutoHotkey v2?
Replies: 20
Views: 608

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

Does this mean that "&var" is only suitable for string variables? var is not a "string variable", but a variable that can contain anything, even if it currently contains a string. &var in v1 can return the address of a string even if the variable contained a number, and sometimes that is what you w...
by lexikos
24 Mar 2024, 16:37
Forum: Ask for Help (v2)
Topic: Trouble installing V2
Replies: 6
Views: 173

Re: Trouble installing V2

I would suggest running the following to confirm that the private key (which setup was failing to open or create) does not already exist. If you are unable to run .ahk files by double-clicking, you can drag-drop the file onto a copy of AutoHotkey.exe (v2). #Requires AutoHotkey v2 if !DllCall("Advapi...
by lexikos
24 Mar 2024, 05:52
Forum: Ask for Help (v2)
Topic: Trouble installing V2
Replies: 6
Views: 173

Re: Trouble installing V2

It is not possible for the message shown in picture 2 to appear if the files did not already exist before setup ran. The error shown in picture 3 is completely unrelated, and may well have occurred the first time around. This would have interrupted installation and put the installation directory in ...
by lexikos
24 Mar 2024, 03:06
Forum: AutoHotkey Development
Topic: Typed properties - experimental build available
Replies: 65
Views: 10635

Re: Typed properties - experimental build available

v2.1-alpha.9 (out now) Rather than constructing a struct and then replacing the already-allocated pointer with ObjSetDataPtr (which will probably be removed), StructFromPtr can be used to create a "typed pointer". At the moment it is more or less the same as a struct instance, but with __delete dis...
by lexikos
24 Mar 2024, 00:12
Forum: AutoHotkey Development
Topic: v2.1-alpha.9
Replies: 8
Views: 5760

v2.1-alpha.9

Added rudimentary struct pointers ( StructFromPtr ). Changed MouseGetPos to throw OSError if the mouse position cannot be determined. Changes applicable only to alpha users: Fixed static var := unset . Fixed throw() within Catch to re-throw. Fixed non-struct objects to not be allocated data by defau...
by lexikos
23 Mar 2024, 22:12
Forum: Ask for Help (v2)
Topic: How to obtain the memory address of a variable in AutoHotkey v2?
Replies: 20
Views: 608

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

ptr := &intVar never did "Get the address of the integer". It got the address of a string of digits . That is now achieved by StrPtr. This and most (optimistically "all") other changes are explained in Changes from v1.1 to v2.0 . Just search that page for "&var (address-of)". I would still want to ...
by lexikos
23 Mar 2024, 22:07
Forum: Ask for Help (v2)
Topic: Passing GUI events to another GUI / letting GUI events fall through
Replies: 12
Views: 301

Re: Passing GUI events to another GUI / letting GUI events fall through

The script ceases to be "persistent" when you close the GUI, so it exits (apparently before releasing the object). If you use Persistent , you will see the message. (see __New (Gui) ). This avoids circular references There is a special case in the implementation of __New: when EventObj == this , it ...
by lexikos
23 Mar 2024, 21:17
Forum: Ask for Help (v2)
Topic: Trouble installing V2
Replies: 6
Views: 173

Re: Trouble installing V2

The second screenshot indicates one of the following: A previous installation at the same location failed partway (i.e. the screenshot isn't from your first attempt). You have manually extracted the installation files to the installation directory prior to running setup, or similar. It is warning yo...
by lexikos
23 Mar 2024, 20:59
Forum: Ask for Help (v2)
Topic: Embed comment in menu? Topic is solved
Replies: 1
Views: 61

Re: Embed comment in menu? Topic is solved

It is the same as a function which uses return without a parameter, but if you want to be safe, you will use => "".

Go to advanced search