e + 1, App.EXEName &amp; ".cVBALHook", "Unsupported
          Hook Type."
      End Select
      ' Add the hook:
      If lpFn &lt;&gt; 0 Then
         hHook = SetWindowsHookEx(eType, lpFn, 0&amp;, GetCurrentThreadId())
         ' If we succeeded then set up the hook type:
         If (hHook &lt;&gt; 0) Then
            ' Succeeded; store the handle so we can restore it
            ' again later:
            m_hHook(eType) = hHook
         Else
            ' Failed:
            lErr = Err.LastDllError
     