By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,657 Members | 1,578 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,657 IT Pros & Developers. It's quick & easy.

C# windows programming

P: n/a
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.
Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"timtos" <ha*****@uni-koblenz.de> wrote in message
news:be***********@news.uni-koblenz.de...
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.

Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.