List of Windows Messages

Helpful script writing tricks and HowTo's
User avatar
jeeswg
Posts: 3569
Joined: 19 Dec 2016, 01:58
Location: UK

List of Windows Messages

31 Oct 2017, 10:47

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus



Sources:
MDB Blog: Microsoft Spy++ or Spyxx for download
https://mdb-blog.blogspot.co.uk/2010/11/microsoft-spy-or-spyxx-for-download.html
winmfcmsg.h
http://svn.netlabs.org/repos/odin32/trunk/include/win/winmfcmsg.h
List of Windows Messages
https://autohotkey.com/docs/misc/SendMessageList.htm
List Of Windows Messages - WineHQ Wiki
https://wiki.winehq.org/List_Of_Windows_Messages
List of windows messages with their description WM_ - General Programming - GameDev.net
http://www.gamedev.net/topic/552982-list-of-windows-messages-with-their-description-wm_/

Links:
About Messages and Message Queues (Windows)
http://msdn.microsoft.com/en-us/library/windows/desktop/ms644927(v=vs.85).aspx
Windows Controls (Windows)
http://msdn.microsoft.com/en-gb/library/windows/desktop/bb773173(v=vs.85).aspx

[EDIT:] The lists are now sorted by value rather than alphabetically, also, WM messages now appear at the top.
Last edited by jeeswg on 02 Nov 2017, 06:12, edited 2 times in total.
User avatar
jeeswg
Posts: 3569
Joined: 19 Dec 2016, 01:58
Location: UK

Re: List of Windows Messages (over 1700)

31 Oct 2017, 10:47

Here is the C++ code I used to generate the first 2 sections of the list.

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus



I would be most grateful for any tips to shorten the code by using a loop (if possible), and to compile the exe as ANSI to get the ANSI versions of the constants. Thanks.
User avatar
jeeswg
Posts: 3569
Joined: 19 Dec 2016, 01:58
Location: UK

Re: List of Windows Messages (over 1700)

31 Oct 2017, 11:04

- I would welcome any further lists of window messages for comparison.
- There is a new version of Microsoft Spy++, version 14.
MDB Blog: Microsoft Spy++ or Spyxx for download
https://mdb-blog.blogspot.co.uk/2010/11/microsoft-spy-or-spyxx-for-download.html

I'm having trouble installing it. I don't know how many dlls I'll need to download for it to work on my Windows 7 PC with Visual Studio Express 2013.

I obtained the main message list by navigating to:
Spy, Log Messages..., Messages tab
and grabbing the list from the ListBox.
In case anyone can confirm if the list has changed since version 11.

Note: since Microsoft Spy++ runs in Admin mode, the script will have to be run in Admin mode.

Code: [Select all] [Download] GeSHi © Codebox Plus

if !A_IsAdmin
Run, % "*RunAs " (A_IsCompiled ? "" : A_AhkPath " ") Chr(34) A_ScriptFullPath Chr(34)

q:: ;Microsoft Spy++ - get window message list
ControlGet, vText, List,, ListBox1, Message Options ahk_class #32770
Clipboard := StrReplace(vText, "`n", "`r`n")
MsgBox, % Clipboard
return
User avatar
jeeswg
Posts: 3569
Joined: 19 Dec 2016, 01:58
Location: UK

Re: List of Windows Messages

02 Nov 2017, 06:10

I wrote some code to sort the message lists into a more useful order, by value rather than alphabetically. I also set it so that WM messages would rise to the top.

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

User avatar
Drugwash
Posts: 449
Joined: 29 May 2014, 21:07
Location: Ploieşti, Romania
Contact:

Re: List of Windows Messages

28 Nov 2017, 04:38

Found the constant for the CCM/HDM/TB_TRANSLATEACCELERATOR in this VB forum attachment here.
According to that it's 0x461.

The constant for WM_CONVERTREQUESTEX can be found in this MASM forum attachment here.
According to that it's 0x108.
User avatar
Alguimist
Posts: 205
Joined: 05 Oct 2015, 16:41

Re: List of Windows Messages

28 Nov 2017, 21:28

