Click here to Skip to main content
15,881,248 members
Articles / Programming Languages / C#
Article

Windows Message ID constants

Rate me:
Please Sign up or sign in to vote.
4.93/5 (72 votes)
22 Apr 2002 248.2K   3.7K   62   37
C# enumeration with most standard Windows message ID constants

Introduction

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.

C#
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)
    }
}

License

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


Written By
Web Developer
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
Questionreally useful thank you Pin
iwbm24-Jun-13 23:29
iwbm24-Jun-13 23:29 
QuestionThanks! Pin
cbc7007-May-13 1:32
cbc7007-May-13 1:32 
QuestionThank you!! Very Useful!! Pin
gallicox16-Oct-11 23:47
gallicox16-Oct-11 23:47 
GeneralMy vote of 5 Pin
Paul Miranda30-Aug-11 6:14
Paul Miranda30-Aug-11 6:14 
GeneralMy vote of 5 Pin
rahul_raut8-May-11 23:54
rahul_raut8-May-11 23:54 
GeneralTHANKS a LOT! Pin
rahul_raut8-May-11 23:53
rahul_raut8-May-11 23:53 
Thanks!
I was struggling to find this Smile | :)
take care and Regards,
Rahul
GeneralMy vote of 5 Pin
gisKing18-Apr-11 15:32
gisKing18-Apr-11 15:32 
GeneralMy vote of 5 Pin
Diwakar Gupta19-Jul-10 19:54
Diwakar Gupta19-Jul-10 19:54 
GeneralThanks Pin
SNathani13-Nov-09 6:03
SNathani13-Nov-09 6:03 
GeneralToo good Pin
Xmen Real 24-Aug-09 20:57
professional Xmen Real 24-Aug-09 20:57 
GeneralThank you! Pin
lcalabrese10-Dec-08 14:01
lcalabrese10-Dec-08 14:01 
GeneralRe: Thank you! Pin
thanhhong8x6-Jan-11 6:04
thanhhong8x6-Jan-11 6:04 
GeneralGreat Mann..! Pin
Bilal Haider1-Feb-08 13:06
professionalBilal Haider1-Feb-08 13:06 
GeneralVB.NET version Pin
syed shujaat hussain27-Dec-06 19:28
syed shujaat hussain27-Dec-06 19:28 
GeneralRe: VB.NET version Pin
Israel Thomas30-Sep-11 6:10
Israel Thomas30-Sep-11 6:10 
GeneralGreat Thanks!!! Pin
wirthmaster14-Nov-06 5:01
wirthmaster14-Nov-06 5:01 
GeneralMissing Message Pin
Deutsche Dogge27-Aug-06 10:48
Deutsche Dogge27-Aug-06 10:48 
GeneralTHANK YOU!!! Pin
Polymorpher1-Jul-06 6:45
Polymorpher1-Jul-06 6:45 
GeneralThanks a million Pin
Salim Ansari3-Mar-06 5:52
Salim Ansari3-Mar-06 5:52 
GeneralThx Pin
User 1942892-Aug-05 4:23
User 1942892-Aug-05 4:23 
GeneralNice! Pin
Yakumo Fujii3-Jul-05 19:25
Yakumo Fujii3-Jul-05 19:25 
GeneralThank You Pin
r a n a6-Apr-05 19:03
r a n a6-Apr-05 19:03 
GeneralThanks Pin
bkalicharan18-Sep-04 14:08
bkalicharan18-Sep-04 14:08 
GeneralThank's Pin
gomess4-Apr-04 7:26
gomess4-Apr-04 7:26 
GeneralJust what I needed, thanks! Pin
DonDavis15-Jan-04 9:44
DonDavis15-Jan-04 9:44 

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

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