n plKeyEvent(ByVal lhWnd As Long, ByVal iMsg As Integer, ByVal
 wParam As Long, ByVal lParam As Long) As Long
Dim iKeyCode As Integer
Dim iKeyAscii As Integer
Dim iOrigKeyAscii As Integer
Dim iShift As Integer

   If (lhWnd = m_hWnd) Then
      iKeyCode = (wParam And &amp;HFF)
      ' Alt key pressed = Bit 29
      If ((lParam And &amp;H20000000) = &amp;H20000000) Then
          iShift = 1
      End If
      Select Case iMsg
      Case WM_KEYDOWN
          iShift = piGetShiftState()
          RaiseEvent Key