In case it may be of interest, there's a tool included with AutoGUI called Constantine that provides reference to constants, organized in categories. Another tool, WinSpy, can be used to send messages.
User avatar
Drugwash
Posts: 449
Joined: 29 May 2014, 21:07
Location: Ploieşti, Romania
Contact:

Re: List of Windows Messages

29 Nov 2017, 05:58

Just checked Constantine in AutoGUI 2.0:
- WM_CONVERTREQUESTEX is not in the database
- CCM_TRANSLATEACCELERATOR is not in the database
- HDM_TRANSLATEACCELERATOR appears as 0x200A (where did you get that value from, here?)
- TB_TRANSLATEACCELERATOR has same value as above

Quite confusing. Everywhere I looked TB_TRANSLATEACCELERATOR is defined as same with CCM_TRANSLATEACCELERATOR, but couldn't find a clear definiton of the latter online, except for that comment in the VB attachment mentioned above, all this implying that CCM_/HDM_/TB_ have all the same value (see here too definitions of HDM_ and TB_). However the VB value differs from yours. Which is the right one and are they all the same after all?
just me
Posts: 5090
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: List of Windows Messages

29 Nov 2017, 10:45

Hi Drugwash,

0x200A is just a guess because I did not found a definition of CCM_TRANSLATEACCELERATOR, but all CCM messages should be in the range of 0x2000 to 0x2200, if defined, because of:
CommCtrl.h wrote:

Code: [Select all] [Download] GeSHi © Codebox Plus

#define CCM_FIRST               0x2000      // Common control shared messages
#define CCM_LAST (CCM_FIRST + 0x200)
just me
Posts: 5090
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: List of Windows Messages

29 Nov 2017, 11:04

MSDN wrote:TB_TRANSLATEACCELERATOR message

This message is not implemented.

Source
User avatar
jeeswg
Posts: 3569
Joined: 19 Dec 2016, 01:58
Location: UK

Re: List of Windows Messages

29 Nov 2017, 11:12

Thank you Drugwash, Alguimist and just me.

This is what I have on the 4 constants:

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus


- '109 for NT, 108 for OT', what is OT? (0x108 and 0x109 that is.)
- Can we test any of the suggested values for these, to see if they work?
CCM_TRANSLATEACCELERATOR
HDM_TRANSLATEACCELERATOR
TB_TRANSLATEACCELERATOR
Last edited by jeeswg on 29 Nov 2017, 11:19, edited 3 times in total.
User avatar
Drugwash
Posts: 449
Joined: 29 May 2014, 21:07
Location: Ploieşti, Romania
Contact:

Re: List of Windows Messages

29 Nov 2017, 11:15

I wonder if M$ need to be dragged into another lawsuit before they finally decide to freakin' share all the information.
The limits you quoted seem valid but who could ever guarantee they did follow their own patterns and rules?
And how come nobody, in all this time, managed to catch and share any one of those messages?
OK, I saw the notice of TB_ not being implemented - how about the others? Where did they all come from, what are they: ghosts, wishful thinking?

Anyway, personally I don't care much about these messages, was just trying to help the OP. But for completeness' sake someone should really find out what the exact value is for CCM_, if there is one. And share. And M$ should go f… - well, I'll send that message telepathically directly to them. :roll:
just me
Posts: 5090
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: List of Windows Messages

29 Nov 2017, 11:40

On MSDN, the HDM_TRANSLATEACCELERATOR is marked as 'not implemented', too.The CCM_TRANSLATEACCELERATOR message is not mentioned there.
User avatar
Drugwash
Posts: 449
Joined: 29 May 2014, 21:07
Location: Ploieşti, Romania
Contact:

Re: List of Windows Messages

29 Nov 2017, 11:53

So TB_TRANSLATEACCELERATOR is not implemented, HDM_TRANSLATEACCELERATOR is not implemented and CCM_TRANSLATEACCELERATOR is nowhere to be found. This is all a wild goose chase, isn't it?
I'm gonna implement a WM_F**KYOU_MS message, maybe that'll cover all those situations. :)
User avatar
Alguimist
Posts: 205
Joined: 05 Oct 2015, 16:41

Re: List of Windows Messages

29 Nov 2017, 15:54

@Drugwash: Constantine was initially based on Gui Constants. Later I added more constants from the SDK headers and also categorized the WM_ messages in groups: mouse, keyboard, menu, clipboard etc.

