This is the mail archive of the cygwin-xfree@cygwin.com mailing list for the Cygwin XFree86 project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: xwinclip-Test06


Benny,

Yes, you are correct that NULL should be passed to PeekMessage rather than the handle to the messaging window. I have made this change now.

However, I will leave in the messaging window as it is needed by many people that are working on patches, so it would be silly to remove all of that framework.

I will try to make a new release of xwinclip shortly.

Harold

Benjamin Riefenstahl wrote:
Hi all, Harold,


I just figured out a problem that I have had with xwinclip-Test06.

The Windows PeekMessage() message loop doesn't process all messages.
When a message gets sent that is not processed, xwinclip starts an
endless loop alternating between select() and PeekMessage().

The reason is the way PeekMessage() is called with a HWND as
parameter.  That filters messages, so only messages to that special
HWND are returned and processed.  Messages with a NULL HWND (like
WM_QUIT or other, possibly Windows-internal messages) remain in the
queue.

I just commented out the creation of the dummy HWND, initialized that
variable to NULL and everything works fine now.  The HWND is only used
for PeekMessage (where it's harmfull) and OpenClipboard() (where it's
optional) so the whole thing can just be removed unless I am missing
something.

In addition the PeekMessage() loop should probably check for WM_QUIT,
it currently ignores that even though the window proc actually sends
it ;-).


so long, benny







Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]