mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-14 06:10:21 +00:00
Do not use GetProcAddress for FlashWindowEx
It's available since Windows XP
This commit is contained in:
parent
c77272a7d7
commit
4f7d18a28f
@ -1333,33 +1333,22 @@ gdk_win32_surface_set_urgency_hint (GdkSurface *window,
|
|||||||
gboolean urgent)
|
gboolean urgent)
|
||||||
{
|
{
|
||||||
FLASHWINFO flashwinfo;
|
FLASHWINFO flashwinfo;
|
||||||
typedef BOOL (WINAPI *PFN_FlashWindowEx) (FLASHWINFO*);
|
|
||||||
PFN_FlashWindowEx flashWindowEx = NULL;
|
|
||||||
|
|
||||||
g_return_if_fail (GDK_IS_SURFACE (window));
|
g_return_if_fail (GDK_IS_SURFACE (window));
|
||||||
|
|
||||||
if (GDK_SURFACE_DESTROYED (window))
|
if (GDK_SURFACE_DESTROYED (window))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
flashWindowEx = (PFN_FlashWindowEx) GetProcAddress (GetModuleHandle ("user32.dll"), "FlashWindowEx");
|
flashwinfo.cbSize = sizeof (flashwinfo);
|
||||||
|
flashwinfo.hwnd = GDK_SURFACE_HWND (window);
|
||||||
if (flashWindowEx)
|
if (urgent)
|
||||||
{
|
flashwinfo.dwFlags = FLASHW_ALL | FLASHW_TIMER;
|
||||||
flashwinfo.cbSize = sizeof (flashwinfo);
|
|
||||||
flashwinfo.hwnd = GDK_SURFACE_HWND (window);
|
|
||||||
if (urgent)
|
|
||||||
flashwinfo.dwFlags = FLASHW_ALL | FLASHW_TIMER;
|
|
||||||
else
|
|
||||||
flashwinfo.dwFlags = FLASHW_STOP;
|
|
||||||
flashwinfo.uCount = 0;
|
|
||||||
flashwinfo.dwTimeout = 0;
|
|
||||||
|
|
||||||
flashWindowEx (&flashwinfo);
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
flashwinfo.dwFlags = FLASHW_STOP;
|
||||||
FlashWindow (GDK_SURFACE_HWND (window), urgent);
|
flashwinfo.uCount = 0;
|
||||||
}
|
flashwinfo.dwTimeout = 0;
|
||||||
|
|
||||||
|
FlashWindowEx (&flashwinfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
Loading…
Reference in New Issue
Block a user