B
Buddhist.CHinA
These day, I got a problem when I'm writing a mixed program - there
seemed to be some events missed in message routing!
In my case, when I clicked into a native window, WM_LBUTTONDOWN and
WM_LBUTTONUP should get handled in this window's wndproc. But the
WM_LBUTTONUP events seemed disappered.
Then I have to monitor how these button events work, I got the below
info,
msg.hwnd
2883828 WM_LBUTTONDOWN // native WndProc
2294248 WM_LBUTTONUP // catch this just before
DispatchMessage()
2294248 .NET WM_LBUTTONUP! // managed WndProc
Uh! The WM_LBUTTONUP event had gone to the managed window's wndProc.
Since the first column indicates the target window handle, so we can
notice that the WM_LBUTTONUP's target get changed!!!
First of all, I have one question that, the events caught by native
window's { GetMessage; DispatchMessage} still can be sent to managed
window in the native message routing?
Looks like it's possible in my case.
But I thought the {GetMessage; DispatchMessage} process should be
independent between native and managed window. That means, Windows is
responsible for managing these events to correct targets. So all events
caught by GetMessage should only belong to this window.
I am a little confused. Can some guy give me a hint?
thx.
seemed to be some events missed in message routing!
In my case, when I clicked into a native window, WM_LBUTTONDOWN and
WM_LBUTTONUP should get handled in this window's wndproc. But the
WM_LBUTTONUP events seemed disappered.
Then I have to monitor how these button events work, I got the below
info,
msg.hwnd
2883828 WM_LBUTTONDOWN // native WndProc
2294248 WM_LBUTTONUP // catch this just before
DispatchMessage()
2294248 .NET WM_LBUTTONUP! // managed WndProc
Uh! The WM_LBUTTONUP event had gone to the managed window's wndProc.
Since the first column indicates the target window handle, so we can
notice that the WM_LBUTTONUP's target get changed!!!
First of all, I have one question that, the events caught by native
window's { GetMessage; DispatchMessage} still can be sent to managed
window in the native message routing?
Looks like it's possible in my case.
But I thought the {GetMessage; DispatchMessage} process should be
independent between native and managed window. That means, Windows is
responsible for managing these events to correct targets. So all events
caught by GetMessage should only belong to this window.
I am a little confused. Can some guy give me a hint?
thx.