This is the mail archive of the mailing list for the Cygwin project.

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

Re: get windows messages

On Wednesday 20 December 2000 14:58, flav wrote:
> hello,
> 	I would like to know if it is possible to get the windows
> message and if it is possible, how to get them (without using the
> windows
> main loop)

From the Cygwin source code:

===== SNIP =====
The following unix-style calls are supported:

        open ("/dev/windows", flags, mode=0)
                - create a unix fd for message queue.
                  O_NONBLOCK flag controls the read() call behavior.

        read (fd, buf, len)
                - return next message from queue. buf must point to MSG
                  structure, len must be >= sizeof (MSG). If read is set to
                  non-blocking and the queue is empty, read call returns -1
                  immediately with errno set to EAGAIN, otherwise it blocks
                  untill the message will be received.

        write (fd, buf, len)
                - send a message pointed by buf. len argument ignored.

        ioctl (fd, command, *param)
                - control read()/write() behavior.
                ioctl (fd, WINDOWS_POST, NULL): write() will PostMessage();
                ioctl (fd, WINDOWS_SEND, NULL): write() will SendMessage();
                ioctl (fd, WINDOWS_HWND, &hWnd): read() messages for
                        hWnd window.

        select () call marks read fd when any message posted to queue.
===== SNAP =====


Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                      
Red Hat, Inc.

Want to unsubscribe from this list?
Check out:

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