Search found 26 matches
- 07 May 2022, 16:14
- Forum: Ask for Help (v2)
- Topic: Can't get F5 to be sent to a window after activation Topic is solved
- Replies: 3
- Views: 638
Re: Can't get F5 to be sent to a window after activation Topic is solved
Per @Helgef answer, I set "SetKeyDelay 10, 10", and now it works correctly. It works regardless of using WinWait, or WinWaitActive; thought I switched to using WinWaitActive, because it should be a more appropriate call.
- 05 May 2022, 17:10
- Forum: Ask for Help (v2)
- Topic: Can't get F5 to be sent to a window after activation Topic is solved
- Replies: 3
- Views: 638
Can't get F5 to be sent to a window after activation Topic is solved
In the following code, I want to activate a window, then send F5. I can get the window to activate, but the F5 is not sent. SetTitleMatchMode 1 AppsKey:: { hwnd := WinExist('Flux Viewer') if hwnd { WinActivate hwnd WinWait hwnd Send '{F5}' } } I also tried SendEvent and SendInput. Also, instead of W...
- 05 May 2022, 15:39
- Forum: Ask for Help (v1)
- Topic: Gui layout hbox/vbox Topic is solved
- Replies: 1
- Views: 236
Gui layout hbox/vbox Topic is solved
For laying out Guis, how does one represent VBOXs and HBOXs? In other words, how to layout Gui items vertically and horizontally.
- 05 May 2022, 07:26
- Forum: Ask for Help (v2)
- Topic: Gui OnClose event that calls class static function with param Topic is solved
- Replies: 6
- Views: 922
Re: Gui OnClose event that calls class static function with param Topic is solved
This is the version that works for me, the other 2 didn't.
A hidden this on a static method. That is so trippy.
Thanks for the help
Code: Select all
this.OnEvent('close', MyGui.OnClose)
; ...
static OnClose() {
MyLog 'value: ' this.GetValue()
return false
}
Thanks for the help
- 05 May 2022, 06:53
- Forum: Ask for Help (v2)
- Topic: Gui OnClose event that calls class static function with param Topic is solved
- Replies: 6
- Views: 922
Re: Gui OnClose event that calls class static function with param Topic is solved
I tried versions of your example code, but I couldn't get any combination to work. Are you sure that a static method has access to 'this'? I find that notion strange. Here's some code. What line can be added to __New such that "static OnClose" is called with a parameter that can call "GetValue()". c...
- 05 May 2022, 05:24
- Forum: Ask for Help (v2)
- Topic: Gui OnClose event that calls class static function with param Topic is solved
- Replies: 6
- Views: 922
Gui OnClose event that calls class static function with param Topic is solved
I have this gui class for which I want to listen to the OnClose event. I can get the event to fire using 2 ways: 1) A regular (non-class) function, which can accept the gui object. 2) A class static function without the gui object param. However, I get an error if I use a static class function that ...
- 05 May 2022, 00:17
- Forum: AutoHotkey Development
- Topic: __Set/__Get get called in constructor for defined field; they shouldn't.
- Replies: 7
- Views: 1256
Re: __Set/__Get get called in constructor for defined field; they shouldn't.
Hey man, lexikos, I just want to say that, personally, I think you're doing a fantastic job with leading AutoHotkey. I can imagine that, often, it can be a thankless job. The feedback I provide, if one can call it that, is because I think AutoHotkey is pretty cool. I don't mean for the feedback to b...
- 04 May 2022, 04:33
- Forum: AutoHotkey Development
- Topic: __Set/__Get get called in constructor for defined field; they shouldn't.
- Replies: 7
- Views: 1256
Re: __Set/__Get get called in constructor for defined field; they shouldn't.
I'm sorry to say, but that is such a silly design. That behavior should not trigger on declared fields. I think the prototypical language for the magic methods feature is php5, which came out in 2004. They do it just the way one would expect. https://www.php.net/manual/en/language.oop5.overloading.p...
- 04 May 2022, 03:59
- Forum: Ask for Help (v2)
- Topic: Ability to inject code at end of script? Topic is solved
- Replies: 4
- Views: 629
Re: Ability to inject code at end of script? Topic is solved
Thanks for the detailed reply. I'll digest this info and incorporate the feedback into my current design.
Regards
Regards
- 03 May 2022, 21:31
- Forum: AutoHotkey Development
- Topic: __Set/__Get get called in constructor for defined field; they shouldn't.
- Replies: 7
- Views: 1256
__Set/__Get get called in constructor for defined field; they shouldn't.
[Moderator's note: Topic moved from Bug Reports.] This code issues an error when it shouldn't (v2-beta.3): class ExampleClass { mArray := [] __New() { this.mArray.Push 5 ; Error: "This value of type 'String' has no method named 'Push'." } __Get(name, params) { return name } __Set(name, params, valu...
- 03 May 2022, 03:05
- Forum: AutoHotkey Development
- Topic: Map shorthand
- Replies: 71
- Views: 32281
Re: Map shorthand
I'm gonna have to agree with the panel and disagree with Mr lexikos. I think having dedicated syntax for Maps literals, in a modern language, is a border-line necessity. Maps are 1 of the 2 most important Collection types, with the other being Arrays. I was very pleased when I found out that AutoHot...
- 03 May 2022, 02:02
- Forum: Ask for Help (v2)
- Topic: Ability to inject code at end of script? Topic is solved
- Replies: 4
- Views: 629
Re: Ability to inject code at end of script? Topic is solved
Depending on the situation, OnExit might be used for a similar effect. Unfortunately, I already have an OnExit callback set, but it doesn't do the type of thing that I'm looking for, since it's invoked once the script is already exiting. The goto keeps the scripts running without triggering an OnEx...
- 02 May 2022, 10:16
- Forum: Ask for Help (v2)
- Topic: Ability to inject code at end of script? Topic is solved
- Replies: 4
- Views: 629
Ability to inject code at end of script? Topic is solved
Hi, I don't expect that the following is supported, but since AutoHotkey has lots of magical goodness, I figured I'd ask. I have a set of scripts that generally take this form. #include 'Framework.ahk' ;-------------------------------------------; ; Script code here ;--------------------------------...
- 30 Apr 2022, 23:54
- Forum: Ask for Help (v2)
- Topic: Listen to big range of OnMessage events
- Replies: 8
- Views: 845
Re: Listen to big range of OnMessage events
... the most simple math to add just one extra line: The amount of lines is not important. What's important is the speed of execution of such a thing. Your loop method is very slow is both in terms of creating the handlers and, most importantly, in executing the event callbacks. In the worst case s...
- 30 Apr 2022, 21:28
- Forum: Ask for Help (v2)
- Topic: Listen to big range of OnMessage events
- Replies: 8
- Views: 845
Re: Listen to big range of OnMessage events
With only a single message that has no special martialling, you have 64 bits of parameter to work with in 32-bit processes or 128 bits if both processes are 64-bit. If you take the full range of messages 0x8000 - 0xBFFF and instead pack that into the parameters, that leaves you with 50 or 114 bits ...
- 30 Apr 2022, 19:24
- Forum: Ask for Help (v2)
- Topic: Listen to big range of OnMessage events
- Replies: 8
- Views: 845
Re: Listen to big range of OnMessage events
If you implement your own window procedure, you can catch all messages sent to your window. It can be done either by registering a class (RegisterClass) and creating your own window (CreateWindowEx or Gui with a Custom control), or by subclassing a Gui window (probably easiest with comctl32\SetWind...
- 30 Apr 2022, 16:55
- Forum: Ask for Help (v2)
- Topic: Listen to big range of OnMessage events
- Replies: 8
- Views: 845
Re: Listen to big range of OnMessage events
So you're asking for a way to do what you're asking in one line because you don't want to use two lines to do it? No. There are 16,383 values in the range [0x8000, 0xBFFF]. So, without being able to subscribe to a range, I would need to use a loop to subscribe. i := 0 end := 16383 while i < end { m...
- 30 Apr 2022, 12:26
- Forum: Ask for Help (v2)
- Topic: Listen to big range of OnMessage events
- Replies: 8
- Views: 845
Listen to big range of OnMessage events
Hello, Is there a way to listen to range of messages, via the OnMessage mechanism, without having to loop through the entire range in a loop and register the callback? I'm interested in listening to the entire public range of [0x8000, 0xBFFF]. I'm using this to create a private custom protocol to co...
- 28 Apr 2022, 23:51
- Forum: Ask for Help (v2)
- Topic: SendMessage throws error with WM_DDE_* messages.
- Replies: 2
- Views: 380
Re: SendMessage throws error with WM_DDE_* messages.
It is a timeout error.
For my particular usecase, I decided to use a different range of message ids. Specifically, the WM_APP+ range [0x8000, 0xBFFF]. Using this public range works much better for what I'm trying to do.
Thanks
For my particular usecase, I decided to use a different range of message ids. Specifically, the WM_APP+ range [0x8000, 0xBFFF]. Using this public range works much better for what I'm trying to do.
Thanks
- 27 Apr 2022, 18:39
- Forum: Ask for Help (v2)
- Topic: SendMessage throws error with WM_DDE_* messages.
- Replies: 2
- Views: 380
SendMessage throws error with WM_DDE_* messages.
It seems that the function "SendMessage()" errors out when using the WM_DDE_* message ids located in this page: https://lexikos.github.io/v2/docs/misc/SendMessageList.htm https://lexikos.github.io/v2/docs/commands/SendMessage.htm Is this a known issue? Other message ids seem to work ok. I'm trying t...