Update of /cvsroot/pywin32/pywin32/win32/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27134
Modified Files:
win32gui.i
Log Message:
Ensure all functions prototyped as a simple "int" release the thread
lock. This includes win32gui.MessageBox (which up until now, did not
release it.
GetWindowText releases the thread-lock.
Autoduck corrections.
Index: win32gui.i
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/win32gui.i,v
retrieving revision 1.53
retrieving revision 1.54
diff -C2 -d -r1.53 -r1.54
*** win32gui.i 1 Dec 2004 00:07:03 -0000 1.53
--- win32gui.i 20 Jan 2005 03:02:32 -0000 1.54
***************
*** 119,122 ****
--- 119,130 ----
%}
+ // Custom 'exception handlers' for simple types that exist only to
+ // manage the thread-lock.
+ %typemap(python,except) int {
+ Py_BEGIN_ALLOW_THREADS
+ $function
+ Py_END_ALLOW_THREADS
+ }
+
%apply HCURSOR {long};
typedef long HCURSOR;
***************
*** 1644,1647 ****
--- 1652,1660 ----
PyObject *obList, *obDlgProc;
BOOL bFreeString = FALSE;
+ // @pyparm int|hinst||
+ // @pyparm object|controlList||
+ // @pyparm int|hwnd||
+ // @pyparm object|dlgproc||
+ // @pyparm int|param|0|
if (!PyArg_ParseTuple(args, "lOlO|l", &hinst, &obList, &hwnd, &obDlgProc, ¶m))
return NULL;
***************
*** 1680,1683 ****
--- 1693,1701 ----
PyObject *obList, *obDlgProc;
BOOL bFreeString = FALSE;
+ // @pyparm int|hinst||
+ // @pyparm object|controlList||
+ // @pyparm int|hwnd||
+ // @pyparm object|dlgproc||
+ // @pyparm int|param|0|
if (!PyArg_ParseTuple(args, "lOlO|l", &hinst, &obList, &hwnd, &obDlgProc, ¶m))
return NULL;
***************
*** 1747,1751 ****
--- 1765,1771 ----
if (!PyArg_ParseTuple(args, "l", &hwnd))
return NULL;
+ Py_BEGIN_ALLOW_THREADS
len = GetWindowText(hwnd, buffer, sizeof(buffer)/sizeof(TCHAR));
+ Py_END_ALLOW_THREADS
if (len == 0) return PyUnicodeObject_FromString("");
return PyWinObject_FromTCHAR(buffer, len);
***************
*** 1991,1996 ****
#define CLR_NONE CLR_NONE
-
-
// @pyswig int|MessageBox|Displays a message box
// @pyparm int|parent||The parent window
--- 2011,2014 ----
***************
*** 2686,2690 ****
// @pyparm int|hMenu||
// @pyparm int|fByPosition||
! // @pyparm buffer|menuItem||A string or buffer in the format of a MENUITEMINFO structure.
BOOLAPI InsertMenuItem(HMENU hMenu, UINT uItem, BOOL fByPosition, MENUITEMINFO *INPUT);
--- 2704,2708 ----
// @pyparm int|hMenu||
// @pyparm int|fByPosition||
! // @pyparm buffer|menuItem||A string or buffer in the format of a <o MENUITEMINFO> structure.
BOOLAPI InsertMenuItem(HMENU hMenu, UINT uItem, BOOL fByPosition, MENUITEMINFO *INPUT);
***************
*** 2692,2696 ****
// @pyparm int|hMenu||
// @pyparm int|fByPosition||
! // @pyparm buffer|menuItem||A string or buffer in the format of a MENUITEMINFO structure.
BOOLAPI SetMenuItemInfo(HMENU hMenu, UINT uItem, BOOL fByPosition, MENUITEMINFO *INPUT);
--- 2710,2714 ----
// @pyparm int|hMenu||
// @pyparm int|fByPosition||
! // @pyparm buffer|menuItem||A string or buffer in the format of a <o MENUITEMINFO> structure.
BOOLAPI SetMenuItemInfo(HMENU hMenu, UINT uItem, BOOL fByPosition, MENUITEMINFO *INPUT);
***************
*** 2698,2702 ****
// @pyparm int|hMenu||
// @pyparm int|fByPosition||
! // @pyparm buffer|menuItem||A string or buffer in the format of a MENUITEMINFO structure.
BOOLAPI GetMenuItemInfo(HMENU hMenu, UINT uItem, BOOL fByPosition, MENUITEMINFO *BOTH);
--- 2716,2720 ----
// @pyparm int|hMenu||
// @pyparm int|fByPosition||
! // @pyparm buffer|menuItem||A string or buffer in the format of a <o MENUITEMINFO> structure.
BOOLAPI GetMenuItemInfo(HMENU hMenu, UINT uItem, BOOL fByPosition, MENUITEMINFO *BOTH);
|