C# windows programming

  • Thread starter Thread starter timtos
  • Start date Start date
T

timtos

When I am looking at custom drawing of controls I often see somthing like
this:

public enum ReflectedMessages
{
OCM__BASE = (Msg.WM_USER+0x1c00),
OCM_COMMAND = (OCM__BASE + Msg.WM_COMMAND),
OCM_CTLCOLORBTN = (OCM__BASE + Msg.WM_CTLCOLORBTN),
...
}

I really want to understand this kind of code - any resources, hints or
explaining words?
I hope the information is enough because I don´t have anything more :)

Thanks a lot in advance,
timtos.
 
Hi

What you are seeing is a code defining application's especific message,
Msg.WM_USER is used as the base value for application defined windows
messages.
The code below what is doing is defining custom windows messages. It takes
as base Msg.WM_USER and sum a quantity, this latter is not really needed as
WM_USER can be used.


From MSDN:

WM_USER
The WM_USER constant is used by applications to help define private messages
for use by private window classes, usually of the form WM_USER+X, where X is
an integer value.

#define WM_USER 0x0400
Remarks
The following are the ranges of message numbers.

Range Meaning
0 through WM_USER - 1 Messages reserved for use by the system.
WM_USER through 0x7FFF Integer messages for use by private window classes.
WM_APP through 0xBFFF Messages available for use by applications.
0xC000 through 0xFFFF String messages for use by applications.
Greater than 0xFFFF Reserved by the system for future use.


Hope this help,
 
Back
Top