@@ -5998,26 +5998,49 @@ PyGetScrollInfo (PyObject *self, PyObject *args)
59985998%native (GetScrollInfo) PyGetScrollInfo;
59995999
60006000%{
6001+ #define MAX_CHARS 0x100
6002+
60016003// @pyswig string|GetClassName|Retrieves the name of the class to which the specified window belongs.
60026004static PyObject *
60036005PyGetClassName (PyObject *self, PyObject *args)
60046006{
6005- HWND hwnd;
6006- PyObject *obhwnd;
6007- TCHAR buf[256 ];
6008- // @pyparm <o PyHANDLE>|hwnd||The handle to the window
6009- if (!PyArg_ParseTuple (args, " O:GetClassName" , &obhwnd))
6010- return NULL ;
6011- if (!PyWinObject_AsHANDLE (obhwnd, (HANDLE *)&hwnd))
6012- return NULL ;
6013- // don't bother with lock - no callback possible.
6014- int nchars = GetClassName (hwnd, buf, sizeof buf/ sizeof buf[ 0 ] );
6015- if (nchars== 0 )
6016- return PyWin_SetAPIError (" GetClassName" );
6017- return PyWinObject_FromTCHAR (buf, nchars);
6007+ HWND hwnd;
6008+ PyObject *obhwnd;
6009+ TCHAR buf[MAX_CHARS ];
6010+ // @pyparm <o PyHANDLE>|hwnd||The handle to the window
6011+ if (!PyArg_ParseTuple (args, " O:GetClassName" , &obhwnd))
6012+ return NULL ;
6013+ if (!PyWinObject_AsHANDLE (obhwnd, (HANDLE*)&hwnd))
6014+ return NULL ;
6015+ // don't bother with lock - no callback possible.
6016+ int nchars = GetClassName (hwnd, buf, MAX_CHARS );
6017+ if (nchars == 0 )
6018+ return PyWin_SetAPIErrorOrReturnNone (" GetClassName" );
6019+ return PyWinObject_FromTCHAR (buf, nchars);
60186020}
6021+
6022+ // @pyswig string|RealGetWindowClass|Retrieves the name of the class to which the specified window belongs.
6023+ static PyObject *
6024+ PyRealGetWindowClass (PyObject *self, PyObject *args)
6025+ {
6026+ HWND hwnd;
6027+ PyObject *obhwnd;
6028+ TCHAR buf[MAX_CHARS];
6029+ // @pyparm <o PyHANDLE>|hwnd||The handle to the window
6030+ if (!PyArg_ParseTuple (args, " O:RealGetWindowClass" , &obhwnd))
6031+ return NULL ;
6032+ if (!PyWinObject_AsHANDLE (obhwnd, (HANDLE*)&hwnd))
6033+ return NULL ;
6034+ // don't bother with lock - no callback possible.
6035+ UINT nchars = RealGetWindowClass (hwnd, buf, MAX_CHARS);
6036+ if (nchars == 0 )
6037+ return PyWin_SetAPIErrorOrReturnNone (" RealGetWindowClass" );
6038+ return PyWinObject_FromTCHAR (buf, nchars);
6039+ }
6040+
60196041%}
60206042%native (GetClassName) PyGetClassName;
6043+ %native (RealGetWindowClass) PyRealGetWindowClass;
60216044
60226045// @pyswig int|WindowFromPoint|Retrieves a handle to the window that contains the specified point.
60236046// @pyparm (int, int)|point||The point.
0 commit comments