# OLEACCELMSG type
{: .no_toc }

A window message, with the layout of the Windows `MSG` structure.

**OLEACCELMSG** is a user-defined type declared in the package's `OLEGuids` module, so both `OLEACCELMSG` and `OLEGuids.OLEACCELMSG` name it. It mirrors the Windows structure [MSG](https://learn.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-msg).

```tb inert=signature
Public Type OLEACCELMSG
    hWnd As LongPtr
    Message As Long
    wParam As LongPtr
    lParam As LongPtr
    Time As Long
    PT As OLEPOINT
End Type
```

## Fields

*hWnd*
: A **LongPtr** holding the handle of the window that receives the message.

*Message*
: A **Long** holding the message identifier, such as `WM_KEYDOWN`.

*wParam*
: A **LongPtr** holding additional message information. Its meaning depends on *Message*.

*lParam*
: A **LongPtr** holding additional message information. Its meaning depends on *Message*.

*Time*
: A **Long** holding the time at which the message was posted.

*PT*
: An [OLEPOINT](/tB/Packages/Contributed/OLEGuids/OLEPOINT.md) holding the position of the cursor, in screen coordinates, when the message was posted.

## Where it is used

- [**IOleControl.OnMnemonic**](/tB/Packages/Contributed/OLEGuids/IOleControl.md#onmnemonic) -- takes it by reference as *pMsg*.
- Methods that take a `MSG*` declare the parameter as a **LongPtr**, and the address of an **OLEACCELMSG** variable fits it: [**IOleObject.DoVerb**](/tB/Packages/Contributed/OLEGuids/IOleObject.md#doverb) (*lpMsg*), [**IOleControlSite.TranslateAccelerator**](/tB/Packages/Contributed/OLEGuids/IOleControlSite.md#translateaccelerator) (*lpMsg*) and [**IOleInPlaceActiveObject.TranslateAccelerator**](/tB/Packages/Contributed/OLEGuids/IOleInPlaceActiveObject.md#translateaccelerator) (*lpMsg*).

## See Also

- [OLEPOINT](/tB/Packages/Contributed/OLEGuids/OLEPOINT.md) type -- a point
- [IOleControl](/tB/Packages/Contributed/OLEGuids/IOleControl.md) interface -- keyboard mnemonics, ambient property changes and event freezing of a control
- [IOleControlVB](/tB/Packages/Contributed/OLEGuids/IOleControlVB.md) interface -- Visual Basic-style **GetControlInfo** and **OnMnemonic**
