Search found 76 matches

by bonobo
10 May 2024, 22:53
Forum: Wish List
Topic: Wish: Make GUI font size (e.g. Tooltip) responsive to HKCU\SOFTWARE\Microsoft\Accessibility\TextScaleFactor
Replies: 1
Views: 426

Wish: Make GUI font size (e.g. Tooltip) responsive to HKCU\SOFTWARE\Microsoft\Accessibility\TextScaleFactor

I'm referring to the "Make Text Size Bigger" accessibility setting in Windows 10, which corresponds to HKEY_CURRENT_USER\SOFTWARE\Microsoft\Accessibility\TextScaleFactor By default it is set to 100%, but some people find their screen text hard to see and prefer to set it to some higher value (betwee...
by bonobo
08 Dec 2023, 16:42
Forum: Scripts and Functions (v2)
Topic: mm() a MsgBox alternative for debugging that shows not just the value but the source-code expression evaluated
Replies: 9
Views: 2140

Re: mm() a MsgBox alternative for debugging that shows not just the value but the source-code expression evaluated

Yep -- That works. Many thanks! Cheers! I would not advise the use of my Object2Str function, a better function would be my Obj_Gui function. Obj_Gui is a nice example how to display more complex variables. https://www.autohotkey.com/boards/viewtopic.php?f=83&t=103437&hilit=gui+object#p459683 Very ...
by bonobo
08 Dec 2023, 16:30
Forum: Scripts and Functions (v2)
Topic: WebView2
Replies: 139
Views: 36123

Re: WebView2

Has anyone been able to get WinSetTransColor to play nice with Webview2, so mouse events (clicking, hovering) over the non-transparent part of the page doesn't simply fall through? To illustarte, if I run this MyGui := Gui('+AlwaysOnTop') MyGui.BackColor := "F0F0F0" MyGui.OnEvent('Close', (*) => (wv...
by bonobo
07 Dec 2023, 13:52
Forum: Scripts and Functions (v2)
Topic: mm() a MsgBox alternative for debugging that shows not just the value but the source-code expression evaluated
Replies: 9
Views: 2140

Re: mm() a MsgBox alternative for debugging that shows not just the value but the source-code expression evaluated

Actually' AHK_user has a nice function (Object2Str) here that might be more suited for debugging purposes: https://www.autohotkey.com/boards/viewtopic.php?p=547378#p547378 However, this line in Object2Str if !(Type(Var) ~="Map|Array|Object|String|Number|Integer"){ should be changed to if !(Type(Var)...
by bonobo
07 Dec 2023, 13:20
Forum: Scripts and Functions (v2)
Topic: mm() a MsgBox alternative for debugging that shows not just the value but the source-code expression evaluated
Replies: 9
Views: 2140

Re: mm() a MsgBox alternative for debugging that shows not just the value but the source-code expression evaluated

Thanks for sharing this! I'm finally getting a chance to try it out. You mentioned a serializer... What is that? Can you post the one you're using? I'm guessing that this is related to the error I'm seeing: Hi kunkel321 , it's just a function that can convert AHK objects (objects, arrays, map, etc)...
by bonobo
04 Dec 2023, 06:50
Forum: Scripts and Functions (v2)
Topic: Environment.ahk - Change User and System Environment Variables Permanently
Replies: 4
Views: 1628

Re: Environment.ahk - Change User and System Environment Variables Permanently

Is there an actual difference between VarSetStrCapacity(&buf, cc) and VarSetStrCapacity(&buf, cc*(1?2:1))? (1?2:1) is a ternary operation, which is a shorthand for an if-else statement. It checks if a condition is true or false, and then returns one of two expressions based on the result. 1 is alwa...
by bonobo
03 Dec 2023, 16:34
Forum: Scripts and Functions (v2)
Topic: Environment.ahk - Change User and System Environment Variables Permanently
Replies: 4
Views: 1628

Re: Environment.ahk - Change User and System Environment Variables Permanently

