[REBOL] Re: Exploring System Port
From: greggirwin:mindspring at: 14-Oct-2002 9:40
<< If you know windows-msg, can you tell us what msg could be useful? >>
Well, given the volume of Windows messages, you really need to know what it
is you want to accomplish because most of them exist for a reason, so
they're all useful in some context. :)
WM_GETMINMAXINFO - Used to constrain windows sizes as user drags them.
WM_NCxxx - NonClient area messages. Used to do custom painting of title bar,
add custom title bar buttons, etc.
WM_POWERBROADCAST - This is used on battery powered devices to get info
about battery state, when a power is low and shutting things down, etc.
WM_COMMAND - For menu commands and accelerators.
WM_MOUSEHOVER/WM_MOUSELEAVE - If all faces are implemented as true windows,
you could get hover/leave notification.
Some APIs allow you to specify your own callback message (e.g.
Shell_NotifyIcon for tray icon support and SHAppBarMessage for AppDesktopBar
support). Another important use is the case where you have mulitple apps
that talk to each other by pumping messages. Those are generally custom
messages, but it would allow you to use a REBOL app under those
An old trick people would use was to post a message to themselves, rather
than setting up a timer and state flag, to emulate a notification system,
but I never really liked it much.
<< And there is something that can be usefule in the Rebol View (not
Lots of things will require the use of structures, even if they don't use
APIs, which I think is not available in standard View, correct?
WM_POWERBROADCAST is a simple one, though I don't know how useful it is. I
chose WM_DROPFILES because, even though it requires /Pro, it provides a
really handy piece of functionality. With some other API calls you can make
it work for View windows too.
I think RT has actually done a very nice job covering the most useful things
themselves. E.g. insert-event-func let's you catch resize, offset, and close
I've got a little launcher that emulates an AppBar (like the task bar) in
auto-hide mode. The difference being that a real AppDesktopBar modifies the
of the desktop so maximized apps don't cover them, etc. AppBars
never really took off. Very few companies I know of produce apps that use
them, maybe because the APIs to do so are such a big pain in the butt. :)
Maybe, like the Unix signal stuff, one of the most useful things would be
catching WM_DESTROY so you can clean things up if the session is shutting