Thread: [pywin32-checkins] pywin32/win32/src win32gui.i,1.78,1.79
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Mark H. <mha...@us...> - 2006-06-21 11:59:40
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4174 Modified Files: win32gui.i Log Message: GetWindowPlacement/SetWindowPlacement and autoduck clarifications. Index: win32gui.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32gui.i,v retrieving revision 1.78 retrieving revision 1.79 diff -C2 -d -r1.78 -r1.79 *** win32gui.i 20 Mar 2006 03:10:38 -0000 1.78 --- win32gui.i 21 Jun 2006 11:59:24 -0000 1.79 *************** *** 2139,2142 **** --- 2139,2144 ---- // @pyswig HMENU|LoadMenu|Loads a menu + // @pyparm int|hinstance|| + // @pyparm int/string|resource_id|| HMENU LoadMenu(HINSTANCE hInst, RESOURCE_ID name); *************** *** 2146,2149 **** --- 2148,2153 ---- #ifndef MS_WINCE // @pyswig |SetMenu|Sets the menu for the specified window. + // @pyparm int|hwnd|| + // @pyparm int|hmenu|| BOOLAPI SetMenu( HWND hwnd, HMENU hmenu ); #endif *************** *** 2153,2156 **** --- 2157,2162 ---- // @pyswig HCURSOR|LoadIcon|Loads an icon + // @pyparm int|hinstance|| + // @pyparm int/string|resource_id|| HICON LoadIcon(HINSTANCE hInst, RESOURCE_ID name); *************** *** 2571,2575 **** UINT uFlags // window-positioning flags ); ! %{ // @pyswig int|RegisterClass|Registers a window class. --- 2577,2642 ---- UINT uFlags // window-positioning flags ); ! ! %{ ! // @pyswig tuple|GetWindowPlacement|Returns placement information about the current window. ! static PyObject * ! PyGetWindowPlacement(PyObject *self, PyObject *args) ! { ! int hwnd; ! if (!PyArg_ParseTuple(args, "i:GetWindowPlacement", &hwnd)) ! return NULL; ! ! WINDOWPLACEMENT pment; ! pment.length=sizeof(pment); ! BOOL ok; ! Py_BEGIN_ALLOW_THREADS ! ok = GetWindowPlacement( (HWND)hwnd, &pment ); ! Py_END_ALLOW_THREADS ! if (!ok) ! return PyWin_SetAPIError("GetWindowPlacement"); ! // @rdesc The result is a tuple of ! // (flags, showCmd, (minposX, minposY), (maxposX, maxposY), (normalposX, normalposY)) ! // @flagh Item|Description ! // @flag flags|One of the WPF_* constants ! // @flag showCmd|Current state - one of the SW_* constants. ! // @flag minpos|Specifies the coordinates of the window's upper-left corner when the window is minimized. ! // @flag maxpos|Specifies the coordinates of the window's upper-left corner when the window is maximized. ! // @flag normalpos|Specifies the window's coordinates when the window is in the restored position. ! return Py_BuildValue("(ii(ii)(ii)(iiii))",pment.flags, pment.showCmd, ! pment.ptMinPosition.x,pment.ptMinPosition.y, ! pment.ptMaxPosition.x,pment.ptMaxPosition.y, ! pment.rcNormalPosition.left, pment.rcNormalPosition.top, ! pment.rcNormalPosition.right, pment.rcNormalPosition.bottom); ! } ! // @pyswig |SetWindowPlacement|Sets the windows placement ! static PyObject * ! PySetWindowPlacement(PyObject *self, PyObject *args) ! { ! int hwnd; ! WINDOWPLACEMENT pment; ! pment.length=sizeof(pment); ! // @pyparm (tuple)|placement||A tuple representing the WINDOWPLACEMENT structure. ! if (!PyArg_ParseTuple(args,"i(ii(ii)(ii)(iiii)):SetWindowPlacement", ! &hwnd, ! &pment.flags, &pment.showCmd, ! &pment.ptMinPosition.x,&pment.ptMinPosition.y, ! &pment.ptMaxPosition.x,&pment.ptMaxPosition.y, ! &pment.rcNormalPosition.left, &pment.rcNormalPosition.top, ! &pment.rcNormalPosition.right, &pment.rcNormalPosition.bottom)) ! return NULL; ! BOOL rc; ! Py_BEGIN_ALLOW_THREADS ! rc = SetWindowPlacement( (HWND)hwnd, &pment ); ! Py_END_ALLOW_THREADS ! if (!rc) ! return PyWin_SetAPIError("SetWindowPlacement"); ! Py_INCREF(Py_None); ! return Py_None; ! } ! ! %} ! %native (GetWindowPlacement) PyGetWindowPlacement; ! %native (SetWindowPlacement) PySetWindowPlacement; ! %{ // @pyswig int|RegisterClass|Registers a window class. *************** *** 2692,2697 **** BOOL GetMessage(MSG *OUTPUT, HWND hwnd, // @pyparm int|hwnd|| ! UINT min, // @pyparm int|max|| ! UINT max); // @pyparm int|min|| // @pyswig int|TranslateMessage| --- 2759,2764 ---- BOOL GetMessage(MSG *OUTPUT, HWND hwnd, // @pyparm int|hwnd|| ! UINT min, // @pyparm int|min|| ! UINT max); // @pyparm int|max|| // @pyswig int|TranslateMessage| |