summaryrefslogtreecommitdiff
path: root/window.c
diff options
context:
space:
mode:
authorDarkvater <darkvater@openttd.org>2006-11-07 12:51:34 +0000
committerDarkvater <darkvater@openttd.org>2006-11-07 12:51:34 +0000
commit45366b4372853ba53b71e0f0b51b8bb79799850b (patch)
treed99b3e42fba96383bedf3ea56f290326e6ebe62e /window.c
parentdb98136bedbb4d05ce83c7dcbfb3a3d59142967a (diff)
downloadopenttd-45366b4372853ba53b71e0f0b51b8bb79799850b.tar.xz
(svn r7092) -Codechange: Add function to send a window message to a whole class of windows,
SendWindowMessageClass().
Diffstat (limited to 'window.c')
-rw-r--r--window.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/window.c b/window.c
index 790fa1bde..3ff9e4b29 100644
--- a/window.c
+++ b/window.c
@@ -1325,6 +1325,22 @@ void SendWindowMessage(WindowClass wnd_class, WindowNumber wnd_num, uint msg, ui
if (w != NULL) SendWindowMessageW(w, msg, wparam, lparam);
}
+/** Send a message from one window to another. The message will be sent
+ * to ALL windows of the windowclass specified in the first parameter
+ * @param wnd_class @see WindowClass class
+ * @param msg Specifies the message to be sent
+ * @param wparam Specifies additional message-specific information
+ * @param lparam Specifies additional message-specific information
+ */
+void SendWindowMessageClass(WindowClass wnd_class, uint msg, uint wparam, uint lparam)
+{
+ Window *w;
+
+ for (w = _windows; w != _last_window; w++) {
+ if (w->window_class == wnd_class) SendWindowMessageW(w, msg, wparam, lparam);
+ }
+}
+
static void HandleKeypress(uint32 key)
{
Window *w;