I removed the *_TRANSLATEACCELERATOR messages from the Constantine list, since they were not implemented.

@jeeswg: there seems to be many undocumented messages in your list (like WM_MYSTERY). Are those messages valid?

I forgot to mention another tool included with AutoGUI: Size Checker (Windows SDK required) can be used to generate a list of constants from a list.
User avatar
jeeswg
Posts: 3569
Joined: 19 Dec 2016, 01:58
Location: UK

Re: List of Windows Messages

29 Nov 2017, 16:18

Because of the problems in verifying constants I split them accordingly:
;CONSTANTS: FROM MICROSOFT SPY++ (1178)
;CONSTANTS: ASSORTED OTHER (ALL FOUND IN .H FILES) (CURRENTLY 393)
;CONSTANTS: ASSORTED OTHER (NOT FOUND IN .H FILES) (CURRENTLY 155)

I can't vouch for the correctness of any of the 'assorted other (not found in .h files)' constants, apart from the MN_XXX ones which I tested, and which appear to do what they say.

The undocumented messages were collected from sources listed above. The MN_XXX ones are quite useful, and I don't know where the person who posted them, came across them.

context menu window messages: focus/invoke item - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=39209
User avatar
Drugwash
Posts: 449
Joined: 29 May 2014, 21:07
Location: Ploieşti, Romania
Contact:

Re: List of Windows Messages

30 Nov 2017, 07:06

Alguimist wrote:@Drugwash: Constantine was initially based on Gui Constants. Later I added more constants from the SDK headers and also categorized the WM_ messages in groups: mouse, keyboard, menu, clipboard etc.
That's a very good work, I always planned to do that myself but never got that far. There used to be a script "List Constants W32" or something that I modded some time ago to use a ListView instead of ListBox and updated the list of constants with values found in various headers but since I don't have access to the latest SDK (and DDK) it's pretty incomplete and buggy. I should cross-reference your list with mine, see what can be added/fixed.

Alguimist wrote:I removed the *_TRANSLATEACCELERATOR messages from the Constantine list, since they were not implemented.
If I may say so it may be better to keep them there and assign them the string "not implemented" so anybody looking for them would know for sure they don't exist and would stop looking further.

Another useful thing for users of older OS would be an extra column or two stating the minimum library version and OS version that implement each message/constant. Just yesterday while searching online for those values I stumbled into a page stating the differences between the same v5.81 Common Controls implemented in XP, Vista, 7 etc. There may be many such situations with other libraries too.
Long ago I built a similar table regarding control styles from Win95 to Vista but never published it and I guess it would be kinda useless now since nobody cares about Win9x programming anymore.

I've uploaded the latest version of my constants file from LCW32 to my repository here. Please be advised there is a lot of "noise" in there.
User avatar
Alguimist
Posts: 205
Joined: 05 Oct 2015, 16:41

Re: List of Windows Messages

30 Nov 2017, 15:06

Drugwash wrote:Another useful thing for users of older OS would be an extra column or two stating the minimum library version and OS version that implement each message/constant.

I think that such column would be unreliable in many cases because there are styles and messages that do work on XP but the official documentation states it requires Vista or higher (since XP is not supported anymore), so it would be necessary to test one by one, or at least the newest constants. When trying to keep compatibility with XP, I always remember to be careful about listview messages specially those regarding group view. So, for example, in the list of variables of the debugger in AutoGUI 2.0 there is an extra column for the scope of the variable for compatibility with XP, instead of a group view header.
User avatar
Drugwash
Posts: 449
Joined: 29 May 2014, 21:07
Location: Ploieşti, Romania
Contact:

Re: List of Windows Messages

01 Dec 2017, 02:12

True, current online MSDN documentation is unreliable in regard to older OS. In the past I've been working with an offline copy of MSDN 2005 and while not perfect it is much more accurate in that regard, even for 9x systems. If you can get ahold of that version it would be of great use.
I'm thinking also the headers in Visual Studio 2003 could offer - by comparison with newest headers - a clear delimitation of what is supported and what not in 9x/2000/XP/2003. But it would be a tedious job indeed.

Return to “Tutorials”

Who is online

Users browsing this forum: No registered users and 4 guests