Search found 1433 matches

by iseahound
Yesterday, 08:22
Forum: AutoHotkey Development
Topic: Typed properties - experimental build available
Replies: 64
Views: 10618

Re: Typed properties - experimental build available

What's the best solution for a one-off structure returned by a DllCall? I can't define a class inside a function, but would like to wrap the pointer anyways. Also it's possible that a rectangle may be [xywh] or [xyx2y2] so a global definition may not be ideal.
by iseahound
26 Mar 2024, 09:19
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?

I distinctly remember running into bugs with negative numbers when merging them as two integers side by side into an int64. It's possible the masking is an important step that I didn't use, as clearly shown above. If you think the masking is important, then just say so, otherwise I've clearly given ...
by iseahound
25 Mar 2024, 09: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?

Wow so it's safe to assume a 64-bit signed buffer even on 32-bit AutoHotkey? That makes sign extension via bit shifting more reliable.

Someone should figure out the MAKEPARAM macro described above, clearly x | y << 16 doesn't work for negative numbers.
by iseahound
25 Mar 2024, 08:42
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?

32-bit autohotkey does exist, so a purely bitwise operation can't be compatible across 32-bit and 64-bit versions.
by iseahound
24 Mar 2024, 19:34
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?

As far as I can remember, Microsoft doesn't recommend the use of the LOWORD and HIGH WORD macros because bit magic causes the same problems: signed values can't be retrieved using bitwise operators. For example if I try to get -1, the twos complement of a signed short would be 0xFFFF, and I'd have t...
by iseahound
24 Mar 2024, 11:53
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

This sounds like a regular expression parser that uses backtracking to find "ahk_id". In any case it has the nice property of allowing the user to concatenate using the ".=" operator, and to override previous choices with new ones. Since it's not clear what the expected behavior should be, it's not ...
by iseahound
24 Mar 2024, 11:44
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?

For the IntPtr question, in the WindowProc commonly x and y are sent together as a series of signed shorts concatenation into an integer. The current method of getting signed shorts from an int is to copy them into a buffer and use NumGet. Having access to IntPtr would allow NumGet to be used on the...
by iseahound
14 Mar 2024, 11:58
Forum: Ask for Help (v2)
Topic: Does anyone have a good OCR solution with V2?
Replies: 9
Views: 1734

Re: Does anyone have a good OCR solution with V2?

Yep. The fact is paid APIs offer a much more compelling OCR solution than what's possible on the local system. You could also create an esemble of APIs, where you use about 3 services, and mix those results up for a better truth model. If you're asking about integration, there's only 3 ways image da...
by iseahound
14 Mar 2024, 11:54
Forum: Ask for Help (v2)
Topic: Capslock doesn't work for a modifier key.
Replies: 7
Views: 179

Re: Capslock doesn't work for a modifier key.

Certain combinations of keys don't work for me on my Apple Magic Keyboard such as CapsLock + Control + /.

Try this CapsLock script:
viewtopic.php?f=96&t=125147
by iseahound
13 Mar 2024, 23:22
Forum: Ask for Help (v2)
Topic: String manipulation speed test -- Is this right? Topic is solved
Replies: 6
Views: 187

Re: String manipulation speed test -- Is this right? Topic is solved

arrays are structures and have a small amount of fixed overhead.

You could use a combination of STRPTR and rtlcomparememory for the absolute fastest string comparisons. SubStr will always create a copy of your string.
by iseahound
12 Mar 2024, 09:49
Forum: Scripts and Functions (v2)
Topic: ImagePut - A core library for images in AutoHotkey (Now supports HEIC & WEBP)
Replies: 82
Views: 28156

Re: ImagePut - A core library for images in AutoHotkey (Now supports HEIC & WEBP)

That's not me... WinExist() is case sensitive. Try ahk_class Notepad on Windows 11. I think before, it used to be lowercase on Windows 7 and I never changed the documentation.
by iseahound
08 Mar 2024, 12:11
Forum: Ask for Help (v2)
Topic: Does anyone have code to Change the DPI of the current monitor?
Replies: 3
Views: 175

