Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

AutoHotkey v1.1.10 Alpha Release


  • This topic is locked This topic is locked
40 replies to this topic
Coco
  • Members
  • 697 posts
  • Last active: Oct 31 2015 07:26 PM
  • Joined: 27 Jul 2012

That's a good option, let the user specify a handler(function)...



fincs
  • Moderators
  • 1662 posts
  • Last active:
  • Joined: 05 May 2007

That's a good option, let the user specify a handler(function)...

No, you misunderstand; I'm talking about executing the g-label in a similar way to how OnMessage handlers execute their functions (the internal implementation, that is); and it does not involve re-sending/posting the message.

Coco
  • Members
  • 697 posts
  • Last active: Oct 31 2015 07:26 PM
  • Joined: 27 Jul 2012

I see, I look forward to how it turns out...what are the possible side-effects though?



fincs
  • Moderators
  • 1662 posts
  • Last active:
  • Joined: 05 May 2007

what are the possible side-effects though?

As far as I understand none. If OnMessage WM_NOTIFY handlers have always worked without hanging the script, this approach should also work.

Coco
  • Members
  • 697 posts
  • Last active: Oct 31 2015 07:26 PM
  • Joined: 27 Jul 2012

I guess it's the best option...wink.png



fincs
  • Moderators
  • 1662 posts
  • Last active:
  • Joined: 05 May 2007
Ok, I just fixed it.

Coco
  • Members
  • 697 posts
  • Last active: Oct 31 2015 07:26 PM
  • Joined: 27 Jul 2012

fincs: Where can I download the updated .exe?



fincs
  • Moderators
  • 1662 posts
  • Last active:
  • Joined: 05 May 2007

fincs: Where can I download the updated .exe?

You'll have to wait for Lexikos to update the alpha, as I believe he wouldn't want people posting random binaries.

Lexikos
  • Administrators
  • 9844 posts
  • AutoHotkey Foundation
  • Last active:
  • Joined: 17 Oct 2006

v1.1.10-alpha2 uploaded; includes fincs' fix.



Zaelia
  • Members
  • 754 posts
  • Last active: Jan 17 2015 02:38 AM
  • Joined: 31 Oct 2008

Thank you very much. Sound managment has an ease of use for win6+ users.


"You annoy me, therefore I exist."

Coco
  • Members
  • 697 posts
  • Last active: Oct 31 2015 07:26 PM
  • Joined: 27 Jul 2012

In most instances, some commands and also control flow statement(s [specifically if-else], within the subroutine of the control's associated target label(g-Label), resulted to some weird behavior. Tested on ComboBoxEx, (not sure if it's due to A_GuiEvent representing varied control-specific structs depending on the notification, NMHDR is always the first member though). Every time a notification is sent via WM_NOTIFY, opening the ComboBoxEx's dropdown listbox would cause it to slide up an down repeatedly before settling to a halt. Then it would need to clicks to select an item. Removing the g-label fixes this though.



just me
  • Members
  • 1496 posts
  • Last active: Nov 03 2015 04:32 PM
  • Joined: 28 May 2011

What about using the well-tried PostMessage method with

  • WM_COMMAND : A_GuiEvent = "WM_COMMAND" or "C", A_EventInfo = HIWORD(wParam)
  • WM_NOTIFY  : A_GuiEvent = "WM_NOTIFY"  or "N", A_EventInfo = code field of NMHDR structure

If one wants to get more informations on specific notifications OnMessage() will accomplish that and additionally allow to return a specific value when needed.


Prefer ahkscript.org for the time being.


fincs
  • Moderators
  • 1662 posts
  • Last active:
  • Joined: 05 May 2007

If one wants to get more informations on specific notifications OnMessage() will accomplish that and additionally allow to return a specific value when needed.

The point of this built-in support is precisely not needing to use DllCall or OnMessage (especially since the latter always captures messages for all windows and there's no HWND filtering system).

Also, currently this is calling the subroutine in a similar way to how OnMessage() dispatches message handlers, so in theory there shouldn't be "weird behaviour" (I personally haven't been able to reproduce what Coco is seeing; possibly it's a bug in his script) unless I'm missing something.

EDIT: by the way, could you post here a test case for the so-called "weird behaviour"?

just me
  • Members
  • 1496 posts
  • Last active: Nov 03 2015 04:32 PM
  • Joined: 28 May 2011

... and additionally allow to return a specific value when needed.

How could this be done with your attempt?
 
BTW: If Custom controls will be implemented, it's time to implement "on control" message handlers.

Prefer ahkscript.org for the time being.


fincs
  • Moderators
  • 1662 posts
  • Last active:
  • Joined: 05 May 2007

How could this be done with your attempt?

Currently zero is always returned, although it could be changed so that ErrorLevel is returned to the message sender. Most controls appear to ignore the return value of WM_NOTIFY so this should not be an issue.

BTW: If Custom controls will be implemented, it's time to implement "on control" message handlers.

It would be certainly useful to have per-window OnMessages.

EDIT: Lexikos, would this be OK?
EDIT2: Simplified approach.
Spoiler