Search found 9361 matches

by lexikos
3 minutes ago
Forum: Ask for Help (v2)
Topic: Can the language be change
Replies: 6
Views: 101

Re: Can the language be change

I also wanted to be helpful in situations where users may want to replace it with a custom menu, as @boiler mentioned... It might be helpful to someone, but I think it just distracts from the actual answer to the original question (which you did include in your example, so don't take my criticism h...
by lexikos
7 minutes ago
Forum: Ask for Help (v2)
Topic: Why the interpreter complains about multiple statements inside an arrow function?
Replies: 2
Views: 57

Re: Why the interpreter complains about multiple statements inside an arrow function?

Arrow functions require an expression. You cannot use a statement inside an expression. Of course, color := PixelGetColor(270, 360) and ShowMessageBox('Uploading "' filename '"...') are also valid expressions, so you can just follow vmech's advice. If you need a control flow statement, you can't use...
by lexikos
18 minutes ago
Forum: Ask for Help (v2)
Topic: Autohotkey 2.0.12 and Smartscreen
Replies: 3
Views: 54

Re: Autohotkey 2.0.12 and Smartscreen

This is not a virus detection and should not be reported to Microsoft as a false positive. This is just the normal over-cautious behaviour of SmartScreen, warning about an unsigned file that was sourced from the Internet and has not yet built up reputation (because it is new ). The same thing someti...
by lexikos
58 minutes ago
Forum: Ask for Help (v2)
Topic: Can the language be change
Replies: 6
Views: 101

Re: Can the language be change

There is no need to hook the tray icon message. You can just rename the tray menu items with A_TrayMenu.Rename() when the script starts.
by lexikos
Today, 18:54
Forum: Ask for Help (v2)
Topic: Setting Icons added as resource to .exe
Replies: 2
Views: 21

Re: Setting Icons added as resource to .exe

"ICON1" is not a filename. The usage is TraySetIcon [FileName, IconNumber, Freeze] . AutoHotkey does not support specifying an icon resource by name. You can assign a numeric ID instead; a positive number for AddResource but prefix it with - in IconNumber. If negative, the absolute value is assumed ...
by lexikos
Today, 04:19
Forum: AutoHotkey Development
Topic: Typed properties - experimental build available
Replies: 66
Views: 10677

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: 110

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: 66
Views: 10677

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: 156

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: 156

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: 136

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: 308

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: 614

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: 136

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: 614

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: 614

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 ...

Go to advanced search