"users of this wrapper will have to remember not to use this particular number"
And why would they want to do that. Shouldn't you as the component writer, provide methods, rather than let your user accessing your control directly.
This is an "unwritten" rule that you might want to know.
WM_USER.
Use this message within you control.
Supposed, you write a control and some methods INSIDE YOUR CONTROLS need to alter your control, you might want to use WM_USER.
WM_APP.
If your application needs to send message to OBJECTS INSIDE YOU APPLICATION, you can use WM_APP.
RegisterWindowMessage
If you have two (more then one) applications which need to communicate each other, you should REGISTER your WINDOWS MESSAGE with RegisterWindowMessage.
Examples. This example uses Delphi
{ WM_USER }
procedure TYourControl.RefreshColor;
begin
SendMessage(Self.Handle,WM_USER+YourNumber,wParam,lParam);
{ Pay attention to Self.Handle, use WM_USER within YOUR CONTROL }
end;
{ WM_APP }
procedure CheckValue;
var
IResult: Integer;
begin
IResult:=SendMessage(OtherForm.Handle,WM_APP+YourConstant,wParam,lParam);
{ Watch OtherForm.Handle }
end;
{ RegisterWindowMessage }
procedure SendCommand(OtherAppHandle: Integer);
var
MessageNumber: Integer;
MessageName: ShortString;
begin
MessageName:='YourMessageName';
Inc(MessageName[0]);MessageName[Ord(MessageName[0])]:=#0;
MessageNumber:=RegisterWindowMessage(@MessageName[1]);
SendMessage(OtherAppHandle,MessageNumber,wParam,lParam);
end;
{ Hope this will help }