Re: Does anyone have code to Change the DPI of the current monitor?

On that note, here's some code that connects the sourceID and adapterID to an hMonitor handle: #include <Windows.h> #include <stdio.h> #include <vector> #include <tuple> #include <string> int main() { // get all paths UINT pathCount; UINT modeCount; if (GetDisplayConfigBufferSizes(QDC_ONLY_ACTIVE_PA...
by iseahound
08 Mar 2024, 11:05
Forum: Ask for Help (v2)
Topic: Does anyone have code to Change the DPI of the current monitor?
Replies: 3
Views: 175

Re: Does anyone have code to Change the DPI of the current monitor?

It's close. I think the structures I'm showing are undocumented. Teadrinker uses only the publicly available API. Some issues I had were trying to convert the sourceID and adapterID into a simple hMonitor handle. If these two are connected, it should be able to do: A hotkey that sets the recommended...
by iseahound
07 Mar 2024, 18:30
Forum: Tutorials (v2)
Topic: Screen scaling, DPI, and making scripts work in different computers
Replies: 6
Views: 5843

Re: Screen scaling, DPI, and making scripts work in different computers

@Descolada Did you manage to figure out which function windows uses to scale with DPI? That would fix most of the DPI related imagesearch issues.
by iseahound
07 Mar 2024, 18:28
Forum: Ask for Help (v2)
Topic: Does anyone have code to Change the DPI of the current monitor?
Replies: 3
Views: 175

Does anyone have code to Change the DPI of the current monitor?

Was wondering if anyone had already written a utility to change the DPI of the monitor. image.png Here is some half finished work: ; struct DISPLAYCONFIG_DEVICE_INFO_HEADER NumPut( "uint", -3 ; DISPLAYCONFIG_DEVICE_INFO_GET_DPI_SCALE , "uint", 28 , "uint", adapterID , "uint", sourceID , "int", 0 ; m...
by iseahound
01 Mar 2024, 12:22
Forum: Ask for Help (v2)
Topic: Static methods in base class not accesssible in derived class via "this".
Replies: 11
Views: 339

Re: Static methods in base class not accesssible in derived class via "this".

No it's not directly possible. You'll have to play around with either making the method static and calling super/prototype or making it an instance method and calling it using class.prototype.

If you want to support both forms you'll need a simple helper function.
by iseahound
27 Feb 2024, 19:15
Forum: Suggestions on Documentation Improvements
Topic: RawRead()
Replies: 1
Views: 113

RawRead()

Please add a note that if a UTF-8 BOM file is encountered, the file pointer is set to 3. Therefore calls to RawRead() will read 3 less bytes.

The user should add

Code: Select all

f.pos := 0
before calls to rawread or they may get errors.

This may be a bug.
by iseahound
27 Feb 2024, 12:12
Forum: Scripts and Functions (v2)
Topic: ImagePut - A core library for images in AutoHotkey (Now supports HEIC & WEBP)
Replies: 82
Views: 28156

Re: ImagePut - A core library for images in AutoHotkey (Now supports HEIC & WEBP)

Nice to hear. In case anyone was wondering, the latest update searches the first few bytes of the buffer object ( ptr and size ) for magic numbers that might indicate if it was a png or a gif. If not, it then looks to see if the buffer object has a width or pitch/stride or height property, and it as...
by iseahound
25 Feb 2024, 16:41
Forum: Scripts and Functions (v2)
Topic: ImagePut - A core library for images in AutoHotkey (Now supports HEIC & WEBP)
Replies: 82
Views: 28156

Re: ImagePut - A core library for images in AutoHotkey (Now supports HEIC & WEBP)

william_ahk Can you experiment with the latest version using ImagePutEncodedBuffer ? You will obviously have to use buf.ptr on AutoHotkey v1, and it should operate like a normal buffer object on v2. Feel free to "construct" a buffer via {ptr: ptr, size: size} as well. https://github.com/iseahound/I...

Go to advanced search