property HTML.hWnd as Long
Gets the window's handle.

TypeDescription
Long A long expression that indicates the window's handle.
The Microsoft Windows operating environment identifies each form in an application by assigning it a handle, or hWnd. The hWnd property is used with Windows API calls. Many Windows operating environment functions require the hWnd of the active window as an argument. Because the value of this property can change while a program is running, you cannot rely on its value (e.g., when stored in a variable).

The following VB sample applies the red color to the current selection when user presses the CTRL + J:

Private Const WM_COMMAND = &H111
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long

Private Sub HTML1_KeyDown(KeyCode As Integer, Shift As Integer)
    If (KeyCode = vbKeyJ) And (Shift = 2) Then
        SendMessage HTML1.hwnd, WM_COMMAND, &HE15C * 65536, 0
    End If
End Sub