summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Lillqvist <tml@novell.com>2005-11-28 08:31:36 +0000
committerTor Lillqvist <tml@src.gnome.org>2005-11-28 08:31:36 +0000
commitf335d53a02ddd64ae80165d933471c41a9fb9a6f (patch)
tree5202c2dbaeb57b039fbb69b1dae969ef0c4f5c62
parentd3020806567e900991d313dd73d4759312b8db26 (diff)
downloadgdk-pixbuf-f335d53a02ddd64ae80165d933471c41a9fb9a6f.tar.gz
Look up FlashWindowEx() at run-time from user32.dll. If not found, fall
2005-11-28 Tor Lillqvist <tml@novell.com> * gdk/win32/gdkwindow-win32.c (gdk_window_set_urgency_hint): Look up FlashWindowEx() at run-time from user32.dll. If not found, fall back to FlashWindow(). Makes it work on NT4, too. (#318077) Make sure it compiles with older MSVC compilers, too.
-rw-r--r--ChangeLog5
-rw-r--r--ChangeLog.pre-2-105
-rw-r--r--gdk/win32/gdkwindow-win32.c48
3 files changed, 49 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index 72812b90d..c28e7f43c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2005-11-28 Tor Lillqvist <tml@novell.com>
+ * gdk/win32/gdkwindow-win32.c (gdk_window_set_urgency_hint): Look
+ up FlashWindowEx() at run-time from user32.dll. If not found, fall
+ back to FlashWindow(). Makes it work on NT4, too. (#318077) Make
+ sure it compiles with older MSVC compilers, too.
+
* gtk/gtkcalendar.c (gtk_calendar_init): Use GetLocaleInfo() on
Windows to get the localized weekday and month names. strftime()
in the Microsoft C library returns strings in the default codepage
diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10
index 72812b90d..c28e7f43c 100644
--- a/ChangeLog.pre-2-10
+++ b/ChangeLog.pre-2-10
@@ -1,5 +1,10 @@
2005-11-28 Tor Lillqvist <tml@novell.com>
+ * gdk/win32/gdkwindow-win32.c (gdk_window_set_urgency_hint): Look
+ up FlashWindowEx() at run-time from user32.dll. If not found, fall
+ back to FlashWindow(). Makes it work on NT4, too. (#318077) Make
+ sure it compiles with older MSVC compilers, too.
+
* gtk/gtkcalendar.c (gtk_calendar_init): Use GetLocaleInfo() on
Windows to get the localized weekday and month names. strftime()
in the Microsoft C library returns strings in the default codepage
diff --git a/gdk/win32/gdkwindow-win32.c b/gdk/win32/gdkwindow-win32.c
index 2b2a253c7..7f7eb9b97 100644
--- a/gdk/win32/gdkwindow-win32.c
+++ b/gdk/win32/gdkwindow-win32.c
@@ -29,14 +29,32 @@
#include <config.h>
#include <stdlib.h>
+#ifndef _MSC_VER
#define _WIN32_WINNT 0x0500
#define WINVER _WIN32_WINNT
+#endif
#include "gdk.h"
#include "gdkprivate-win32.h"
#include "gdkinput-win32.h"
#if defined(_MSC_VER) && (WINVER < 0x0500)
+
+typedef struct
+{
+ UINT cbSize;
+ HWND hwnd;
+ DWORD dwFlags;
+ UINT uCount;
+ DWORD dwTimeout;
+} FLASHWINFO;
+
+#define FLASHW_STOP 0
+#define FLASHW_CAPTION 1
+#define FLASHW_TRAY 2
+#define FLASHW_ALL (FLASHW_CAPTION|FLASHW_TRAY)
+#define FLASHW_TIMER 4
+
#define GetAncestor(hwnd,what) _gdk_win32_get_ancestor_parent (hwnd)
static HWND
@@ -131,6 +149,7 @@ gdk_window_impl_win32_init (GdkWindowImplWin32 *impl)
impl->hicon_big = NULL;
impl->hicon_small = NULL;
impl->hint_flags = 0;
+ impl->type_hint = GDK_WINDOW_TYPE_HINT_NORMAL;
impl->extension_events_selected = FALSE;
}
@@ -1542,6 +1561,8 @@ gdk_window_set_urgency_hint (GdkWindow *window,
gboolean urgent)
{
FLASHWINFO flashwinfo;
+ typedef BOOL (*PFN_FlashWindowEx) (FLASHWINFO*);
+ PFN_FlashWindowEx flashWindowEx = NULL;
g_return_if_fail (GDK_IS_WINDOW (window));
g_return_if_fail (GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD);
@@ -1549,16 +1570,25 @@ gdk_window_set_urgency_hint (GdkWindow *window,
if (GDK_WINDOW_DESTROYED (window))
return;
- flashwinfo.cbSize = sizeof (flashwinfo);
- flashwinfo.hwnd = GDK_WINDOW_HWND (window);
- if (urgent)
- flashwinfo.dwFlags = FLASHW_ALL | FLASHW_TIMER;
- else
- flashwinfo.dwFlags = FLASHW_STOP;
- flashwinfo.uCount = 0;
- flashwinfo.dwTimeout = 0;
+ flashWindowEx = (PFN_FlashWindowEx) GetProcAddress (GetModuleHandle ("user32.dll"), "FlashWindowEx");
- FlashWindowEx (&flashwinfo);
+ if (flashWindowEx)
+ {
+ flashwinfo.cbSize = sizeof (flashwinfo);
+ flashwinfo.hwnd = GDK_WINDOW_HWND (window);
+ if (urgent)
+ flashwinfo.dwFlags = FLASHW_ALL | FLASHW_TIMER;
+ else
+ flashwinfo.dwFlags = FLASHW_STOP;
+ flashwinfo.uCount = 0;
+ flashwinfo.dwTimeout = 0;
+
+ flashWindowEx (&flashwinfo);
+ }
+ else
+ {
+ FlashWindow (GDK_WINDOW_HWND (window), urgent);
+ }
}
static void