Hi,

I am using C# code to create a window, get its HWND and pass it to an
unmanaged C++ DLL. This DLL has the code to process messages. My problem is
that I don't receive the WM_QUIT event so, my application never quits. If I
replace the WNDPROC with mine using a call to SetWindowLongPtr, and just
check for messages before passing them to the original WNDPROC, I don't even
get a WM_DESTROY message.

Any idea why this is happening? Any idea how to fix this?

Eric Robert

Re: .NET Form and Message Loop by Stoitcho

Stoitcho
Wed Jun 02 17:09:25 CDT 2004

Hi Eric,

WM_QUIT is not sent to any window ever. It just causes GetMessage to return
0, which ends the message loop.

As far as WM_DESTROY is concerned my tests show that windows procedures
receive that message. For testing I used Spy++.

--

Stoitcho Goutsev (100) [C# MVP]


"Eric Robert" <synapzzz@nospam.hotmail.com> wrote in message
news:OBtvbAMSEHA.2404@TK2MSFTNGP09.phx.gbl...
> Hi,
>
> I am using C# code to create a window, get its HWND and pass it to an
> unmanaged C++ DLL. This DLL has the code to process messages. My problem
is
> that I don't receive the WM_QUIT event so, my application never quits. If
I
> replace the WNDPROC with mine using a call to SetWindowLongPtr, and just
> check for messages before passing them to the original WNDPROC, I don't
even
> get a WM_DESTROY message.
>
> Any idea why this is happening? Any idea how to fix this?
>
> Eric Robert
>
>