Thank you for this very useful script. I noticed that the included GetFullPathName function GetFullPathName(path) { cc := DllCall("GetFullPathName", "str", path, "uint", 0, "ptr", 0, "ptr", 0, "uint") VarSetStrCapacity(&buf, cc) DllCall("GetFullPathName", "str", path, "uint", cc, "str", buf, "ptr", ...
by bonobo
27 Nov 2023, 15:39
Forum: Ask for Help (v2)
Topic: if "string_contained_in_array" in myArray ? /// no way to => if myArray.Has("string_contained_in_array) ? Topic is solved
Replies: 20
Views: 1529

Re: if "string_contained_in_array" in myArray ? /// no way to => if myArray.Has("string_contained_in_array) ? Topic is solved

I guess an array literal is basically a variadic function call to the Array constructor, so [fn*] is equivalent to Array(fn*). There are some statements to this effect in the difference between v1 and v2 section. "Array can be constructed with Array(values*) or [values*]. Variadic functions receive...
by bonobo
23 Nov 2023, 22:03
Forum: Scripts and Functions (v2)
Topic: ahk python interop via COM server - minimal working example
Replies: 0
Views: 491

ahk python interop via COM server - minimal working example

This is mostly based on MrDoge 's tutorial posted at https://stackoverflow.com/questions/65780086/how-to-program-hotstrings-in-python-like-in-autohotkey/65783573#65783573 Usage Examples: calling custom-defined functions: msgbox py("uuid_2_shortid", "ef0cbdd0-b71d-446e-8498-745a95606fc9") ; ⟹ "0L0M7x...
by bonobo
18 Nov 2023, 01:47
Forum: Scripts and Functions (v2)
Topic: mm() a MsgBox alternative for debugging that shows not just the value but the source-code expression evaluated
Replies: 9
Views: 2140

mm() a MsgBox alternative for debugging that shows not just the value but the source-code expression evaluated

Instead of Msgbox "var = " var you can just write: mm var And mm() will print "var ⟹ {{whatever the value of var is}}" Usage Examples: f := i=>i**i mm f(3) ; prints: f(3) ⟹ 27 mm f(4) ; prints: f(4) ⟹ 256 mm f(3)+f(4) ; prints: f(3)+f(4) ⟹ 283 mm 3.14*4**2 ; prints: 3.14*4**2 ⟹ 50.240000000000002 mm...
by bonobo
12 Nov 2023, 08:20
Forum: Ask for Help (v2)
Topic: Can console apps launched via Run using "hide" be later unhidden?
Replies: 4
Views: 381

Re: Can console apps launched via Run using "hide" be later unhidden?

Thanks mikeyww. But Run gives me only a PID, not a hwnd, and while this PID can be found via ProcessExist, it cannot be found via WinExist (with DetectHiddenWindow(1)), WinShow, etc, presumably because it's not itself a window. Part of what I'm wondering is if a window (if only a hidden one) was eve...
by bonobo
12 Nov 2023, 07:40
Forum: Ask for Help (v2)
Topic: Can console apps launched via Run using "hide" be later unhidden?
Replies: 4
Views: 381

Can console apps launched via Run using "hide" be later unhidden?

I've assigned a shortcut in AHK to start a http server, as follows: Run("node server.js",,"Hide",&PID) Because I specified "Hide", no console window is shown. (However, in process explorer I can see that the running node server instance still has a conhost.exe attached to it.) My question is: once a...
by bonobo
09 Nov 2023, 09:53
Forum: Ask for Help (v2)
Topic: How do I know when a window is "Always on top"?
Replies: 3
Views: 499

Re: How do I know when a window is "Always on top"?

This does not seem to work, it always detects the window is not on top regardless if I set it via WinSetAlwaysOnTop The code is taken from the doc; see the bottom example on this page: https://www.autohotkey.com/docs/v2/lib/WinGetStyle.htm On my machine it's producing the correct values as I toggle...
by bonobo
09 Nov 2023, 01:08
Forum: Ask for Help (v2)
Topic: How do I know when a window is "Always on top"?
Replies: 3
Views: 499

Re: How do I know when a window is "Always on top"?

You can use v2.1-alpha, it has WinGetAlwaysOnTop activeWindowIsAlwaysOnTop := WinGetAlwaysOnTop("A) https://www.autohotkey.com/docs/alpha/lib/WinGetAlwaysOnTop.htm In v2.0, try https://www.autohotkey.com/docs/v2/lib/WinGetStyle.htm activeWindowIsAlwaysOnTop := WinGetExStyle("A") & 0x8 ; 0x8 is WS_EX...
by bonobo
07 Nov 2023, 16:21
Forum: Scripts and Functions (v2)
Topic: WebSocket client (Implemented via winhttp)
Replies: 24
Views: 4691

Re: WebSocket client (Implemented via winhttp)

This is awesome! 👍

I'm using it to take advantage of some JS features, like variable width lookbehind.

I'm amazed how fast this is. I just tested sending a 8M JSON string to node, process it there using some regex , then send back the results (roughly 8.2M) and it all finished within 100ms.
by bonobo
06 Nov 2023, 02:50
Forum: Scripts and Functions (v2)
Topic: WebSocket client (Implemented via winhttp)
Replies: 24
Views: 4691

Re: WebSocket client (Implemented via winhttp)

Wow, this is awesome, thanks thqby! I've just tested with a 1M json and it went over (from node to JS)! On the other hand, this could be due to problems with my setup, but with the latest version of Websocket.ahk, sometimes the json message received is immediately followed by a second duplicate mess...
by bonobo
05 Nov 2023, 18:42
Forum: Scripts and Functions (v2)
Topic: WebSocket client (Implemented via winhttp)
Replies: 24
Views: 4691

Re: WebSocket client (Implemented via winhttp)

@bonobo Messages over 1m can be received using synchronous mode. Thanks thqby, that's good to know. I did some further testing and added this line under case 1,3 (in static WEBSOCKET_STATUSCHANGE(wp, lp, msg, hwnd) ). It appears that when the incoming message is long, a UTF-8 message fragment (case...
by bonobo
05 Nov 2023, 07:25
Forum: Scripts and Functions (v2)
Topic: WebSocket client (Implemented via winhttp)
Replies: 24
Views: 4691

Re: WebSocket client (Implemented via winhttp)

Maybe you're receiving binary data, and binary data is returned via the onData callback function. WebSocket(wsurl, { data: (this, buf) { ; ... } } Thanks thqby. I'm only sending json strings (text frames) back and forth. I tried the onData callback and it's not firing. The message handler fires whe...
by bonobo
05 Nov 2023, 06:24
Forum: Scripts and Functions (v2)
Topic: WebSocket client (Implemented via winhttp)
Replies: 24
Views: 4691

Re: WebSocket client (Implemented via winhttp)

thqby Would you happen to know if there's a way to receive very long messages, possibly in the MB range? I found that when the length of an incoming message exceeds 8k, the on message handler will not fire, and the websocket instance becomes unable to receive any other message, even short ones. I c...
by bonobo
03 Nov 2023, 18:02
Forum: Scripts and Functions (v2)
Topic: WebSocket client (Implemented via winhttp)
Replies: 24
Views: 4691

Re: WebSocket client (Implemented via winhttp)

Is your callback a com object from another thread or process? The data of websocket is accepted by other thread and synchronized to ahk thread with sendmessage. Therefore, the callback function is called in the window procedure of ahk. But in the window process, the outgoing call of com objects is ...

Go to advanced search