[pywin32-checkins] pywin32/com/win32comext/shell/src shell.cpp, 1.49, 1.50
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Roger U. <ru...@us...> - 2007-02-12 07:38:59
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1828/com/win32comext/shell/src Modified Files: shell.cpp Log Message: Various compatiblility issues Index: shell.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/shell.cpp,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** shell.cpp 22 Sep 2006 05:05:51 -0000 1.49 --- shell.cpp 12 Feb 2007 07:38:57 -0000 1.50 *************** *** 460,464 **** // @tupleitem 0|int|Mask|Combination of shellcon.CMIC_MASK_* constants, can be 0 // @tupleitem 1|<o PyHANDLE>|hwnd|Window that owns the shortcut menu ! // @tupleitem 2|int or str|Vert|Action to be carried out, specified as a string command or integer menu item id // @tupleitem 3|str|Parameters|Extra parameters to be passed to the command line for the action, can be None // @tupleitem 4|str|Directory|Working directory, can be None --- 460,464 ---- // @tupleitem 0|int|Mask|Combination of shellcon.CMIC_MASK_* constants, can be 0 // @tupleitem 1|<o PyHANDLE>|hwnd|Window that owns the shortcut menu ! // @tupleitem 2|int or str|Verb|Action to be carried out, specified as a string command or integer menu item id // @tupleitem 3|str|Parameters|Extra parameters to be passed to the command line for the action, can be None // @tupleitem 4|str|Directory|Working directory, can be None *************** *** 468,478 **** BOOL PyObject_AsCMINVOKECOMMANDINFO(PyObject *ob, CMINVOKECOMMANDINFO *pci) { ! PyObject *obVerb; ZeroMemory(pci, sizeof(CMINVOKECOMMANDINFO)); pci->cbSize=sizeof(CMINVOKECOMMANDINFO); ! if (!PyArg_ParseTuple(ob, "iiOzziii:CMINVOKECOMMANDINFO tuple", &pci->fMask, &pci->hwnd, &obVerb, &pci->lpParameters, &pci->lpDirectory, ! &pci->nShow, &pci->dwHotKey, &pci->hIcon)) return FALSE; if (PyString_Check(obVerb)) { pci->lpVerb = PyString_AsString(obVerb); --- 468,482 ---- BOOL PyObject_AsCMINVOKECOMMANDINFO(PyObject *ob, CMINVOKECOMMANDINFO *pci) { ! PyObject *obVerb, *obhwnd, *obhIcon; ZeroMemory(pci, sizeof(CMINVOKECOMMANDINFO)); pci->cbSize=sizeof(CMINVOKECOMMANDINFO); ! if (!PyArg_ParseTuple(ob, "iOOzziiO:CMINVOKECOMMANDINFO tuple", &pci->fMask, &obhwnd, &obVerb, &pci->lpParameters, &pci->lpDirectory, ! &pci->nShow, &pci->dwHotKey, &obhIcon)) return FALSE; + if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&pci->hwnd, FALSE)) + return NULL; + if (!PyWinObject_AsHANDLE(obhIcon, (HANDLE *)&pci->hIcon, TRUE)) + return NULL; if (PyString_Check(obVerb)) { pci->lpVerb = PyString_AsString(obVerb); *************** *** 516,522 **** return NULL; } ! return Py_BuildValue("iiNNNiii", pci->fMask, pci->hwnd, obVerb, obParams, obDir, ! pci->nShow, pci->dwHotKey, pci->hIcon); } --- 520,526 ---- return NULL; } ! return Py_BuildValue("iNNNNiiN", pci->fMask, PyWinLong_FromHANDLE(pci->hwnd), obVerb, obParams, obDir, ! pci->nShow, pci->dwHotKey, PyWinLong_FromHANDLE(pci->hIcon)); } *************** *** 576,581 **** BOOL PyObject_AsMSG( PyObject *obpmsg, MSG *msg ) { ! return PyArg_ParseTuple(obpmsg, "iiiii(ii)", &msg->hwnd,&msg->message,&msg->wParam,&msg->lParam,&msg->time,&msg->pt.x,&msg->pt.y); } PyObject *PyObject_FromMSG(const MSG *msg) { --- 580,588 ---- BOOL PyObject_AsMSG( PyObject *obpmsg, MSG *msg ) { ! PyObject *obhwnd; ! return PyArg_ParseTuple(obpmsg, "Oiiii(ii)", &obhwnd,&msg->message,&msg->wParam,&msg->lParam,&msg->time,&msg->pt.x,&msg->pt.y) ! && PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&msg->hwnd, FALSE); } + PyObject *PyObject_FromMSG(const MSG *msg) { *************** *** 584,588 **** return Py_None; } ! return Py_BuildValue("iiiii(ii)", msg->hwnd,msg->message,msg->wParam,msg->lParam,msg->time,msg->pt.x,msg->pt.y); } --- 591,595 ---- return Py_None; } ! return Py_BuildValue("Niiii(ii)", PyWinLong_FromHANDLE(msg->hwnd),msg->message,msg->wParam,msg->lParam,msg->time,msg->pt.x,msg->pt.y); } *************** *** 753,757 **** } ! BOOL PyObject_AsOLEMENUGROUPWIDTHS( PyObject *oblpMenuWidths, OLEMENUGROUPWIDTHS *pWidths) { --- 760,764 ---- } ! // @object PyLPOLEMENUGROUPWIDTHS|Tuple containing 6 ints indicating nbr of options in each menu group BOOL PyObject_AsOLEMENUGROUPWIDTHS( PyObject *oblpMenuWidths, OLEMENUGROUPWIDTHS *pWidths) { *************** *** 814,821 **** BOOL PyObject_AsSHFILEOPSTRUCT(PyObject *ob, SHFILEOPSTRUCT *p) { ! PyObject *obFrom, *obTo, *obNameMappings = Py_None, *obProgressTitle = Py_None; memset(p, 0, sizeof(*p)); ! if (!PyArg_ParseTuple(ob, "iiOO|iOO", ! &p->hwnd, // @tupleitem 0|int|hwnd|Handle of window in which to display status messages &p->wFunc, // @tupleitem 1|int|wFunc|One of the shellcon.FO_* values &obFrom, // @tupleitem 2|str/unicode|From|String containing source file name(s) separated by nulls --- 821,828 ---- BOOL PyObject_AsSHFILEOPSTRUCT(PyObject *ob, SHFILEOPSTRUCT *p) { ! PyObject *obFrom, *obTo, *obNameMappings = Py_None, *obProgressTitle = Py_None, *obhwnd; memset(p, 0, sizeof(*p)); ! if (!PyArg_ParseTuple(ob, "OiOO|iOO", ! &obhwnd, // @tupleitem 0|int|hwnd|Handle of window in which to display status messages &p->wFunc, // @tupleitem 1|int|wFunc|One of the shellcon.FO_* values &obFrom, // @tupleitem 2|str/unicode|From|String containing source file name(s) separated by nulls *************** *** 825,829 **** &obProgressTitle)) // @tupleitem 6|string|ProgressTitle|Title for progress dialog (flags must contain FOF_SIMPLEPROGRESS). Default=None return FALSE; ! if (obNameMappings != Py_None) { PyErr_SetString(PyExc_TypeError, "The NameMappings value must be None"); --- 832,837 ---- &obProgressTitle)) // @tupleitem 6|string|ProgressTitle|Title for progress dialog (flags must contain FOF_SIMPLEPROGRESS). Default=None return FALSE; ! if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&p->hwnd, TRUE)) ! return NULL; if (obNameMappings != Py_None) { PyErr_SetString(PyExc_TypeError, "The NameMappings value must be None"); *************** *** 870,874 **** } assert(!PyErr_Occurred()); ! args = Py_BuildValue("lilO", hwnd, uMsg, lParam, pc->data); if (!args) goto done; result = PyEval_CallObject(pc->fn, args); --- 878,882 ---- } assert(!PyErr_Occurred()); ! args = Py_BuildValue("NilO", PyWinLong_FromHANDLE(hwnd), uMsg, lParam, pc->data); if (!args) goto done; result = PyEval_CallObject(pc->fn, args); *************** *** 899,902 **** --- 907,911 ---- memset(&bi, 0, sizeof(BROWSEINFO)); PyObject *rc = NULL; + PyObject *obhwndOwner=Py_None; PyObject *obPIDL = Py_None; PyObject *obTitle = Py_None; *************** *** 910,922 **** #endif ! if(!PyArg_ParseTuple(args, "|lOOlOO:SHBrowseForFolder", ! &bi.hwndOwner, // @pyparm int|hwndOwner|0| ! &obPIDL, // @pyparm <o PyIDL>|pidlRoot|None| ! &obTitle, // @pyparm <o Unicode>/string|title|None| ! &bi.ulFlags, // @pyparm int|flags|0| &obcb, // @pyparm object|callback|None|A callable object to be used as the callback, or None &obcbparam)) // @pyparm object|callback_data|None|An object passed to the callback function return NULL; ! if (obcb != Py_None) { #if (PY_VERSION_HEX >= 0x02030000) // PyGILState only in 2.3+ --- 919,932 ---- #endif ! if(!PyArg_ParseTuple(args, "|OOOlOO:SHBrowseForFolder", ! &obhwndOwner, // @pyparm <o PyHANDLE>|hwndOwner|None|Parent window for the dialog box, can be None ! &obPIDL, // @pyparm <o PyIDL>|pidlRoot|None|PIDL identifying the place to start browsing. Desktop is used if not specified ! &obTitle, // @pyparm <o Unicode>/string|title|None|Title to be displayed with the directory tree ! &bi.ulFlags, // @pyparm int|flags|0|Combination of shellcon.BIF_* flags &obcb, // @pyparm object|callback|None|A callable object to be used as the callback, or None &obcbparam)) // @pyparm object|callback_data|None|An object passed to the callback function return NULL; ! if (!PyWinObject_AsHANDLE(obhwndOwner, (HANDLE *)&bi.hwndOwner, TRUE)) ! return NULL; if (obcb != Py_None) { #if (PY_VERSION_HEX >= 0x02030000) // PyGILState only in 2.3+ *************** *** 1028,1039 **** { HWND hwndOwner; int nFolder; BOOL bCreate = FALSE; ! if(!PyArg_ParseTuple(args, "li|i:SHGetSpecialFolderPath", ! &hwndOwner, // @pyparm int|hwndOwner|| &nFolder, // @pyparm int|nFolder||One of the CSIDL_* constants specifying the path. &bCreate)) // @pyparm int|bCreate|0|Should the path be created. return NULL; ! // @comm This method is only available in shell version 4.71. If the // function is not available, a COM Exception with HRESULT=E_NOTIMPL --- 1038,1051 ---- { HWND hwndOwner; + PyObject *obhwndOwner; int nFolder; BOOL bCreate = FALSE; ! if(!PyArg_ParseTuple(args, "Oi|i:SHGetSpecialFolderPath", ! &obhwndOwner, // @pyparm <o PyHANDLE>|hwndOwner||Parent window, can be None (or 0) &nFolder, // @pyparm int|nFolder||One of the CSIDL_* constants specifying the path. &bCreate)) // @pyparm int|bCreate|0|Should the path be created. return NULL; ! if (!PyWinObject_AsHANDLE(obhwndOwner, (HANDLE *)&hwndOwner, TRUE)) ! return NULL; // @comm This method is only available in shell version 4.71. If the // function is not available, a COM Exception with HRESULT=E_NOTIMPL *************** *** 1056,1065 **** { HWND hwndOwner; int nFolder; ! if(!PyArg_ParseTuple(args, "li|i:SHGetSpecialFolderLocation", ! &hwndOwner, // @pyparm int|hwndOwner|| &nFolder)) // @pyparm int|nFolder||One of the CSIDL_* constants specifying the path. return NULL; ! LPITEMIDLIST pidl; PY_INTERFACE_PRECALL; --- 1068,1079 ---- { HWND hwndOwner; + PyObject *obhwndOwner; int nFolder; ! if(!PyArg_ParseTuple(args, "Oi:SHGetSpecialFolderLocation", ! &obhwndOwner, // @pyparm <o PyHANDLE>|hwndOwner||Parent window, can be None (or 0) &nFolder)) // @pyparm int|nFolder||One of the CSIDL_* constants specifying the path. return NULL; ! if (!PyWinObject_AsHANDLE(obhwndOwner, (HANDLE *)&hwndOwner, TRUE)) ! return NULL; LPITEMIDLIST pidl; PY_INTERFACE_PRECALL; *************** *** 1113,1119 **** info.dwAttributes = info_attrs; PY_INTERFACE_PRECALL; ! DWORD dw = SHGetFileInfo(name, attr, &info, sizeof(info), flags); PY_INTERFACE_POSTCALL; ! ret = Py_BuildValue("iN", dw, PyObject_FromSHFILEINFO(&info)); if (name) PyWinObject_FreeTCHAR(name); if (pidl) PyObject_FreePIDL(pidl); --- 1127,1133 ---- info.dwAttributes = info_attrs; PY_INTERFACE_PRECALL; ! DWORD_PTR dw = SHGetFileInfo(name, attr, &info, sizeof(info), flags); PY_INTERFACE_POSTCALL; ! ret = Py_BuildValue("NN", PyLong_FromUnsignedLongLong(dw), PyObject_FromSHFILEINFO(&info)); if (name) PyWinObject_FreeTCHAR(name); if (pidl) PyObject_FreePIDL(pidl); *************** *** 1125,1139 **** { HWND hwndOwner; int nFolder; long flags; PyObject *obHandle; BOOL bCreate = FALSE; ! if(!PyArg_ParseTuple(args, "liOl:SHGetFolderPath", ! &hwndOwner, // @pyparm int|hwndOwner|| &nFolder, // @pyparm int|nFolder||One of the CSIDL_* constants specifying the path. &obHandle, // @pyparm <o PyHANDLE>|handle||An access token that can be used to represent a particular user, or None &flags)) // @pyparm int|flags||Controls which path is returned. May be SHGFP_TYPE_CURRENT or SHGFP_TYPE_DEFAULT return NULL; ! HANDLE handle; if (!PyWinObject_AsHANDLE(obHandle, &handle, TRUE)) --- 1139,1155 ---- { HWND hwndOwner; + PyObject *obhwndOwner; int nFolder; long flags; PyObject *obHandle; BOOL bCreate = FALSE; ! if(!PyArg_ParseTuple(args, "OiOl:SHGetFolderPath", ! &obhwndOwner, // @pyparm <o PyHANDLE>|hwndOwner||Parent window, can be None (or 0) &nFolder, // @pyparm int|nFolder||One of the CSIDL_* constants specifying the path. &obHandle, // @pyparm <o PyHANDLE>|handle||An access token that can be used to represent a particular user, or None &flags)) // @pyparm int|flags||Controls which path is returned. May be SHGFP_TYPE_CURRENT or SHGFP_TYPE_DEFAULT return NULL; ! if (!PyWinObject_AsHANDLE(obhwndOwner, (HANDLE *)&hwndOwner, TRUE)) ! return NULL; HANDLE handle; if (!PyWinObject_AsHANDLE(obHandle, &handle, TRUE)) *************** *** 1194,1205 **** int nFolder; DWORD flags = 0; ! PyObject *obToken=Py_None; ! if(!PyArg_ParseTuple(args, "li|Ol:SHGetFolderLocation", ! &hwndOwner, // @pyparm int|hwndOwner||Window in which to display any neccessary dialogs &nFolder, // @pyparm int|nFolder||One of the CSIDL_* constants specifying the path. &obToken, // @pyparm <o PyHANDLE>|hToken|None|An access token that can be used to represent a particular user, or None &flags)) // @pyparm int|reserved|0|Must be 0 return NULL; if (!PyWinObject_AsHANDLE(obToken, &hToken, TRUE)) return NULL; --- 1210,1223 ---- int nFolder; DWORD flags = 0; ! PyObject *obToken=Py_None, *obhwndOwner; ! if(!PyArg_ParseTuple(args, "Oi|Ol:SHGetFolderLocation", ! &obhwndOwner, // @pyparm int|hwndOwner||Window in which to display any neccessary dialogs &nFolder, // @pyparm int|nFolder||One of the CSIDL_* constants specifying the path. &obToken, // @pyparm <o PyHANDLE>|hToken|None|An access token that can be used to represent a particular user, or None &flags)) // @pyparm int|reserved|0|Must be 0 return NULL; + if (!PyWinObject_AsHANDLE(obhwndOwner, (HANDLE *)&hwndOwner, TRUE)) + return NULL; if (!PyWinObject_AsHANDLE(obToken, &hToken, TRUE)) return NULL; *************** *** 1241,1252 **** { HWND hwnd; char *path; DWORD flags; ! if(!PyArg_ParseTuple(args, "lzl:SHEmptyRecycleBin", ! &hwnd, // @pyparm int|hwnd|| &path, // @pyparm string|path||A NULL-terminated string that contains the path of the root drive on which the recycle bin is located. This parameter can contain the address of a string formatted with the drive, folder, and subfolder names (c:\windows\system . . .). It can also contain an empty string or NULL. If this value is an empty string or NULL, all recycle bins on all drives will be emptied. &flags)) // @pyparm int|flags||One of the SHERB_* values. return NULL; ! // @comm This method is only available in shell version 4.71. If the function is not available, a COM Exception with HRESULT=E_NOTIMPL will be raised. if (pfnSHEmptyRecycleBin==NULL) --- 1259,1272 ---- { HWND hwnd; + PyObject *obhwnd; char *path; DWORD flags; ! if(!PyArg_ParseTuple(args, "Ozl:SHEmptyRecycleBin", ! &obhwnd, // @pyparm <o PyHANDLE>|hwnd||Handle to parent window, can be None &path, // @pyparm string|path||A NULL-terminated string that contains the path of the root drive on which the recycle bin is located. This parameter can contain the address of a string formatted with the drive, folder, and subfolder names (c:\windows\system . . .). It can also contain an empty string or NULL. If this value is an empty string or NULL, all recycle bins on all drives will be emptied. &flags)) // @pyparm int|flags||One of the SHERB_* values. return NULL; ! if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&hwnd, TRUE)) ! return NULL; // @comm This method is only available in shell version 4.71. If the function is not available, a COM Exception with HRESULT=E_NOTIMPL will be raised. if (pfnSHEmptyRecycleBin==NULL) *************** *** 1481,1488 **** LONG events; UINT msg; ! PyObject *obPIDL; SHChangeNotifyEntry entry; ! if(!PyArg_ParseTuple(args, "iiii(Oi):SHChangeNotifyRegister", ! &hwnd, // @pyparm int|hwnd||Handle to the window that receives the change or notification messages. &sources, // @pyparm int|sources||One or more values that indicate the type of events for which to receive notifications. &events, // @pyparm int|events||Change notification events for which to receive notification. --- 1501,1508 ---- LONG events; UINT msg; ! PyObject *obPIDL, *obhwnd; SHChangeNotifyEntry entry; ! if(!PyArg_ParseTuple(args, "Oiii(Oi):SHChangeNotifyRegister", ! &obhwnd, // @pyparm <o PyHANDLE>|hwnd||Handle to the window that receives the change or notification messages. &sources, // @pyparm int|sources||One or more values that indicate the type of events for which to receive notifications. &events, // @pyparm int|events||Change notification events for which to receive notification. *************** *** 1491,1495 **** &entry.fRecursive)) return NULL; ! if (!PyObject_AsPIDL(obPIDL, (ITEMIDLIST **)&entry.pidl, TRUE)) return NULL; --- 1511,1516 ---- &entry.fRecursive)) return NULL; ! if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&hwnd, FALSE)) ! return NULL; if (!PyObject_AsPIDL(obPIDL, (ITEMIDLIST **)&entry.pidl, TRUE)) return NULL; *************** *** 1527,1540 **** } ! // @pymethod int/string|shell|DragQueryFile| static PyObject *PyDragQueryFile(PyObject *self, PyObject *args) { ! int iglobal; UINT index; ! if(!PyArg_ParseTuple(args, "ii:DragQueryFile", ! &iglobal, // @pyparm int|hglobal||The HGLOBAL object - generally obtained via the 'data_handle' property of a <o PySTGMEDIUM> object. &index)) // @pyparm int|index||The index to retrieve. If -1, the result if an integer representing the valid index values. return NULL; ! HDROP hglobal = (HDROP)iglobal; if (index==0xFFFFFFFF) { return PyInt_FromLong(DragQueryFile(hglobal, index, NULL, 0)); --- 1548,1563 ---- } ! // @pymethod int/string|shell|DragQueryFile|Retrieves the names (or count) of dropped files static PyObject *PyDragQueryFile(PyObject *self, PyObject *args) { ! HDROP hglobal; ! PyObject *obhglobal; UINT index; ! if(!PyArg_ParseTuple(args, "Oi:DragQueryFile", ! &obhglobal, // @pyparm <o PyHANDLE>|hglobal||The HGLOBAL object - generally obtained via the 'data_handle' property of a <o PySTGMEDIUM> object. &index)) // @pyparm int|index||The index to retrieve. If -1, the result if an integer representing the valid index values. return NULL; ! if (!PyWinObject_AsHANDLE(obhglobal, (HANDLE *)&hglobal, FALSE)) ! return NULL; if (index==0xFFFFFFFF) { return PyInt_FromLong(DragQueryFile(hglobal, index, NULL, 0)); *************** *** 1551,1564 **** } ! // @pymethod int/<o PyUnicode>|shell|DragQueryFileW| static PyObject *PyDragQueryFileW(PyObject *self, PyObject *args) { ! int iglobal; UINT index; ! if(!PyArg_ParseTuple(args, "ii:DragQueryFileW", ! &iglobal, // @pyparm int|hglobal||The HGLOBAL object - generally obtained via the 'data_handle' property of a <o PySTGMEDIUM> object. &index)) // @pyparm int|index||The index to retrieve. If -1, the result if an integer representing the valid index values. return NULL; ! HDROP hglobal = (HDROP)iglobal; if (index==0xFFFFFFFF) { return PyInt_FromLong(DragQueryFileW(hglobal, index, NULL, 0)); --- 1574,1589 ---- } ! // @pymethod int/<o PyUnicode>|shell|DragQueryFileW|Retrieves the names (or count) of dropped files static PyObject *PyDragQueryFileW(PyObject *self, PyObject *args) { ! HDROP hglobal; ! PyObject *obhglobal; UINT index; ! if(!PyArg_ParseTuple(args, "Oi:DragQueryFileW", ! &obhglobal, // @pyparm <o PyHANDLE>|hglobal||The HGLOBAL object - generally obtained via the 'data_handle' property of a <o PySTGMEDIUM> object. &index)) // @pyparm int|index||The index to retrieve. If -1, the result if an integer representing the valid index values. return NULL; ! if (!PyWinObject_AsHANDLE(obhglobal, (HANDLE *)&hglobal, FALSE)) ! return NULL; if (index==0xFFFFFFFF) { return PyInt_FromLong(DragQueryFileW(hglobal, index, NULL, 0)); *************** *** 1580,1588 **** static PyObject *PyDragQueryPoint(PyObject *self, PyObject *args) { ! int iglobal; ! if(!PyArg_ParseTuple(args, "i:DragQueryFile", ! &iglobal)) // @pyparm int|hglobal||The HGLOBAL object - generally obtained the 'data_handle' property of a <o PySTGMEDIUM> return NULL; - HDROP hglobal = (HDROP)iglobal; POINT pt; BOOL result = ::DragQueryPoint(hglobal, &pt); --- 1605,1615 ---- static PyObject *PyDragQueryPoint(PyObject *self, PyObject *args) { ! HDROP hglobal; ! PyObject *obhglobal; ! if(!PyArg_ParseTuple(args, "O:DragQueryFile", ! &obhglobal)) // @pyparm <o PyHANDLE>|hglobal||The HGLOBAL object - generally obtained the 'data_handle' property of a <o PySTGMEDIUM> ! return NULL; ! if (!PyWinObject_AsHANDLE(obhglobal, (HANDLE *)&hglobal, FALSE)) return NULL; POINT pt; BOOL result = ::DragQueryPoint(hglobal, &pt); *************** *** 1640,1648 **** static PyObject *PyAddressAsPIDL(PyObject *self, PyObject *args) { ! long lpidl; // @pyparm int|address||The address of the PIDL ! if (!PyArg_ParseTuple(args, "l:AddressAsPIDL", &lpidl)) return NULL; ! return PyObject_FromPIDL((LPCITEMIDLIST)lpidl, FALSE); } --- 1667,1679 ---- static PyObject *PyAddressAsPIDL(PyObject *self, PyObject *args) { ! LPCITEMIDLIST lpidl; ! PyObject *obpidl; // @pyparm int|address||The address of the PIDL ! if (!PyArg_ParseTuple(args, "O:AddressAsPIDL", &obpidl)) return NULL; ! lpidl=(LPCITEMIDLIST)PyLong_AsVoidPtr(obpidl); ! if (lpidl==NULL && PyErr_Occurred()) ! return NULL; ! return PyObject_FromPIDL(lpidl, FALSE); } *************** *** 2047,2060 **** "hIcon", "hMonitor", NULL, }; ! PyObject *obVerb = NULL, *obFile = NULL, *obParams = NULL; PyObject *obDirectory = NULL, *obIDList = NULL, *obClass = NULL; PyObject *obhkeyClass = NULL, *obHotKey = NULL, *obhIcon = NULL; PyObject *obhMonitor = NULL; ! if (!PyArg_ParseTupleAndKeywords(args, kw, "|llOOOOlOOOOOO", kw_items, // @pyparm int|fMask|0|The default mask for the // structure. Other masks may be added based on // what paramaters are supplied. &p->fMask, ! &p->hwnd, // @pyparm int|hwnd|0| &obVerb, // @pyparm string|lpVerb|| &obFile, // @pyparm string|lpFile|| --- 2078,2091 ---- "hIcon", "hMonitor", NULL, }; ! PyObject *obhwnd=Py_None, *obVerb = NULL, *obFile = NULL, *obParams = NULL; PyObject *obDirectory = NULL, *obIDList = NULL, *obClass = NULL; PyObject *obhkeyClass = NULL, *obHotKey = NULL, *obhIcon = NULL; PyObject *obhMonitor = NULL; ! if (!PyArg_ParseTupleAndKeywords(args, kw, "|lOOOOOlOOOOOO", kw_items, // @pyparm int|fMask|0|The default mask for the // structure. Other masks may be added based on // what paramaters are supplied. &p->fMask, ! &obhwnd, // @pyparm <o PyHANDLE>|hwnd|0| &obVerb, // @pyparm string|lpVerb|| &obFile, // @pyparm string|lpFile|| *************** *** 2069,2073 **** &obhMonitor)) // @pyparm <o PyHANDLE>|hMonitor|| goto done; ! if (obVerb && !PyWinObject_AsString(obVerb, (char **)&p->lpVerb)) goto done; --- 2100,2105 ---- &obhMonitor)) // @pyparm <o PyHANDLE>|hMonitor|| goto done; ! if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&p->hwnd, TRUE)) ! goto done; if (obVerb && !PyWinObject_AsString(obVerb, (char **)&p->lpVerb)) goto done; |