>What's the point of the WM_USER? Why can't you just define EM_GETOLEINTERFACE as &h43C?
You can, but the definition using WM_USER gives an important visual clue that this message is a user-defined message privately used by RichEdit control class, not a standard message recognized by all windows.
See the documentation of
WM_USER which states the following.
MSDN said:
WM_USER Notification
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.
As per documentation, all messages in the range WM_USER to 0x7FFF are "Integer messages for use by private window classes".
Most header files follow this convention. EM_GETOLEINTERFACE is also defined in richedit.h as follows.
[tt]#define EM_GETOLEINTERFACE (WM_USER + 60)
[/tt]
All other user-defined messages are also defined in the same way. For example, the TTM_GETTOOLCOUNT message which returns the number of controls associated with a tooltip control, is defined in commctrl.h as:
[tt]#define TTM_GETTOOLCOUNT (WM_USER + 13)
[/tt]
VB API Viewer files are extracted from windows header files. Therefore the declaration format used by API Viewer is also the same.
The following declaration
[tt]#define EM_GETOLEINTERFACE (WM_USER + 60)[/tt]
gets translated to VB syntax as follows.
[tt]Const EM_GETOLEINTERFACE = (WM_USER + 60)[/tt]