Click here to Skip to main content
Click here to Skip to main content

Windows Message ID constants

, 22 Apr 2002
Rate this:
Please Sign up or sign in to vote.
C# enumeration with most standard Windows message ID constants


The .NET base classes manage to insulate the programmer from many of the details of how applications interact with the underlying operating system, but in order to implement advanced UI functionality Microsoft leaves you no option but to interoperate with windows plumbing. The IMessageFilter interface requires you to use the System.Windows.Forms.Message struct which wraps a windows message. The Msg property corresponds to an int value that stores a constant indicating the type of message, Windows is sending your application. To my knowledge, Microsoft has not incorporated an enumeration with the commonly used constants. So, I stripped all of the messages I could find in the CommCtrl.h and WinUser.h header files and created an enum. I hope that you find it useful.

namespace WindowsUtilities
    public enum WindowsMessages: int
        WM_NULL = 0x0000,
        WM_CREATE = 0x0001,

        //Refer the WindowMessages.cs file
        //for complete source listing

        LM_SETITEM = (WM_USER + 0x302), 
        LM_GETITEM = (WM_USER + 0x303)


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Anthony Baraff
Web Developer
United States United States
No Biography provided

Comments and Discussions

Questionreally useful thank you Pinmemberiwbm25-Jun-13 0:29 
QuestionThanks! Pinmembercbc7007-May-13 2:32 
QuestionThank you!! Very Useful!! Pinmembergallicox17-Oct-11 0:47 
GeneralMy vote of 5 PinmemberPaul Miranda30-Aug-11 7:14 
GeneralMy vote of 5 Pinmemberrahul_raut9-May-11 0:54 
GeneralTHANKS a LOT! Pinmemberrahul_raut9-May-11 0:53 
GeneralMy vote of 5 PinmembergisKing18-Apr-11 16:32 
GeneralMy vote of 5 PinmemberDiwakar Gupta19-Jul-10 20:54 
GeneralThanks PinmemberSNathani13-Nov-09 7:03 
GeneralToo good PinmemberXmen W.K.24-Aug-09 21:57 
GeneralThank you! Pinmemberlcalabrese10-Dec-08 15:01 
GeneralRe: Thank you! Pinmemberthanhhong8x6-Jan-11 7:04 
GeneralGreat Mann..! PinmemberBilal Haider Asi1-Feb-08 14:06 
GeneralVB.NET version Pinmembersyed shujaat hussain27-Dec-06 20:28 
GeneralRe: VB.NET version PinmemberIsrael Thomas30-Sep-11 7:10 
GeneralGreat Thanks!!! Pinmemberwirthmaster14-Nov-06 6:01 
GeneralMissing Message PinmemberDeutsche Dogge27-Aug-06 11:48 
GeneralTHANK YOU!!! PinmemberPolymorpher1-Jul-06 7:45 
GeneralThanks a million PinmemberSalim Ansari3-Mar-06 6:52 
GeneralThx PinmemberWiebe Tijsma2-Aug-05 5:23 
GeneralNice! PinmemberYakumo Fujii3-Jul-05 20:25 
GeneralThank You PinmemberRana Ian6-Apr-05 20:03 
GeneralThanks Pinmemberbkalicharan18-Sep-04 15:08 
GeneralThank's Pinmembergomess4-Apr-04 8:26 
GeneralJust what I needed, thanks! PinmemberDonDavis15-Jan-04 10:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.150414.1 | Last Updated 23 Apr 2002
Article Copyright 2002 by Anthony Baraff
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid