如何从Win32中托管的WPF窗口接收Win32消息?

时间:2012-09-16 13:28:04

标签: wpf winapi clr

我在Win32应用程序中加载了一个WPF窗口:

case WM_INITDIALOG:
    {
        System::Windows::Interop::HwndSourceParameters p;
        p.WindowStyle = WS_VISIBLE | WS_CHILD;
        p.PositionX = 100;
        p.PositionY = 100;
        p.Width = 600;
        p.Height = 600;
        p.ParentWindow = System::IntPtr(hDlg);
        Globals::source = gcnew System::Windows::Interop::HwndSource(p);        
        Globals::source->RootVisual = gcnew MyControl();
        return TRUE;
    }

现在我想通过在我的应用程序中接收win32消息来处理WPF窗口事件。 我怎么能这样做?

0 个答案:

没有答案
相关问题