Windows messages hexidecimal code lenght Topic is solved

Share your ideas as to how the documentation can be improved.
need4speed
Posts: 143
Joined: 22 Apr 2016, 06:50

Windows messages hexidecimal code lenght

27 Jan 2021, 07:17

I believe in List of Windows Messages Help Section, hexidecimal code should be 4 digits rather than 2-4.
for instance WM_SETTEXT := 0x0C should rather be WM_SETTEXT := 0x000C

the reason is consistency with Microsoft, see
https://docs.microsoft.com/en-us/windows/win32/winmsg/wm-settext

To quote Skan here : Leading zeroes in constants helps to identify the integer type, like 0x000C Short 0X0000000C Long

This applies to other parts of the help file.

Also I noticed some variations (capital X) see comments in PostMessage / SendMessage command:
SendMessage, 0xC, 0, &MyVar, ClassNN, WinTitle ; 0XC is WM_SETTEXT

should also be 0x000C

Do you agree?
User avatar
TheDewd
Posts: 1510
Joined: 19 Dec 2013, 11:16
Location: USA

Re: Windows messages hexidecimal code lenght

27 Jan 2021, 16:31

I agree! It's known that AutoHotkey will accept shorter versions of the message codes, removing the leading zeroes, however I would like to see the full codes referenced in the documentation.

Does it matter? No, not really -- if you're an experienced developer and know what you're doing. However, for inexperienced users who are learning, I think consistency is preferred.

It could be mentioned on the page that the leading zeros can be removed if desired, but leave that to the user to decide.

I usually add the extra digits in my scripts.

AutoIt's message code list, for reference: https://www.autoitscript.com/autoit3/docs/appendix/WinMsgCodes.htm
User avatar
Ragnar
Posts: 613
Joined: 30 Sep 2013, 15:25

Re: Windows messages hexidecimal code lenght  Topic is solved

07 Feb 2021, 10:29

Thanks for reporting. The change is included in PR #464.

Return to “Suggestions on Documentation Improvements”

Who is online

Users browsing this forum: No registered users and 3 guests