AfxCAxHostForwardMessagefunction
Forwards the Windows messages to the OLE Container window for processing.
Syntax
FUNCTION AfxCAxHostForwardMessage (BYVAL hctl AS HWND, BYVAL pMsg AS tagMSG PTR) AS BOOLEAN
Parameters
| Name | Description | |
|---|---|---|
hctl | Handle of the control. | |
pMsg | A pointer to a MSG structure that contains information about a message |
Return value
TRUE if the message was processed, FALSE if not.
Description
Forwards the Windows messages to the OLE Container window for processing.
Remarks
Active in-place objects must always be given the first chance at translating accelerator keystrokes. You can provide this opportunity by calling IOleInPlaceActiveObject.TranslateAccelerator from your container's message loop before doing any other translation. You should apply your own translation only when this method returns FALSE.
Example
' // Dispatch Windows messages DIM uMsg AS MSG WHILE (GetMessageW(@uMsg, NULL, 0, 0) <> FALSE) IF AfxForwardMessage(GetFocus, @uMsg) = FALSE THEN
IF IsDialogMessageW(hWndMain, @uMsg) = 0 THEN
TranslateMessage(@uMsg)
DispatchMessageW(@uMsg)
END IF
END IF WEND
Reference
- Include file
CaxHost.inc - Defined in AfxNova/CAxHost.inc:1357
- Documented in COM/CAxHost Class.md
- Topic: CAxHost Class