Click here to Skip to main content
Licence 
First Posted 22 Apr 2002
Views 167,134
Bookmarked 56 times

Windows Message ID constants

By | 22 Apr 2002 | Article
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.

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

About the Author

Anthony Baraff

Web Developer

United States United States

Member



Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
GeneralRe: lose SC_CLOSE,SC_MOVE,SC_MAXIMIZE,SC_MINIMIZE,SC_SIZE! PinsussAnonymous1:01 7 Sep '04  
GeneralRe: lose SC_CLOSE,SC_MOVE,SC_MAXIMIZE,SC_MINIMIZE,SC_SIZE! Pinmembergdbjohnson10:17 26 Nov '04  
GeneralRe: lose SC_CLOSE,SC_MOVE,SC_MAXIMIZE,SC_MINIMIZE,SC_SIZE! PinmemberNasenbaaer6:05 27 Jul '07  
GeneralThank you a lot! PinmemberPhan Nguyen19:20 19 Jun '03  
GeneralExtremely useful for C# coders who don't have VC++ PineditorNishant S15:16 18 Sep '02  
Generalenum declaration PinmemberOlaf Herrmann22:15 23 Apr '02  
GeneralRe: enum declaration PinmemberAnthony Baraff1:47 24 Apr '02  

Olaf Herrmann wrote:
I'm not sure, but I thing it's better to declare the enum as uint type.
I find your work is this very helpfull.
Thanks.
 
Olaf Herrmann

 
That’s actually what I did at first, but then I noticed that the Msg Property of the Message struct is defined as an int. I wasn’t sure whether MS had any intention of using the negative range of the integer for .net messages in the future, but I figured that they must have had a reason for it.
 
Thanks for checking over things,
 
Anthony
GeneralRe: enum declaration PinmemberAnonymous8:11 24 Apr '02  
GeneralRe: enum declaration PinmemberAnthony Baraff10:17 24 Apr '02  
GeneralRe: enum declaration PinmemberArmen Hakobyan1:20 27 May '02  
Generalthanks mate PinmemberJeremy Pullicino8:27 23 Apr '02  

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.

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