Update of /cvsroot/pywin32/pywin32/win32/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18698
Modified Files:
win32gui.i
Log Message:
Fix win32gui on NT, via [ 993793 ] win32gui linked to missing FlashWindowEx
Index: win32gui.i
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/win32gui.i,v
retrieving revision 1.50
retrieving revision 1.51
diff -C2 -d -r1.50 -r1.51
*** win32gui.i 24 Sep 2004 06:39:15 -0000 1.50
--- win32gui.i 8 Oct 2004 21:56:48 -0000 1.51
***************
*** 1124,1129 ****
if (!PyArg_ParseTuple(args, "iiii", &f.hwnd, &f.dwFlags, &f.uCount, &f.dwTimeout))
return NULL;
Py_BEGIN_ALLOW_THREADS
! rc = FlashWindowEx(&f);
Py_END_ALLOW_THREADS
ret = rc ? Py_True : Py_False;
--- 1124,1137 ----
if (!PyArg_ParseTuple(args, "iiii", &f.hwnd, &f.dwFlags, &f.uCount, &f.dwTimeout))
return NULL;
+ // not on NT
+ HMODULE hmod = GetModuleHandle("user32");
+ BOOL (WINAPI *pfnFW)(PFLASHWINFO) = NULL;
+ if (hmod)
+ pfnFW = (BOOL (WINAPI *)(PFLASHWINFO))GetProcAddress(hmod, "FlashWindowEx");
+ if (pfnFW==NULL)
+ return PyErr_Format(PyExc_NotImplementedError,
+ "FlashWindowsEx is not supported on this version of windows");
Py_BEGIN_ALLOW_THREADS
! rc = (*pfnFW)(&f);
Py_END_ALLOW_THREADS
ret = rc ? Py_True : Py_False;
|