如何告诉WNDPROC Func所在的TranslateMessage和DispatchMessage?

时间:2017-09-27 16:05:11

标签: vb.net api user32

如何让Windows TranslateMessage DispatchMessage 知道它应该触发 WindowProcedure Func,我在等待事件!?我正在尝试创建一个基于Windows API的本机表单。我已经注册了这个类,创建,显示了,但是我无法设法挂钩windows过程函数,记住我不能使用Forms.Form.WndProc(m作为消息),因为这个类不是'继承表单

       'Run the message loop. It will run until GetMessage() returns 0 */
        While (GetMessage(messages, IntPtr.Zero, 0, 0))
            '/* Translate virtual-key messages into character messages */
            TranslateMessage(messages)
            '/* Send message to WindowProcedure */
            DispatchMessage(messages)

            If (FORCECLOSE) Then PostMessage(hwnd, WindowsMessages.WmClose, 0, 0)
        End While



Function WindowProcedure(hwnd As IntPtr, message As UInt16, wParam As Integer, lParam As Integer) As Integer

  MsgBox("Event occurred!")
       Select Case message

       End Select
End Function

0 个答案:

没有答案