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
Lexikos
  • Administrators
  • 9844 posts
  • AutoHotkey Foundation
  • Last active:
  • Joined: 17 Oct 2006
AutoHotkey v1.1.10-alpha4 is now available for testing.
 
Download - includes ANSI, Unicode and x64 exe files.
Source
 
SoundSet/SoundGet
 
These commands now have improved support Windows Vista and later.  As a result, any scripts which already used them on Vista or later may not work the same way or at all.  The syntax is the same as before, but device numbering and component support differs.
 
Each device returned by the audio API gets a different number.  Since the audio architecture on Vista and later is very different to earlier versions of Windows, the device numbering for SoundSet/SoundGet is also different.  Windows may report a separate device for each output or input connector on a physical device (e.g. Speakers, Line In, Microphone, Stereo Mix, etc.).  On Vista and later DeviceNumber defaults to the default playback device, not necessarily device 1.
 
Currently only Volume and Mute controls are supported.  Other control types are supported by Windows, but very few are supported by the sound devices I have at hand - I suspect that those other control types would be very rarely available.
 
As an alternative to the old sound card analysis script, I have written a script which lists all devices, showing the device name and number, and all component and control types it supports.  Volume and Mute can also be adjusted using the Gui (one at a time).  The Endpoint and Adapter names should match up to what you see in the Sound control panel.
 
soundcard.ahk
 
Requires:
  • AutoHotkey v1.1.10-alpha1+
  • Windows Vista or later
  • VA.ahk version 2.2 (which I've just uploaded)
Custom Gui Controls
 
This release includes support for custom Gui controls, by specifying the window class of the control.  For more details see here or ask fincs.
 
 
Documentation
 
...has been updated.  See SoundGet and SoundSet or Custom control.

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

Cool. Does it mean I can add toolbars, rebars, etc. w/o requiring any external lib? How does it handle events? gLabel? Thanks btw..



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

Played around a bit:

 

  • SoundSet/SoundGet work flawlessly on WinVista 32-bit.
     
  • Custom Gui Controls seem to work as well, at least for the Scintilla control.

 

Something to play with:

 

Spoiler

 

Edit: Forgot to say: Thanks! 


Prefer ahkscript.org for the time being.


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

Here's my take on ComboBoxEx:

 

Spoiler

 

Note: Assigning a g-Label causes AHK to hang



fincs
  • Moderators
  • 1662 posts
  • Last active:
  • Joined: 05 May 2007
Heh, I thought my custom Gui control stuff would not get accepted tongue.png

Cool. Does it mean I can add toolbars, rebars, etc. w/o requiring any external lib? How does it handle events? gLabel? Thanks btw..

Yes, and yes. Read the pull request.

Note: Assigning a g-Label causes AHK to hang

This may happen for some controls because of this:
// This is a WM_NOTIFY handler and thus we need to set A_GuiEvent to 'N'. Due to the nature
// of WM_NOTIFY messages we cannot use PostMessage because otherwise the NMHDR pointer becomes toast.
Any suggestions on how to work around this?

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

Heh, I thought my custom Gui control stuff would not get accepted tongue.png

It's one of the features I wished to be supported internally, thank you very much.

 

In my test, ComboBoxEx sends its notification via WM_COMMAND. I tried putting just "return" but AHK still hangs..sad.png

 

Any suggestions on how to work around this?

Hmm, how does AHK handle ListView notifications?



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

In my test, ComboBoxEx sends its notification via WM_COMMAND. I tried putting just "return" but AHK still hangs.

My own test shows that ComboBoxEx is using WM_NOTIFY.

Hmm, how does AHK handles ListView notifications?

When AHK receives any kind of Gui event, it PostMessages itself a message that later executes the g-label. This is unacceptable for WM_NOTIFY as otherwise the NMHDR pointer becomes invalid, so for that particular case I tried to use SendMessage.

EDIT: found a 64-bit bug in application.cpp, here's a fix:
Spoiler


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

My own test shows that ComboBoxEx is using WM_NOTIFY.

You are correct, just checked MSDN. My previous ComboBoxEx class doesn't listen to WM_NOTIFY but instead I filtered out CBN_EDITCHANGE notification which is sent via WM_COMMAND....that's why..

When AHK receives any kind of Gui event, it PostMessages itself a message that later executes the g-label. This is unacceptable for WM_NOTIFY as otherwise the NMHDR pointer becomes invalid, so for that particular case I tried to use SendMessage.

Is this the same case for ListViews, UpDowns, TreeViews? Are they sent via SendMessage? or PostMessage? 



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

Are they sent via SendMessage? or PostMessage?

Everything is sent via PostMessage except for my Custom control's WM_NOTIFY stuff.

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

Is it possible to replicate AHK's built-in controls' behavior? I mean, they're sent via WM_NOTIFY as well...how does AHK preserve the NMHDR struct pointer for controls that send its notifications via WM_NOTIFY? 



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

how does AHK preserve the NMHDR struct pointer for controls

It is not preserved, data is extracted from it (such as the notification type); which is what then gets PostMessaged. It is not possible to replicate this due to the fact that controls expect you to parse the NMHDR structure (which is most of the time followed in memory by control specific data you're supposed to use).

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

I see...a workaround would be to parse it(for selected controls, e.g. Windows common controls not built-in in AHK) and then PostMessage the extracted data..this requires work though..



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

a workaround would be to parse it(for selected controls, e.g. Windows common controls not built-in in AHK)

No, because this is supposed to be used with controls AutoHotkey does not know anything about. Remember the structure is variable and it can contain extra control-specific fields.

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

Is this possible?:

Upon receipt of notification, get the control's class via "hwndFrom" member of the NMHDR struct. Check if class is in internal list of supported controls(e.g.: controls with similar fields), if yes, parse it then PostMessage the data..if not(e.g. Scintilla or other custom control not in User32.dll or Comctl32.dll), SendMessage it and let the user extract the data from the NMHDR struct represented by A_EventInfo.



fincs
  • Moderators
  • 1662 posts
  • Last active:
  • Joined: 05 May 2007
That would mean unnecessary code complexity and bloat. I'm currently thinking about instead executing the label directly in a way similar to OnMessage.