pywin32-checkins Mailing List for Python for Windows Extensions (Page 153)
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
(1) |
Jun
(6) |
Jul
(50) |
Aug
(11) |
Sep
(24) |
Oct
(184) |
Nov
(118) |
Dec
(22) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(31) |
Feb
(25) |
Mar
(34) |
Apr
(105) |
May
(49) |
Jun
(38) |
Jul
(39) |
Aug
(7) |
Sep
(98) |
Oct
(79) |
Nov
(20) |
Dec
(17) |
2005 |
Jan
(66) |
Feb
(32) |
Mar
(43) |
Apr
(30) |
May
(58) |
Jun
(30) |
Jul
(16) |
Aug
(4) |
Sep
(21) |
Oct
(42) |
Nov
(11) |
Dec
(14) |
2006 |
Jan
(42) |
Feb
(30) |
Mar
(22) |
Apr
(1) |
May
(9) |
Jun
(15) |
Jul
(20) |
Aug
(9) |
Sep
(8) |
Oct
(1) |
Nov
(9) |
Dec
(43) |
2007 |
Jan
(52) |
Feb
(45) |
Mar
(20) |
Apr
(12) |
May
(59) |
Jun
(39) |
Jul
(35) |
Aug
(31) |
Sep
(17) |
Oct
(20) |
Nov
(4) |
Dec
(4) |
2008 |
Jan
(28) |
Feb
(111) |
Mar
(4) |
Apr
(27) |
May
(40) |
Jun
(27) |
Jul
(32) |
Aug
(94) |
Sep
(87) |
Oct
(153) |
Nov
(336) |
Dec
(331) |
2009 |
Jan
(298) |
Feb
(127) |
Mar
(20) |
Apr
(8) |
May
|
Jun
(10) |
Jul
(6) |
Aug
|
Sep
(2) |
Oct
(2) |
Nov
|
Dec
(1) |
2010 |
Jan
(7) |
Feb
(1) |
Mar
|
Apr
|
May
(15) |
Jun
(4) |
Jul
(3) |
Aug
(28) |
Sep
(1) |
Oct
(19) |
Nov
(16) |
Dec
(6) |
2011 |
Jan
(2) |
Feb
(18) |
Mar
(17) |
Apr
(12) |
May
(5) |
Jun
(11) |
Jul
(7) |
Aug
(2) |
Sep
(2) |
Oct
(4) |
Nov
(4) |
Dec
|
2012 |
Jan
(6) |
Feb
(2) |
Mar
|
Apr
(8) |
May
(4) |
Jun
(3) |
Jul
(13) |
Aug
(27) |
Sep
(8) |
Oct
(9) |
Nov
(3) |
Dec
(2) |
2013 |
Jan
|
Feb
(1) |
Mar
(5) |
Apr
(10) |
May
|
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(9) |
2014 |
Jan
(2) |
Feb
(4) |
Mar
(4) |
Apr
(1) |
May
(4) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
(1) |
2015 |
Jan
(1) |
Feb
|
Mar
|
Apr
(6) |
May
(2) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2016 |
Jan
(3) |
Feb
(2) |
Mar
|
Apr
(3) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
From: <mha...@us...> - 2003-10-09 13:26:38
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src In directory sc8-pr-cvs1:/tmp/cvs-serv7065/src Modified Files: PythonCOM.cpp Log Message: new constants. Index: PythonCOM.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/PythonCOM.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** PythonCOM.cpp 8 Oct 2003 05:37:32 -0000 1.22 --- PythonCOM.cpp 9 Oct 2003 13:26:33 -0000 1.23 *************** *** 1613,1616 **** --- 1613,1620 ---- ADD_CONSTANT(TYMED_ENHMF); ADD_CONSTANT(TYMED_NULL); + ADD_CONSTANT(DVASPECT_CONTENT); + ADD_CONSTANT(DVASPECT_THUMBNAIL); + ADD_CONSTANT(DVASPECT_ICON); + ADD_CONSTANT(DVASPECT_DOCPRINT); // DISPATCH |
From: <mha...@us...> - 2003-10-09 13:25:46
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/shell In directory sc8-pr-cvs1:/tmp/cvs-serv6818 Modified Files: shellcon.py Log Message: New constants. Index: shellcon.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/shellcon.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** shellcon.py 6 Oct 2003 12:58:49 -0000 1.4 --- shellcon.py 9 Oct 2003 13:25:42 -0000 1.5 *************** *** 540,541 **** --- 540,561 ---- SHCONTF_NONFOLDERS = 64 # for default view SHCONTF_INCLUDEHIDDEN = 128 # for hidden/system objects + + BFO_NONE = 0 + BFO_BROWSER_PERSIST_SETTINGS = 0x1 + BFO_RENAME_FOLDER_OPTIONS_TOINTERNET = 0x2 + BFO_BOTH_OPTIONS = 0x4 + BIF_PREFER_INTERNET_SHORTCUT = 0x8 + BFO_BROWSE_NO_IN_NEW_PROCESS = 0x10 + BFO_ENABLE_HYPERLINK_TRACKING = 0x20 + BFO_USE_IE_OFFLINE_SUPPORT = 0x40 + BFO_SUBSTITUE_INTERNET_START_PAGE = 0x80 + BFO_USE_IE_LOGOBANDING = 0x100 + BFO_ADD_IE_TOCAPTIONBAR = 0x200 + BFO_USE_DIALUP_REF = 0x400 + BFO_USE_IE_TOOLBAR = 0x800 + BFO_NO_PARENT_FOLDER_SUPPORT = 0x1000 + BFO_NO_REOPEN_NEXT_RESTART = 0x2000 + BFO_GO_HOME_PAGE = 0x4000 + BFO_PREFER_IEPROCESS = 0x8000 + BFO_SHOW_NAVIGATION_CANCELLED = 0x10000 + BFO_QUERY_ALL = -1 |
From: <mha...@us...> - 2003-10-09 12:49:43
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src/extensions In directory sc8-pr-cvs1:/tmp/cvs-serv1085 Modified Files: PyIDataObject.cpp PySTGMEDIUM.cpp Log Message: autoduck, and PySTGMEDIUM gets a data_handle property to get the integer handle. 'CVS: ---------------------------------------------------------------------- Index: PyIDataObject.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/extensions/PyIDataObject.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PyIDataObject.cpp 8 Oct 2003 04:28:42 -0000 1.1 --- PyIDataObject.cpp 9 Oct 2003 12:49:38 -0000 1.2 *************** *** 66,70 **** } ! // @pymethod |PyIDataObject|GetData|Description of GetData. PyObject *PyIDataObject::GetData(PyObject *self, PyObject *args) { --- 66,70 ---- } ! // @pymethod <o PySTGMEDIUM>|PyIDataObject|GetData|Description of GetData. PyObject *PyIDataObject::GetData(PyObject *self, PyObject *args) { *************** *** 93,97 **** } ! // @pymethod |PyIDataObject|GetDataHere|Description of GetDataHere. PyObject *PyIDataObject::GetDataHere(PyObject *self, PyObject *args) { --- 93,97 ---- } ! // @pymethod <o PySTGMEDIUM>|PyIDataObject|GetDataHere|Description of GetDataHere. PyObject *PyIDataObject::GetDataHere(PyObject *self, PyObject *args) { *************** *** 204,208 **** } ! // @pymethod |PyIDataObject|EnumFormatEtc|Description of EnumFormatEtc. PyObject *PyIDataObject::EnumFormatEtc(PyObject *self, PyObject *args) { --- 204,208 ---- } ! // @pymethod <o PyIEnumFORMATETC>|PyIDataObject|EnumFormatEtc|Description of EnumFormatEtc. PyObject *PyIDataObject::EnumFormatEtc(PyObject *self, PyObject *args) { *************** *** 225,229 **** } ! // @pymethod |PyIDataObject|DAdvise|Description of DAdvise. PyObject *PyIDataObject::DAdvise(PyObject *self, PyObject *args) { --- 225,229 ---- } ! // @pymethod int|PyIDataObject|DAdvise|Description of DAdvise. PyObject *PyIDataObject::DAdvise(PyObject *self, PyObject *args) { *************** *** 277,281 **** } ! // @pymethod |PyIDataObject|EnumDAdvise|Description of EnumDAdvise. PyObject *PyIDataObject::EnumDAdvise(PyObject *self, PyObject *args) { --- 277,281 ---- } ! // @pymethod <o PyIEnumSTATDATA>|PyIDataObject|EnumDAdvise|Description of EnumDAdvise. PyObject *PyIDataObject::EnumDAdvise(PyObject *self, PyObject *args) { Index: PySTGMEDIUM.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/extensions/PySTGMEDIUM.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PySTGMEDIUM.cpp 8 Oct 2003 04:28:42 -0000 1.1 --- PySTGMEDIUM.cpp 9 Oct 2003 12:49:38 -0000 1.2 *************** *** 1,9 **** ! #include "stdafx.h" #include "PythonCOM.h" #include "structmember.h" #include "PyComTypeObjects.h" ! ! // @pymethod <o STGMEDIUM>|pythoncom|STGMEDIUM|Creates a new STGMEDIUM object PyObject *Py_NewSTGMEDIUM(PyObject *self, PyObject *args) { --- 1,9 ---- ! // A Python object representing a windows STGMEDIUM structure. #include "stdafx.h" #include "PythonCOM.h" #include "structmember.h" #include "PyComTypeObjects.h" ! // @doc This file contains autoduck documentation. ! // @pymethod <o PySTGMEDIUM>|pythoncom|STGMEDIUM|Creates a new STGMEDIUM object PyObject *Py_NewSTGMEDIUM(PyObject *self, PyObject *args) { *************** *** 18,25 **** --- 18,28 ---- } + // @pymethod |PySTGMEDIUM|set|Sets the type and data of the object. PyObject *PySet(PyObject *self, PyObject *args) { int tymed; PyObject *ob; + // @pyparm int|tymed||The type of the data + // @pyparm object|data|| if (!PyArg_ParseTuple(args, "iO:set", &tymed, &ob)) return NULL; *************** *** 74,78 **** } ! // @object STGMEDIUM|A STGMEDIUM object represents a COM STGMEDIUM structure. static struct PyMethodDef PySTGMEDIUM_methods[] = { {"set", PySet, 1}, // @pymeth set|Sets the type and data of the object --- 77,81 ---- } ! // @object PySTGMEDIUM|A STGMEDIUM object represents a COM STGMEDIUM structure. static struct PyMethodDef PySTGMEDIUM_methods[] = { {"set", PySet, 1}, // @pymeth set|Sets the type and data of the object *************** *** 140,153 **** --- 143,164 ---- return res; PyErr_Clear(); + // @prop int|tymed|An integer indicating the type of data in the stgmedium if (strcmp(name, "tymed")==0) return PyInt_FromLong(ps->medium.tymed); + // @prop object|data|The data in the stgmedium. + // The result depends on the value of the 'tymed' property of the <o PySTGMEDIUM> object. + // @flagh tymed|Result Type if (strcmp(name, "data")==0) { switch (ps->medium.tymed) { + // @flag TYMED_GDI|An integer GDI handle case TYMED_GDI: return PyLong_FromVoidPtr(ps->medium.hBitmap); + // @flag TYMED_MFPICT|An integer METAFILE handle case TYMED_MFPICT: return PyLong_FromVoidPtr(ps->medium.hMetaFilePict); + // @flag TYMED_ENHMF|An integer ENHMETAFILE handle case TYMED_ENHMF: return PyLong_FromVoidPtr(ps->medium.hEnhMetaFile); + // @flag TYMED_HGLOBAL|A string with the bytes of the global memory object. case TYMED_HGLOBAL: { PyObject *ret; *************** *** 162,171 **** --- 173,214 ---- return ret; } + // @flag TYMED_FILE|A string/unicode filename case TYMED_FILE: return PyWinObject_FromWCHAR(ps->medium.lpszFileName); + // @flag TYMED_ISTREAM|A <o PyIStream> object case TYMED_ISTREAM: + // @flag TYMED_ISTORAGE|A <o PyIStorage> object return PyCom_PyObjectFromIUnknown(ps->medium.pstm, IID_IStream, TRUE); case TYMED_ISTORAGE: return PyCom_PyObjectFromIUnknown(ps->medium.pstg, IID_IStorage, TRUE); + case TYMED_NULL: + PyErr_SetString(PyExc_ValueError, "This STGMEDIUM has no data"); + return NULL; + default: + PyErr_SetString(PyExc_RuntimeError, "Unknown tymed"); + return NULL; + } + } + // @prop int|data_handle|The raw 'integer' representation of the data. + // For TYMED_HGLOBAL, this is the handle rather than the string data. + // For the string and interface types, this is an integer holding the pointer. + if (strcmp(name, "data_handle")==0) { + switch (ps->medium.tymed) { + case TYMED_GDI: + return PyLong_FromVoidPtr(ps->medium.hBitmap); + case TYMED_MFPICT: + return PyLong_FromVoidPtr(ps->medium.hMetaFilePict); + case TYMED_ENHMF: + return PyLong_FromVoidPtr(ps->medium.hEnhMetaFile); + case TYMED_HGLOBAL: + return PyLong_FromVoidPtr(ps->medium.hGlobal); + // and may as well hand out the pointers for these. + // We are all consenting adults :) + case TYMED_FILE: + return PyLong_FromVoidPtr(ps->medium.lpszFileName); + case TYMED_ISTREAM: + return PyLong_FromVoidPtr(ps->medium.pstm); + case TYMED_ISTORAGE: + return PyLong_FromVoidPtr(ps->medium.pstg); case TYMED_NULL: PyErr_SetString(PyExc_ValueError, "This STGMEDIUM has no data"); |
From: <mha...@us...> - 2003-10-09 12:48:30
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/src In directory sc8-pr-cvs1:/tmp/cvs-serv876 Modified Files: shell.cpp Log Message: autoduck Index: shell.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/shell.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** shell.cpp 9 Oct 2003 12:08:09 -0000 1.10 --- shell.cpp 9 Oct 2003 12:48:27 -0000 1.11 *************** *** 675,679 **** } ! // @pymethod string/int|shell|DragQueryFile|Notifies the shell that an image in the system image list has changed. static PyObject *PyDragQueryFile(PyObject *self, PyObject *args) { --- 675,683 ---- } ! // @pymethod string/int|shell|DragQueryFile|Notifies the shell that an ! // image in the system image list has changed. ! // @rdesc If the value for index is -1, the result is the number of ! // filenames available, otherwise the result is a string with the ! // requested filename. static PyObject *PyDragQueryFile(PyObject *self, PyObject *args) { *************** *** 681,686 **** UINT index; if(!PyArg_ParseTuple(args, "ii:DragQueryFile", ! &iglobal, ! &index)) return NULL; HDROP hglobal = (HDROP)iglobal; --- 685,690 ---- 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; *************** *** 706,710 **** int iglobal; if(!PyArg_ParseTuple(args, "i:DragQueryFile", ! &iglobal)) return NULL; HDROP hglobal = (HDROP)iglobal; --- 710,714 ---- 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; |
From: <mha...@us...> - 2003-10-09 12:34:39
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/demos/servers In directory sc8-pr-cvs1:/tmp/cvs-serv31365 Modified Files: context_menu.py Log Message: Demonstrate how to get the filenames of the selected objects. Index: context_menu.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/demos/servers/context_menu.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** context_menu.py 6 Oct 2003 13:40:09 -0000 1.2 --- context_menu.py 9 Oct 2003 12:34:35 -0000 1.3 *************** *** 26,43 **** def Initialize(self, folder, dataobj, hkey): print "Init", folder, dataobj, hkey def QueryContextMenu(self, hMenu, indexMenu, idCmdFirst, idCmdLast, uFlags): print "QCM", hMenu, indexMenu, idCmdFirst, idCmdLast, uFlags idCmd = idCmdFirst items = [] if (uFlags & 0x000F) == shellcon.CMF_NORMAL: # Check == here, since CMF_NORMAL=0 print "CMF_NORMAL..." ! items.append("&Hello from Python") elif uFlags & shellcon.CMF_VERBSONLY: print "CMF_VERBSONLY..." ! items.append("&Hello from Python - shortcut") elif uFlags & shellcon.CMF_EXPLORE: print "CMF_EXPLORE..." ! items.append("&Hello from Python - normal file, right-click in Explorer") elif uFlags & CMF_DEFAULTONLY: print "CMF_DEFAULTONLY...\r\n" --- 26,53 ---- def Initialize(self, folder, dataobj, hkey): print "Init", folder, dataobj, hkey + self.dataobj = dataobj def QueryContextMenu(self, hMenu, indexMenu, idCmdFirst, idCmdLast, uFlags): print "QCM", hMenu, indexMenu, idCmdFirst, idCmdLast, uFlags + # Query the items clicked on + format_etc = win32con.CF_HDROP, None, 1, -1, pythoncom.TYMED_HGLOBAL + sm = self.dataobj.GetData(format_etc) + num_files = shell.DragQueryFile(sm.data_handle, -1) + if num_files>1: + msg = "&Hello from Python (with %d files selected)" % num_files + else: + fname = shell.DragQueryFile(sm.data_handle, 0) + msg = "&Hello from Python (with '%s' selected)" % fname idCmd = idCmdFirst items = [] if (uFlags & 0x000F) == shellcon.CMF_NORMAL: # Check == here, since CMF_NORMAL=0 print "CMF_NORMAL..." ! items.append(msg) elif uFlags & shellcon.CMF_VERBSONLY: print "CMF_VERBSONLY..." ! items.append(msg + " - shortcut") elif uFlags & shellcon.CMF_EXPLORE: print "CMF_EXPLORE..." ! items.append(msg + " - normal file, right-click in Explorer") elif uFlags & CMF_DEFAULTONLY: print "CMF_DEFAULTONLY...\r\n" |
From: <mha...@us...> - 2003-10-09 12:09:24
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/src In directory sc8-pr-cvs1:/tmp/cvs-serv27177 Modified Files: PyIShellExtInit.cpp Log Message: Re-enable IDataObject support now we have it. Index: PyIShellExtInit.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/PyIShellExtInit.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PyIShellExtInit.cpp 8 Oct 2003 23:34:41 -0000 1.2 --- PyIShellExtInit.cpp 9 Oct 2003 12:09:17 -0000 1.3 *************** *** 45,49 **** if (!PyObject_AsPIDL(obpFolder, &pFolder)) bPythonIsHappy = FALSE; // XXX - no IDataObject support ! if (!PyCom_InterfaceFromPyInstanceOrObject(obpDataObject, IID_IUnknown, (void **)&pDataObject, TRUE /* bNoneOK */)) bPythonIsHappy = FALSE; if (!PyWinObject_AsHANDLE(obhkey, (HANDLE *)&hkey, FALSE)) bPythonIsHappy = FALSE; --- 45,49 ---- if (!PyObject_AsPIDL(obpFolder, &pFolder)) bPythonIsHappy = FALSE; // XXX - no IDataObject support ! if (!PyCom_InterfaceFromPyInstanceOrObject(obpDataObject, IID_IDataObject, (void **)&pDataObject, TRUE /* bNoneOK */)) bPythonIsHappy = FALSE; if (!PyWinObject_AsHANDLE(obhkey, (HANDLE *)&hkey, FALSE)) bPythonIsHappy = FALSE; *************** *** 88,92 **** obpFolder = PyObject_FromPIDL(pFolder, FALSE); // XXX - no IDataObject support ! obpDataObject = PyCom_PyObjectFromIUnknown(pDataObject, IID_IUnknown, TRUE); HRESULT hr=InvokeViaPolicy("Initialize", NULL, "OOi", obpFolder, obpDataObject, hkey); Py_XDECREF(obpFolder); --- 88,92 ---- obpFolder = PyObject_FromPIDL(pFolder, FALSE); // XXX - no IDataObject support ! obpDataObject = PyCom_PyObjectFromIUnknown(pDataObject, IID_IDataObject, TRUE); HRESULT hr=InvokeViaPolicy("Initialize", NULL, "OOi", obpFolder, obpDataObject, hkey); Py_XDECREF(obpFolder); |
From: <mha...@us...> - 2003-10-09 12:08:12
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/src In directory sc8-pr-cvs1:/tmp/cvs-serv26916 Modified Files: shell.cpp Log Message: reinstate commented constants, and add DragQueryFile/DragQueryPoint Index: shell.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/shell.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** shell.cpp 8 Oct 2003 23:34:41 -0000 1.9 --- shell.cpp 9 Oct 2003 12:08:09 -0000 1.10 *************** *** 675,682 **** --- 675,723 ---- } + // @pymethod string/int|shell|DragQueryFile|Notifies the shell that an image in the system image list has changed. + static PyObject *PyDragQueryFile(PyObject *self, PyObject *args) + { + int iglobal; + UINT index; + if(!PyArg_ParseTuple(args, "ii:DragQueryFile", + &iglobal, + &index)) + return NULL; + HDROP hglobal = (HDROP)iglobal; + if (index==0xFFFFFFFF) { + return PyInt_FromLong(DragQueryFile(hglobal, index, NULL, 0)); + } + // get the buffer size + UINT nchars = DragQueryFile(hglobal, index, NULL, 0)+2; + TCHAR *sz = (TCHAR *)malloc(nchars * sizeof(TCHAR)); + if (sz==NULL) + return PyErr_NoMemory(); + nchars = ::DragQueryFile(hglobal, index, sz, nchars); + PyObject *ret = PyWinObject_FromTCHAR(sz, nchars); + free(sz); + return ret; + } + + // @pymethod int, (int,int)|shell|DragQueryPoint|Retrieves the position of the mouse pointer at the time a file was dropped during a drag-and-drop operation. + // @rdesc The first item of the return tuple is True if the drop occurred in the client area of the window, or False if the drop did not occur in the client area of the window. + // @comm The window for which coordinates are returned is the window that received the WM_DROPFILES message + static PyObject *PyDragQueryPoint(PyObject *self, PyObject *args) + { + int iglobal; + if(!PyArg_ParseTuple(args, "i:DragQueryFile", + &iglobal)) + return NULL; + HDROP hglobal = (HDROP)iglobal; + POINT pt; + BOOL result = ::DragQueryPoint(hglobal, &pt); + return Py_BuildValue("O(ii)", result ? Py_True : Py_False, pt.x, pt.y); + } + /* List of module functions */ // @module shell|A module, encapsulating the ActiveX Control interfaces static struct PyMethodDef shell_methods[]= { + { "DragQueryFile", PyDragQueryFile, 1 }, // @pymeth DragQueryFile|Retrieves the file names of dropped files that have resulted from a successful drag-and-drop operation. + { "DragQueryPoint", PyDragQueryPoint, 1}, // @pymeth DragQueryPoint|Retrieves the position of the mouse pointer at the time a file was dropped during a drag-and-drop operation. { "SHGetPathFromIDList", PySHGetPathFromIDList, 1 }, // @pymeth SHGetPathFromIDList|Converts an <o PyIDL> to a path. { "SHBrowseForFolder", PySHBrowseForFolder, 1 }, // @pymeth SHBrowseForFolder|Displays a dialog box that enables the user to select a shell folder. *************** *** 752,763 **** ADD_CONSTANT(SLR_NO_UI); ! // Some of these are win2k only... ! // ADD_CONSTANT(SLR_NOLINKINFO); ! // ADD_CONSTANT(SLR_INVOKE_MSI); ADD_CONSTANT(SLR_ANY_MATCH); ADD_CONSTANT(SLR_UPDATE); ADD_CONSTANT(SLR_NOUPDATE); ! // ADD_CONSTANT(SLR_NOSEARCH); ! // ADD_CONSTANT(SLR_NOTRACK); ADD_CONSTANT(SLGP_SHORTPATH); ADD_CONSTANT(SLGP_UNCPRIORITY); --- 793,803 ---- ADD_CONSTANT(SLR_NO_UI); ! ADD_CONSTANT(SLR_NOLINKINFO); ! ADD_CONSTANT(SLR_INVOKE_MSI); ADD_CONSTANT(SLR_ANY_MATCH); ADD_CONSTANT(SLR_UPDATE); ADD_CONSTANT(SLR_NOUPDATE); ! ADD_CONSTANT(SLR_NOSEARCH); ! ADD_CONSTANT(SLR_NOTRACK); ADD_CONSTANT(SLGP_SHORTPATH); ADD_CONSTANT(SLGP_UNCPRIORITY); |
From: <mha...@us...> - 2003-10-09 12:07:15
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/src In directory sc8-pr-cvs1:/tmp/cvs-serv26809 Modified Files: PyIShellView.cpp PyIShellBrowser.cpp Log Message: Remove commented module functions, as they upset autoduck. Index: PyIShellView.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/PyIShellView.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PyIShellView.cpp 8 Oct 2003 23:34:41 -0000 1.1 --- PyIShellView.cpp 9 Oct 2003 12:07:12 -0000 1.2 *************** *** 305,309 **** { "DestroyViewWindow", PyIShellView::DestroyViewWindow, 1 }, // @pymeth DestroyViewWindow|Description of DestroyViewWindow { "GetCurrentInfo", PyIShellView::GetCurrentInfo, 1 }, // @pymeth GetCurrentInfo|Description of GetCurrentInfo - // { "AddPropertySheetPages", PyIShellView::AddPropertySheetPages, 1 }, // @pymeth AddPropertySheetPages|Description of AddPropertySheetPages { "SaveViewState", PyIShellView::SaveViewState, 1 }, // @pymeth SaveViewState|Description of SaveViewState { "SelectItem", PyIShellView::SelectItem, 1 }, // @pymeth SelectItem|Description of SelectItem --- 305,308 ---- Index: PyIShellBrowser.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/PyIShellBrowser.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PyIShellBrowser.cpp 8 Oct 2003 23:34:41 -0000 1.1 --- PyIShellBrowser.cpp 9 Oct 2003 12:07:12 -0000 1.2 *************** *** 391,395 **** { "QueryActiveShellView", PyIShellBrowser::QueryActiveShellView, 1 }, // @pymeth QueryActiveShellView|Description of QueryActiveShellView { "OnViewWindowActive", PyIShellBrowser::OnViewWindowActive, 1 }, // @pymeth OnViewWindowActive|Description of OnViewWindowActive - // { "SetToolbarItems", PyIShellBrowser::SetToolbarItems, 1 }, // @pymeth SetToolbarItems|Description of SetToolbarItems { NULL } }; --- 391,394 ---- |
From: <mha...@us...> - 2003-10-09 00:26:33
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src/extensions In directory sc8-pr-cvs1:/tmp/cvs-serv32050/extensions Added Files: PyIOleWindow.cpp Log Message: PyIOleWindow gets upgraded to a core interface! --- NEW FILE: PyIOleWindow.cpp --- // This file implements the IOleWindow Interface and Gateway for Python. // Generated by makegw.py #include "stdafx.h" #include "PythonCOM.h" #include "PythonCOMServer.h" #include "PyIOleWindow.h" // @doc - This file contains autoduck documentation // --------------------------------------------------- // // Interface Implementation PyIOleWindow::PyIOleWindow(IUnknown *pdisp): PyIUnknown(pdisp) { ob_type = &type; } PyIOleWindow::~PyIOleWindow() { } /* static */ IOleWindow *PyIOleWindow::GetI(PyObject *self) { return (IOleWindow *)PyIUnknown::GetI(self); } // @pymethod |PyIOleWindow|GetWindow|Description of GetWindow. PyObject *PyIOleWindow::GetWindow(PyObject *self, PyObject *args) { IOleWindow *pIOW = GetI(self); if ( pIOW == NULL ) return NULL; HWND phwnd; if ( !PyArg_ParseTuple(args, ":GetWindow") ) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIOW->GetWindow( &phwnd ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIOW, IID_IOleWindow); PyObject *pyretval = Py_BuildValue("i", phwnd); return pyretval; } // @pymethod |PyIOleWindow|ContextSensitiveHelp|Description of ContextSensitiveHelp. PyObject *PyIOleWindow::ContextSensitiveHelp(PyObject *self, PyObject *args) { IOleWindow *pIOW = GetI(self); if ( pIOW == NULL ) return NULL; // @pyparm int|fEnterMode||Description for fEnterMode BOOL fEnterMode; if ( !PyArg_ParseTuple(args, "i:ContextSensitiveHelp", &fEnterMode) ) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIOW->ContextSensitiveHelp( fEnterMode ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIOW, IID_IOleWindow); Py_INCREF(Py_None); return Py_None; } // @object PyIOleWindow|Description of the interface static struct PyMethodDef PyIOleWindow_methods[] = { { "GetWindow", PyIOleWindow::GetWindow, 1 }, // @pymeth GetWindow|Description of GetWindow { "ContextSensitiveHelp", PyIOleWindow::ContextSensitiveHelp, 1 }, // @pymeth ContextSensitiveHelp|Description of ContextSensitiveHelp { NULL } }; PyComTypeObject PyIOleWindow::type("PyIOleWindow", &PyIUnknown::type, sizeof(PyIOleWindow), PyIOleWindow_methods, GET_PYCOM_CTOR(PyIOleWindow)); // --------------------------------------------------- // // Gateway Implementation STDMETHODIMP PyGOleWindow::GetWindow( /* [out] */ HWND __RPC_FAR * phwnd) { PY_GATEWAY_METHOD; PyObject *result; HRESULT hr=InvokeViaPolicy("GetWindow", &result); if (FAILED(hr)) return hr; // Process the Python results, and convert back to the real params if (!PyArg_Parse(result, "i" , phwnd)) return PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/); Py_DECREF(result); return hr; } STDMETHODIMP PyGOleWindow::ContextSensitiveHelp( /* [in] */ BOOL fEnterMode) { PY_GATEWAY_METHOD; HRESULT hr=InvokeViaPolicy("ContextSensitiveHelp", NULL, "i", fEnterMode); return hr; } |
From: <mha...@us...> - 2003-10-09 00:26:33
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src/include In directory sc8-pr-cvs1:/tmp/cvs-serv32050/include Added Files: PyIOleWindow.h Log Message: PyIOleWindow gets upgraded to a core interface! --- NEW FILE: PyIOleWindow.h --- // This file declares the IOleWindow Interface and Gateway for Python. // Generated by makegw.py // --------------------------------------------------- // // Interface Declaration class PYCOM_EXPORT PyIOleWindow : public PyIUnknown { public: MAKE_PYCOM_CTOR(PyIOleWindow); static IOleWindow *GetI(PyObject *self); static PyComTypeObject type; // The Python methods static PyObject *GetWindow(PyObject *self, PyObject *args); static PyObject *ContextSensitiveHelp(PyObject *self, PyObject *args); protected: PyIOleWindow(IUnknown *pdisp); ~PyIOleWindow(); }; // --------------------------------------------------- // // Gateway Declaration class PYCOM_EXPORT PyGOleWindow : public PyGatewayBase, public IOleWindow { protected: PyGOleWindow(PyObject *instance) : PyGatewayBase(instance) { ; } PYGATEWAY_MAKE_SUPPORT(PyGOleWindow, IOleWindow, IID_IOleWindow) // IOleWindow STDMETHOD(GetWindow)( HWND __RPC_FAR * phwnd); STDMETHOD(ContextSensitiveHelp)( BOOL fEnterMode); }; |
From: <mha...@us...> - 2003-10-09 00:26:32
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src In directory sc8-pr-cvs1:/tmp/cvs-serv32050 Modified Files: Register.cpp Log Message: PyIOleWindow gets upgraded to a core interface! Index: Register.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/Register.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Register.cpp 8 Oct 2003 04:28:42 -0000 1.9 --- Register.cpp 9 Oct 2003 00:26:23 -0000 1.10 *************** *** 48,51 **** --- 48,52 ---- #include "PyIEnumFORMATETC.h" #include "PyIDataObject.h" + #include "PyIOleWindow.h" //PyObject *CLSIDMapping; // Maps CLSIDs onto PyClassObjects *************** *** 245,248 **** --- 246,250 ---- PYCOM_INTERFACE_IID_ONLY ( Marshal ), PYCOM_INTERFACE_CLIENT_ONLY( Moniker), + PYCOM_INTERFACE_FULL ( OleWindow), PYCOM_INTERFACE_FULL ( Persist), PYCOM_INTERFACE_FULL ( PersistFile), |
From: <mha...@us...> - 2003-10-08 23:54:40
|
Update of /cvsroot/pywin32/pywin32/com In directory sc8-pr-cvs1:/tmp/cvs-serv26842 Modified Files: shell.dsp Log Message: Yet more interfaces. Index: shell.dsp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/shell.dsp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** shell.dsp 7 Oct 2003 05:14:03 -0000 1.7 --- shell.dsp 8 Oct 2003 23:54:36 -0000 1.8 *************** *** 95,98 **** --- 95,102 ---- # Begin Source File + SOURCE=.\win32comext\shell\src\PyIBrowserFrameOptions.cpp + # End Source File + # Begin Source File + SOURCE=.\win32comext\shell\src\PyIContextMenu.cpp # End Source File *************** *** 111,114 **** --- 115,126 ---- # Begin Source File + SOURCE=.\win32comext\shell\src\PyIPersistFolder.cpp + # End Source File + # Begin Source File + + SOURCE=.\win32comext\shell\src\PyIShellBrowser.cpp + # End Source File + # Begin Source File + SOURCE=.\win32comext\shell\src\PyIShellExtInit.cpp # End Source File *************** *** 123,126 **** --- 135,142 ---- # Begin Source File + SOURCE=.\win32comext\shell\src\PyIShellView.cpp + # End Source File + # Begin Source File + SOURCE=.\win32comext\shell\src\shell.cpp # End Source File *************** *** 131,134 **** --- 147,154 ---- # Begin Source File + SOURCE=.\win32comext\shell\src\PyIBrowserFrameOptions.h + # End Source File + # Begin Source File + SOURCE=.\win32comext\shell\src\PyIContextMenu.h # End Source File *************** *** 147,150 **** --- 167,178 ---- # Begin Source File + SOURCE=.\win32comext\shell\src\PyIPersistFolder.h + # End Source File + # Begin Source File + + SOURCE=.\win32comext\shell\src\PyIShellBrowser.h + # End Source File + # Begin Source File + SOURCE=.\win32comext\shell\src\PyIShellExtInit.h # End Source File *************** *** 156,159 **** --- 184,191 ---- SOURCE=.\win32comext\shell\src\PyIShellLink.h + # End Source File + # Begin Source File + + SOURCE=.\win32comext\shell\src\PyIShellView.h # End Source File # Begin Source File |
From: <mha...@us...> - 2003-10-08 23:54:20
|
Update of /cvsroot/pywin32/pywin32/com In directory sc8-pr-cvs1:/tmp/cvs-serv26795 Modified Files: Tag: Python23 win32com.dsp Log Message: IOleWindow gets upgraded to a core interface. Index: win32com.dsp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com.dsp,v retrieving revision 1.22.2.1 retrieving revision 1.22.2.2 diff -C2 -d -r1.22.2.1 -r1.22.2.2 *** win32com.dsp 8 Oct 2003 04:32:38 -0000 1.22.2.1 --- win32com.dsp 8 Oct 2003 23:54:16 -0000 1.22.2.2 *************** *** 5895,5898 **** --- 5895,5917 ---- # Begin Source File + SOURCE=.\win32com\src\extensions\PyIOleWindow.cpp + + !IF "$(CFG)" == "win32com - Win32 Release" + + !ELSEIF "$(CFG)" == "win32com - Win32 Debug" + + !ELSEIF "$(CFG)" == "win32com - Win32 (WCE MIPS) Release" + + !ELSEIF "$(CFG)" == "win32com - Win32 (WCE SH3) Release" + + !ELSEIF "$(CFG)" == "win32com - Win32 (WCE x86em) Debug" + + !ELSEIF "$(CFG)" == "win32com - Win32 (WCE MIPS) Debug" + + !ENDIF + + # End Source File + # Begin Source File + SOURCE=.\win32com\src\extensions\PyIPersist.cpp *************** *** 8387,8390 **** --- 8406,8413 ---- SOURCE=.\win32com\src\include\PyIMoniker.h + # End Source File + # Begin Source File + + SOURCE=.\win32com\src\include\PyIOleWindow.h # End Source File # Begin Source File |
From: <mha...@us...> - 2003-10-08 23:53:54
|
Update of /cvsroot/pywin32/pywin32/com In directory sc8-pr-cvs1:/tmp/cvs-serv26718 Modified Files: axcontrol.dsp Log Message: IOleWindow gets upgraded to a core interface. Index: axcontrol.dsp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/axcontrol.dsp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** axcontrol.dsp 27 Oct 2001 06:37:55 -0000 1.6 --- axcontrol.dsp 8 Oct 2003 23:53:50 -0000 1.7 *************** *** 127,134 **** # Begin Source File - SOURCE=.\win32comext\axcontrol\src\PyIOleWindow.cpp - # End Source File - # Begin Source File - SOURCE=.\win32comext\axcontrol\src\PyISpecifyPropertyPages.cpp # End Source File --- 127,130 ---- |
From: <mha...@us...> - 2003-10-08 23:47:11
|
Update of /cvsroot/pywin32/pywin32/com/win32com/makegw In directory sc8-pr-cvs1:/tmp/cvs-serv25884 Modified Files: makegwparse.py Log Message: Yet more hacks to this hackiest of all tools Index: makegwparse.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/makegw/makegwparse.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** makegwparse.py 8 Oct 2003 04:34:11 -0000 1.10 --- makegwparse.py 8 Oct 2003 23:47:07 -0000 1.11 *************** *** 521,526 **** --- 521,528 ---- "HWND": (ArgFormatterShort, 0), "HMENU": (ArgFormatterShort, 0), + "HOLEMENU": (ArgFormatterShort, 0), "HICON": (ArgFormatterShort, 0), "UINT": (ArgFormatterShort, 0), + "SVSIF": (ArgFormatterShort, 0), "Control": (ArgFormatterInterface, 0, 1), "DataObject": (ArgFormatterInterface, 0, 1), *************** *** 529,533 **** "DataSource": (ArgFormatterInterface, 0, 1), "DataFormat": (ArgFormatterInterface, 0, 1), ! "ITEMIDLIST": (ArgFormatterIDLIST, 0, 1), "const ITEMIDLIST": (ArgFormatterIDLIST, 0, 1), } --- 531,538 ---- "DataSource": (ArgFormatterInterface, 0, 1), "DataFormat": (ArgFormatterInterface, 0, 1), ! "void **": (ArgFormatterInterface, 2, 2), ! "ITEMIDLIST": (ArgFormatterIDLIST, 0, 0), ! "LPITEMIDLIST": (ArgFormatterIDLIST, 0, 1), ! "LPCITEMIDLIST": (ArgFormatterIDLIST, 0, 1), "const ITEMIDLIST": (ArgFormatterIDLIST, 0, 1), } |
From: <mha...@us...> - 2003-10-08 23:46:15
|
Update of /cvsroot/pywin32/pywin32/com/win32com/server In directory sc8-pr-cvs1:/tmp/cvs-serv25751 Modified Files: dispatcher.py Log Message: Make the trace output for InvokeEx much easier to read, and remove the extra \n from the _QI_ trace. Index: dispatcher.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/server/dispatcher.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** dispatcher.py 26 Jul 2003 14:15:32 -0000 1.2 --- dispatcher.py 8 Oct 2003 23:46:10 -0000 1.3 *************** *** 118,122 **** rc = DispatcherBase._QueryInterface_(self, iid) if not rc: ! self._trace_("in %s._QueryInterface_ with unsupported IID %s (%s)\n" % (`self.policy._obj_`, IIDToInterfaceName(iid),iid)) return rc --- 118,122 ---- rc = DispatcherBase._QueryInterface_(self, iid) if not rc: ! self._trace_("in %s._QueryInterface_ with unsupported IID %s (%s)" % (`self.policy._obj_`, IIDToInterfaceName(iid),iid)) return rc *************** *** 134,138 **** def _InvokeEx_(self, dispid, lcid, wFlags, args, kwargs, serviceProvider): ! self._trace_("in _InvokeEx_ with", dispid, lcid, wFlags, args, kwargs, serviceProvider) return DispatcherBase._InvokeEx_(self, dispid, lcid, wFlags, args, kwargs, serviceProvider) --- 134,138 ---- def _InvokeEx_(self, dispid, lcid, wFlags, args, kwargs, serviceProvider): ! self._trace_("in %r._InvokeEx_-%s%r [%x,%s,%r]" % (self.policy._obj_, dispid, args, wFlags, lcid, serviceProvider)) return DispatcherBase._InvokeEx_(self, dispid, lcid, wFlags, args, kwargs, serviceProvider) *************** *** 236,238 **** raise t, v, tb ! DefaultDebugDispatcher = DispatcherWin32trace \ No newline at end of file --- 236,238 ---- raise t, v, tb ! DefaultDebugDispatcher = DispatcherWin32trace |
From: <mha...@us...> - 2003-10-08 23:40:27
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/axcontrol/src In directory sc8-pr-cvs1:/tmp/cvs-serv24822 Modified Files: AXControl.cpp Removed Files: PyIOleWindow.cpp PyIOleWindow.h Log Message: PyIOleWindow gets upgraded to a "core" interface, so the shell package can also derive from it. Index: AXControl.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axcontrol/src/AXControl.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** AXControl.cpp 8 Oct 2003 05:36:00 -0000 1.3 --- AXControl.cpp 8 Oct 2003 23:40:23 -0000 1.4 *************** *** 323,327 **** PYCOM_INTERFACE_IID_ONLY (OleLink), PYCOM_INTERFACE_FULL (OleInPlaceObject), - PYCOM_INTERFACE_FULL (OleWindow), PYCOM_INTERFACE_FULL (ViewObject), PYCOM_INTERFACE_FULL (ViewObject2), --- 323,326 ---- --- PyIOleWindow.cpp DELETED --- --- PyIOleWindow.h DELETED --- |
From: <mha...@us...> - 2003-10-08 23:34:47
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/src In directory sc8-pr-cvs1:/tmp/cvs-serv23882 Modified Files: PyIShellExtInit.cpp shell.cpp shell_pch.h Added Files: PyIBrowserFrameOptions.cpp PyIBrowserFrameOptions.h PyIPersistFolder.cpp PyIPersistFolder.h PyIShellBrowser.cpp PyIShellBrowser.h PyIShellView.cpp PyIShellView.h Log Message: Add ShellBrowser and ShellView interfaces --- NEW FILE: PyIBrowserFrameOptions.cpp --- // This file implements the IBrowserFrameOptions Interface and Gateway for Python. // Generated by makegw.py #include "shell_pch.h" #include "PyIBrowserFrameOptions.h" // @doc - This file contains autoduck documentation // --------------------------------------------------- // // Interface Implementation PyIBrowserFrameOptions::PyIBrowserFrameOptions(IUnknown *pdisp): PyIUnknown(pdisp) { ob_type = &type; } PyIBrowserFrameOptions::~PyIBrowserFrameOptions() { } /* static */ IBrowserFrameOptions *PyIBrowserFrameOptions::GetI(PyObject *self) { return (IBrowserFrameOptions *)PyIUnknown::GetI(self); } // @pymethod |PyIBrowserFrameOptions|GetFrameOptions|Description of GetFrameOptions. PyObject *PyIBrowserFrameOptions::GetFrameOptions(PyObject *self, PyObject *args) { IBrowserFrameOptions *pIBFO = GetI(self); if ( pIBFO == NULL ) return NULL; int dwMask; // @pyparm int|dwMask||Description for dwMask if ( !PyArg_ParseTuple(args, "i:GetFrameOptions", &dwMask)) return NULL; DWORD dwOptions; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIBFO->GetFrameOptions( (BROWSERFRAMEOPTIONS )dwMask, &dwOptions ); PY_INTERFACE_POSTCALL; return PyInt_FromLong(dwOptions); } // @object PyIBrowserFrameOptions|Description of the interface static struct PyMethodDef PyIBrowserFrameOptions_methods[] = { { "GetFrameOptions", PyIBrowserFrameOptions::GetFrameOptions, 1 }, // @pymeth GetFrameOptions|Description of GetFrameOptions { NULL } }; PyComTypeObject PyIBrowserFrameOptions::type("PyIBrowserFrameOptions", &PyIUnknown::type, sizeof(PyIBrowserFrameOptions), PyIBrowserFrameOptions_methods, GET_PYCOM_CTOR(PyIBrowserFrameOptions)); // --------------------------------------------------- // // Gateway Implementation STDMETHODIMP PyGBrowserFrameOptions::GetFrameOptions( /* [in] */ BROWSERFRAMEOPTIONS dwMask, /* [out] */ BROWSERFRAMEOPTIONS * pdwOptions) { PY_GATEWAY_METHOD; PyObject *result; HRESULT hr=InvokeViaPolicy("GetFrameOptions", &result, "i", dwMask); if (FAILED(hr)) return hr; if (PyInt_Check(result)) *pdwOptions = PyInt_AsLong(result); Py_DECREF(result); return hr; } --- NEW FILE: PyIBrowserFrameOptions.h --- // This file declares the IBrowserFrameOptions Interface and Gateway for Python. // Generated by makegw.py // --------------------------------------------------- // // Interface Declaration class PyIBrowserFrameOptions : public PyIUnknown { public: MAKE_PYCOM_CTOR(PyIBrowserFrameOptions); static IBrowserFrameOptions *GetI(PyObject *self); static PyComTypeObject type; // The Python methods static PyObject *GetFrameOptions(PyObject *self, PyObject *args); protected: PyIBrowserFrameOptions(IUnknown *pdisp); ~PyIBrowserFrameOptions(); }; // --------------------------------------------------- // // Gateway Declaration class PyGBrowserFrameOptions : public PyGatewayBase, public IBrowserFrameOptions { protected: PyGBrowserFrameOptions(PyObject *instance) : PyGatewayBase(instance) { ; } PYGATEWAY_MAKE_SUPPORT2(PyGBrowserFrameOptions, IBrowserFrameOptions, IID_IBrowserFrameOptions, PyGatewayBase) // IBrowserFrameOptions STDMETHOD(GetFrameOptions)( BROWSERFRAMEOPTIONS dwMask, BROWSERFRAMEOPTIONS * pdwOptions); }; --- NEW FILE: PyIPersistFolder.cpp --- // This file implements the IPersistFolder Interface and Gateway for Python. // Generated by makegw.py #include "shell_pch.h" #include "PyIPersist.h" #include "PyIPersistFolder.h" // @doc - This file contains autoduck documentation // --------------------------------------------------- // // Interface Implementation PyIPersistFolder::PyIPersistFolder(IUnknown *pdisp): PyIPersist(pdisp) { ob_type = &type; } PyIPersistFolder::~PyIPersistFolder() { } /* static */ IPersistFolder *PyIPersistFolder::GetI(PyObject *self) { return (IPersistFolder *)PyIPersist::GetI(self); } // @pymethod |PyIPersistFolder|Initialize|Description of Initialize. PyObject *PyIPersistFolder::Initialize(PyObject *self, PyObject *args) { IPersistFolder *pIPF = GetI(self); if ( pIPF == NULL ) return NULL; // @pyparm <o PyIDL>|pidl||Description for pidl PyObject *obpidl; LPITEMIDLIST pidl; if ( !PyArg_ParseTuple(args, "O:Initialize", &obpidl) ) return NULL; BOOL bPythonIsHappy = TRUE; if (bPythonIsHappy && !PyObject_AsPIDL(obpidl, &pidl)) bPythonIsHappy = FALSE; if (!bPythonIsHappy) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIPF->Initialize( pidl ); PyObject_FreePIDL(pidl); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIPF, IID_IPersistFolder ); Py_INCREF(Py_None); return Py_None; } // @object PyIPersistFolder|Description of the interface static struct PyMethodDef PyIPersistFolder_methods[] = { { "Initialize", PyIPersistFolder::Initialize, 1 }, // @pymeth Initialize|Description of Initialize { NULL } }; PyComTypeObject PyIPersistFolder::type("PyIPersistFolder", &PyIPersist::type, sizeof(PyIPersistFolder), PyIPersistFolder_methods, GET_PYCOM_CTOR(PyIPersistFolder)); // --------------------------------------------------- // // Gateway Implementation STDMETHODIMP PyGPersistFolder::GetClassID(CLSID __RPC_FAR *pClassID) {return PyGPersist::GetClassID(pClassID);} STDMETHODIMP PyGPersistFolder::Initialize( /* [in] */ LPCITEMIDLIST pidl) { PY_GATEWAY_METHOD; PyObject *obpidl; obpidl = PyObject_FromPIDL(pidl, FALSE); HRESULT hr=InvokeViaPolicy("Initialize", NULL, "O", obpidl); Py_XDECREF(obpidl); return hr; } --- NEW FILE: PyIPersistFolder.h --- // This file declares the IPersistFolder Interface and Gateway for Python. // Generated by makegw.py // --------------------------------------------------- // // Interface Declaration class PyIPersistFolder : public PyIPersist { public: MAKE_PYCOM_CTOR(PyIPersistFolder); static IPersistFolder *GetI(PyObject *self); static PyComTypeObject type; // The Python methods static PyObject *Initialize(PyObject *self, PyObject *args); protected: PyIPersistFolder(IUnknown *pdisp); ~PyIPersistFolder(); }; // --------------------------------------------------- // // Gateway Declaration class PyGPersistFolder : public PyGPersist, public IPersistFolder { protected: PyGPersistFolder(PyObject *instance) : PyGPersist(instance) { ; } PYGATEWAY_MAKE_SUPPORT2(PyGPersistFolder, IPersistFolder, IID_IPersistFolder, PyGPersist) // IPersist STDMETHOD(GetClassID)( /* [out] */ CLSID __RPC_FAR *pClassID); // IPersistFolder STDMETHOD(Initialize)( LPCITEMIDLIST pidl); }; --- NEW FILE: PyIShellBrowser.cpp --- // This file implements the IShellBrowser Interface and Gateway for Python. // Generated by makegw.py #include "shell_pch.h" #include "PyIOleWindow.h" #include "PyIShellBrowser.h" // @doc - This file contains autoduck documentation // --------------------------------------------------- // // Interface Implementation PyIShellBrowser::PyIShellBrowser(IUnknown *pdisp): PyIOleWindow(pdisp) { ob_type = &type; } PyIShellBrowser::~PyIShellBrowser() { } /* static */ IShellBrowser *PyIShellBrowser::GetI(PyObject *self) { return (IShellBrowser *)PyIOleWindow::GetI(self); } /* // @pymethod |PyIShellBrowser|InsertMenusSB|Description of InsertMenusSB. PyObject *PyIShellBrowser::InsertMenusSB(PyObject *self, PyObject *args) { IShellBrowser *pISB = GetI(self); if ( pISB == NULL ) return NULL; // @pyparm int|hmenuShared||Description for hmenuShared // *** The input argument lpMenuWidths of type "LPOLEMENUGROUPWIDTHS" was not processed *** // Please check the conversion function is appropriate and exists! LPOLEMENUGROUPWIDTHS lpMenuWidths; PyObject *oblpMenuWidths; // @pyparm <o PyLPOLEMENUGROUPWIDTHS>|lpMenuWidths||Description for lpMenuWidths INT ihmenuShared; HMENU hmenuShared; if ( !PyArg_ParseTuple(args, "iO:InsertMenusSB", &ihmenuShared, &oblpMenuWidths) ) return NULL; BOOL bPythonIsHappy = TRUE; hmenuShared = ihmenuShared; if (bPythonIsHappy && !PyObject_AsLPOLEMENUGROUPWIDTHS( oblpMenuWidths, &lpMenuWidths )) bPythonIsHappy = FALSE; if (!bPythonIsHappy) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pISB->InsertMenusSB( hmenuShared, lpMenuWidths ); PyObject_FreeLPOLEMENUGROUPWIDTHS(lpMenuWidths); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pISB, IID_IShellBrowser ); // *** The output argument lpMenuWidths of type "LPOLEMENUGROUPWIDTHS" was not processed *** // The type 'LPOLEMENUGROUPWIDTHS' (lpMenuWidths) is unknown. Py_INCREF(Py_None); return Py_None; } */ // @pymethod |PyIShellBrowser|SetMenuSB|Description of SetMenuSB. PyObject *PyIShellBrowser::SetMenuSB(PyObject *self, PyObject *args) { IShellBrowser *pISB = GetI(self); if ( pISB == NULL ) return NULL; // @pyparm int|hmenuShared||Description for hmenuShared // @pyparm int|holemenuRes||Description for holemenuRes // @pyparm HWND|hwndActiveObject||Description for hwndActiveObject INT ihmenuShared; INT iholemenuRes; HMENU hmenuShared; HOLEMENU holemenuRes; HWND hwndActiveObject; if ( !PyArg_ParseTuple(args, "iil:SetMenuSB", &ihmenuShared, &iholemenuRes, &hwndActiveObject) ) return NULL; BOOL bPythonIsHappy = TRUE; hmenuShared = (HMENU)ihmenuShared; holemenuRes = (HOLEMENU)iholemenuRes; if (!bPythonIsHappy) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pISB->SetMenuSB( hmenuShared, holemenuRes, hwndActiveObject ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pISB, IID_IShellBrowser ); Py_INCREF(Py_None); return Py_None; } // @pymethod |PyIShellBrowser|RemoveMenusSB|Description of RemoveMenusSB. PyObject *PyIShellBrowser::RemoveMenusSB(PyObject *self, PyObject *args) { IShellBrowser *pISB = GetI(self); if ( pISB == NULL ) return NULL; // @pyparm int|hmenuShared||Description for hmenuShared INT ihmenuShared; HMENU hmenuShared; if ( !PyArg_ParseTuple(args, "i:RemoveMenusSB", &ihmenuShared) ) return NULL; BOOL bPythonIsHappy = TRUE; hmenuShared = (HMENU)ihmenuShared; if (!bPythonIsHappy) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pISB->RemoveMenusSB( hmenuShared ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pISB, IID_IShellBrowser ); Py_INCREF(Py_None); return Py_None; } // @pymethod |PyIShellBrowser|SetStatusTextSB|Description of SetStatusTextSB. PyObject *PyIShellBrowser::SetStatusTextSB(PyObject *self, PyObject *args) { IShellBrowser *pISB = GetI(self); if ( pISB == NULL ) return NULL; // @pyparm <o unicode>|pszStatusText||Description for pszStatusText PyObject *obpszStatusText; LPOLESTR pszStatusText; if ( !PyArg_ParseTuple(args, "O:SetStatusTextSB", &obpszStatusText) ) return NULL; BOOL bPythonIsHappy = TRUE; if (bPythonIsHappy && !PyWinObject_AsBstr(obpszStatusText, &pszStatusText)) bPythonIsHappy = FALSE; if (!bPythonIsHappy) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pISB->SetStatusTextSB( pszStatusText ); SysFreeString(pszStatusText); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pISB, IID_IShellBrowser ); Py_INCREF(Py_None); return Py_None; } // @pymethod |PyIShellBrowser|EnableModelessSB|Description of EnableModelessSB. PyObject *PyIShellBrowser::EnableModelessSB(PyObject *self, PyObject *args) { IShellBrowser *pISB = GetI(self); if ( pISB == NULL ) return NULL; // @pyparm int|fEnable||Description for fEnable BOOL fEnable; if ( !PyArg_ParseTuple(args, "i:EnableModelessSB", &fEnable) ) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pISB->EnableModelessSB( fEnable ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pISB, IID_IShellBrowser ); Py_INCREF(Py_None); return Py_None; } // @pymethod |PyIShellBrowser|TranslateAcceleratorSB|Description of TranslateAcceleratorSB. PyObject *PyIShellBrowser::TranslateAcceleratorSB(PyObject *self, PyObject *args) { IShellBrowser *pISB = GetI(self); if ( pISB == NULL ) return NULL; // *** The input argument pmsg of type "MSG *" was not processed *** // Please check the conversion function is appropriate and exists! MSG msg; PyObject *obpmsg; // @pyparm <o PyMSG>|pmsg||Description for pmsg // @pyparm int|wID||Description for wID INT iwID; WORD wID; if ( !PyArg_ParseTuple(args, "Oi:TranslateAcceleratorSB", &obpmsg, &iwID) ) return NULL; BOOL bPythonIsHappy = TRUE; if (bPythonIsHappy && !PyObject_AsMSG( obpmsg, &msg )) bPythonIsHappy = FALSE; wID = iwID; if (!bPythonIsHappy) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pISB->TranslateAcceleratorSB( &msg, wID ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pISB, IID_IShellBrowser ); Py_INCREF(Py_None); return Py_None; } // @pymethod |PyIShellBrowser|BrowseObject|Description of BrowseObject. PyObject *PyIShellBrowser::BrowseObject(PyObject *self, PyObject *args) { IShellBrowser *pISB = GetI(self); if ( pISB == NULL ) return NULL; // @pyparm <o PyIDL>|pidl||Description for pidl // @pyparm int|wFlags||Description for wFlags PyObject *obpidl; LPITEMIDLIST pidl; UINT wFlags; if ( !PyArg_ParseTuple(args, "Oi:BrowseObject", &obpidl, &wFlags) ) return NULL; BOOL bPythonIsHappy = TRUE; if (bPythonIsHappy && !PyObject_AsPIDL(obpidl, &pidl, FALSE)) bPythonIsHappy = FALSE; if (!bPythonIsHappy) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pISB->BrowseObject( pidl, wFlags ); PyObject_FreePIDL(pidl); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pISB, IID_IShellBrowser ); Py_INCREF(Py_None); return Py_None; } // @pymethod |PyIShellBrowser|GetViewStateStream|Description of GetViewStateStream. PyObject *PyIShellBrowser::GetViewStateStream(PyObject *self, PyObject *args) { IShellBrowser *pISB = GetI(self); if ( pISB == NULL ) return NULL; // @pyparm int|grfMode||Description for grfMode DWORD grfMode; IStream * ppStrm; if ( !PyArg_ParseTuple(args, "l:GetViewStateStream", &grfMode) ) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pISB->GetViewStateStream( grfMode, &ppStrm ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pISB, IID_IShellBrowser ); return PyCom_PyObjectFromIUnknown(ppStrm, IID_IStream, FALSE); } // @pymethod |PyIShellBrowser|GetControlWindow|Description of GetControlWindow. PyObject *PyIShellBrowser::GetControlWindow(PyObject *self, PyObject *args) { IShellBrowser *pISB = GetI(self); if ( pISB == NULL ) return NULL; // @pyparm int|id||Description for id UINT id; if ( !PyArg_ParseTuple(args, "i:GetControlWindow", &id) ) return NULL; HWND hwnd; HRESULT hr; PY_INTERFACE_PRECALL; hr = pISB->GetControlWindow( id, &hwnd ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pISB, IID_IShellBrowser ); return PyLong_FromVoidPtr(hwnd); } // @pymethod |PyIShellBrowser|SendControlMsg|Description of SendControlMsg. PyObject *PyIShellBrowser::SendControlMsg(PyObject *self, PyObject *args) { IShellBrowser *pISB = GetI(self); if ( pISB == NULL ) return NULL; // @pyparm int|id||Description for id // @pyparm int|uMsg||Description for uMsg // @pyparm int|wParam||Description for wParam // @pyparm long|lParam||Description for lParam UINT id; UINT uMsg; WPARAM wParam; LPARAM lParam; if ( !PyArg_ParseTuple(args, "iiil:SendControlMsg", &id, &uMsg, &wParam, &lParam) ) return NULL; HRESULT hr; LRESULT ret; PY_INTERFACE_PRECALL; hr = pISB->SendControlMsg( id, uMsg, wParam, lParam, &ret ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pISB, IID_IShellBrowser ); return PyInt_FromLong(ret); } // @pymethod |PyIShellBrowser|QueryActiveShellView|Description of QueryActiveShellView. PyObject *PyIShellBrowser::QueryActiveShellView(PyObject *self, PyObject *args) { IShellBrowser *pISB = GetI(self); if ( pISB == NULL ) return NULL; IShellView * ppshv; if ( !PyArg_ParseTuple(args, ":QueryActiveShellView") ) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pISB->QueryActiveShellView( &ppshv ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pISB, IID_IShellBrowser ); return PyCom_PyObjectFromIUnknown(ppshv, IID_IShellView, FALSE); } // @pymethod |PyIShellBrowser|OnViewWindowActive|Description of OnViewWindowActive. PyObject *PyIShellBrowser::OnViewWindowActive(PyObject *self, PyObject *args) { IShellBrowser *pISB = GetI(self); if ( pISB == NULL ) return NULL; // @pyparm <o PyIShellView>|pshv||Description for pshv PyObject *obpshv; IShellView *pshv; if ( !PyArg_ParseTuple(args, "O:OnViewWindowActive", &obpshv) ) return NULL; BOOL bPythonIsHappy = TRUE; if (bPythonIsHappy && !PyCom_InterfaceFromPyInstanceOrObject(obpshv, IID_IShellView, (void **)&pshv, TRUE /* bNoneOK */)) bPythonIsHappy = FALSE; if (!bPythonIsHappy) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pISB->OnViewWindowActive( pshv ); if (pshv) pshv->Release(); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pISB, IID_IShellBrowser ); Py_INCREF(Py_None); return Py_None; } /* // @pymethod |PyIShellBrowser|SetToolbarItems|Description of SetToolbarItems. PyObject *PyIShellBrowser::SetToolbarItems(PyObject *self, PyObject *args) { IShellBrowser *pISB = GetI(self); if ( pISB == NULL ) return NULL; // *** The input argument lpButtons of type "LPTBBUTTONSB" was not processed *** // Please check the conversion function is appropriate and exists! LPTBBUTTONSB lpButtons; PyObject *oblpButtons; // @pyparm <o PyLPTBBUTTONSB>|lpButtons||Description for lpButtons // @pyparm int|nButtons||Description for nButtons // @pyparm int|uFlags||Description for uFlags UINT nButtons; UINT uFlags; if ( !PyArg_ParseTuple(args, "Oii:SetToolbarItems", &oblpButtons, &nButtons, &uFlags) ) return NULL; BOOL bPythonIsHappy = TRUE; if (bPythonIsHappy && !PyObject_AsLPTBBUTTONSB( oblpButtons, &lpButtons )) bPythonIsHappy = FALSE; if (!bPythonIsHappy) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pISB->SetToolbarItems( lpButtons, nButtons, uFlags ); PyObject_FreeLPTBBUTTONSB(lpButtons); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pISB, IID_IShellBrowser ); Py_INCREF(Py_None); return Py_None; } */ // @object PyIShellBrowser|Description of the interface static struct PyMethodDef PyIShellBrowser_methods[] = { // { "InsertMenusSB", PyIShellBrowser::InsertMenusSB, 1 }, // @pymeth InsertMenusSB|Description of InsertMenusSB { "SetMenuSB", PyIShellBrowser::SetMenuSB, 1 }, // @pymeth SetMenuSB|Description of SetMenuSB { "RemoveMenusSB", PyIShellBrowser::RemoveMenusSB, 1 }, // @pymeth RemoveMenusSB|Description of RemoveMenusSB { "SetStatusTextSB", PyIShellBrowser::SetStatusTextSB, 1 }, // @pymeth SetStatusTextSB|Description of SetStatusTextSB { "EnableModelessSB", PyIShellBrowser::EnableModelessSB, 1 }, // @pymeth EnableModelessSB|Description of EnableModelessSB { "TranslateAcceleratorSB", PyIShellBrowser::TranslateAcceleratorSB, 1 }, // @pymeth TranslateAcceleratorSB|Description of TranslateAcceleratorSB { "BrowseObject", PyIShellBrowser::BrowseObject, 1 }, // @pymeth BrowseObject|Description of BrowseObject { "GetViewStateStream", PyIShellBrowser::GetViewStateStream, 1 }, // @pymeth GetViewStateStream|Description of GetViewStateStream { "GetControlWindow", PyIShellBrowser::GetControlWindow, 1 }, // @pymeth GetControlWindow|Description of GetControlWindow { "SendControlMsg", PyIShellBrowser::SendControlMsg, 1 }, // @pymeth SendControlMsg|Description of SendControlMsg { "QueryActiveShellView", PyIShellBrowser::QueryActiveShellView, 1 }, // @pymeth QueryActiveShellView|Description of QueryActiveShellView { "OnViewWindowActive", PyIShellBrowser::OnViewWindowActive, 1 }, // @pymeth OnViewWindowActive|Description of OnViewWindowActive // { "SetToolbarItems", PyIShellBrowser::SetToolbarItems, 1 }, // @pymeth SetToolbarItems|Description of SetToolbarItems { NULL } }; PyComTypeObject PyIShellBrowser::type("PyIShellBrowser", &PyIOleWindow::type, sizeof(PyIShellBrowser), PyIShellBrowser_methods, GET_PYCOM_CTOR(PyIShellBrowser)); // --------------------------------------------------- // // Gateway Implementation STDMETHODIMP PyGShellBrowser::GetWindow(HWND __RPC_FAR * phwnd) {return PyGOleWindow::GetWindow(phwnd);} STDMETHODIMP PyGShellBrowser::ContextSensitiveHelp(BOOL fEnterMode) {return PyGOleWindow::ContextSensitiveHelp(fEnterMode);} STDMETHODIMP PyGShellBrowser::InsertMenusSB( /* [in] */ HMENU hmenuShared, /* [out][in] */ LPOLEMENUGROUPWIDTHS lpMenuWidths) { PY_GATEWAY_METHOD; // *** The input argument lpMenuWidths of type "LPOLEMENUGROUPWIDTHS" was not processed *** // - Please ensure this conversion function exists, and is appropriate // - The type 'LPOLEMENUGROUPWIDTHS' (lpMenuWidths) is unknown. PyObject *oblpMenuWidths = Py_None; //PyObject_FromLPOLEMENUGROUPWIDTHS(lpMenuWidths); Py_INCREF(Py_None); if (oblpMenuWidths==NULL) return PyCom_HandlePythonFailureToCOM(); PyObject *result; HRESULT hr=InvokeViaPolicy("InsertMenusSB", &result, "iO", hmenuShared, oblpMenuWidths); Py_DECREF(oblpMenuWidths); if (FAILED(hr)) return hr; Py_DECREF(result); return hr; } STDMETHODIMP PyGShellBrowser::SetMenuSB( /* [in] */ HMENU hmenuShared, /* [in] */ HOLEMENU holemenuRes, /* [in] */ HWND hwndActiveObject) { PY_GATEWAY_METHOD; HRESULT hr=InvokeViaPolicy("SetMenuSB", NULL, "iil", hmenuShared, holemenuRes, hwndActiveObject); return hr; } STDMETHODIMP PyGShellBrowser::RemoveMenusSB( /* [in] */ HMENU hmenuShared) { PY_GATEWAY_METHOD; HRESULT hr=InvokeViaPolicy("RemoveMenusSB", NULL, "i", hmenuShared); return hr; } STDMETHODIMP PyGShellBrowser::SetStatusTextSB( /* [unique][in] */ LPCOLESTR pszStatusText) { PY_GATEWAY_METHOD; PyObject *obpszStatusText; obpszStatusText = MakeOLECHARToObj(pszStatusText); HRESULT hr=InvokeViaPolicy("SetStatusTextSB", NULL, "O", obpszStatusText); Py_XDECREF(obpszStatusText); return hr; } STDMETHODIMP PyGShellBrowser::EnableModelessSB( /* [in] */ BOOL fEnable) { PY_GATEWAY_METHOD; HRESULT hr=InvokeViaPolicy("EnableModelessSB", NULL, "i", fEnable); return hr; } STDMETHODIMP PyGShellBrowser::TranslateAcceleratorSB( /* [in] */ MSG * pmsg, /* [in] */ WORD wID) { PY_GATEWAY_METHOD; PyObject *obpmsg = PyObject_FromMSG(pmsg); if (obpmsg==NULL) return PyCom_HandlePythonFailureToCOM(); HRESULT hr=InvokeViaPolicy("TranslateAcceleratorSB", NULL, "Oi", obpmsg, wID); Py_DECREF(obpmsg); return hr; } STDMETHODIMP PyGShellBrowser::BrowseObject( /* [in] */ LPCITEMIDLIST pidl, /* [in] */ UINT wFlags) { PY_GATEWAY_METHOD; PyObject *obpidl; obpidl = PyObject_FromPIDL(pidl, FALSE); HRESULT hr=InvokeViaPolicy("BrowseObject", NULL, "Oi", obpidl, wFlags); Py_XDECREF(obpidl); return hr; } STDMETHODIMP PyGShellBrowser::GetViewStateStream( /* [in] */ DWORD grfMode, /* [out] */ IStream ** ppStrm) { PY_GATEWAY_METHOD; PyObject *result; HRESULT hr=InvokeViaPolicy("GetViewStateStream", &result, "l", grfMode); if (FAILED(hr)) return hr; // Process the Python results, and convert back to the real params PyObject *obppStrm; if (!PyArg_Parse(result, "O" , &obppStrm)) return PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/); BOOL bPythonIsHappy = TRUE; if (bPythonIsHappy && !PyCom_InterfaceFromPyInstanceOrObject(obppStrm, IID_IStream, (void **)ppStrm, TRUE /* bNoneOK */)) bPythonIsHappy = FALSE; if (!bPythonIsHappy) hr = PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/); Py_DECREF(result); return hr; } STDMETHODIMP PyGShellBrowser::GetControlWindow( /* [in] */ UINT id, /* [out] */ HWND * phwnd) { PY_GATEWAY_METHOD; PyObject *result; HRESULT hr=InvokeViaPolicy("GetControlWindow", &result, "i", id); if (FAILED(hr)) return hr; // Process the Python results, and convert back to the real params if (PyInt_Check(result) || PyLong_Check(result)) *phwnd = (HWND)PyInt_AsLong(result); Py_DECREF(result); return hr; } STDMETHODIMP PyGShellBrowser::SendControlMsg( /* [in] */ UINT id, /* [in] */ UINT uMsg, /* [in] */ WPARAM wParam, /* [in] */ LPARAM lParam, /* [in] */ LRESULT * pret) { PY_GATEWAY_METHOD; PyObject *result; HRESULT hr=InvokeViaPolicy("SendControlMsg", &result, "iiil", id, uMsg, wParam, lParam); if (PyInt_Check(result) || PyLong_Check(result)) *pret = PyInt_AsLong(result); Py_DECREF(result); return hr; } STDMETHODIMP PyGShellBrowser::QueryActiveShellView( /* [out] */ IShellView ** ppshv) { PY_GATEWAY_METHOD; PyObject *result; HRESULT hr=InvokeViaPolicy("QueryActiveShellView", &result); if (FAILED(hr)) return hr; // Process the Python results, and convert back to the real params PyObject *obppshv; if (!PyArg_Parse(result, "O" , &obppshv)) return PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/); BOOL bPythonIsHappy = TRUE; if (bPythonIsHappy && !PyCom_InterfaceFromPyInstanceOrObject(obppshv, IID_IShellView, (void **)ppshv, TRUE /* bNoneOK */)) bPythonIsHappy = FALSE; if (!bPythonIsHappy) hr = PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/); Py_DECREF(result); return hr; } STDMETHODIMP PyGShellBrowser::OnViewWindowActive( /* [in] */ IShellView * pshv) { PY_GATEWAY_METHOD; PyObject *obpshv; obpshv = PyCom_PyObjectFromIUnknown(pshv, IID_IShellView, TRUE); HRESULT hr=InvokeViaPolicy("OnViewWindowActive", NULL, "O", obpshv); Py_XDECREF(obpshv); return hr; } STDMETHODIMP PyGShellBrowser::SetToolbarItems( /* [in] */ LPTBBUTTONSB lpButtons, /* [in] */ UINT nButtons, /* [in] */ UINT uFlags) { PY_GATEWAY_METHOD; // *** The input argument lpButtons of type "LPTBBUTTONSB" was not processed *** // - Please ensure this conversion function exists, and is appropriate // - The type 'LPTBBUTTONSB' (lpButtons) is unknown. PyObject *oblpButtons = Py_None; //PyObject_FromLPTBBUTTONSB(lpButtons); Py_INCREF(Py_None); if (oblpButtons==NULL) return PyCom_HandlePythonFailureToCOM(); HRESULT hr=InvokeViaPolicy("SetToolbarItems", NULL, "Oii", oblpButtons, nButtons, uFlags); Py_DECREF(oblpButtons); return hr; } --- NEW FILE: PyIShellBrowser.h --- // This file declares the IShellBrowser Interface and Gateway for Python. // Generated by makegw.py // --------------------------------------------------- // // Interface Declaration class PyIShellBrowser : public PyIOleWindow { public: MAKE_PYCOM_CTOR(PyIShellBrowser); static IShellBrowser *GetI(PyObject *self); static PyComTypeObject type; // The Python methods static PyObject *InsertMenusSB(PyObject *self, PyObject *args); static PyObject *SetMenuSB(PyObject *self, PyObject *args); static PyObject *RemoveMenusSB(PyObject *self, PyObject *args); static PyObject *SetStatusTextSB(PyObject *self, PyObject *args); static PyObject *EnableModelessSB(PyObject *self, PyObject *args); static PyObject *TranslateAcceleratorSB(PyObject *self, PyObject *args); static PyObject *BrowseObject(PyObject *self, PyObject *args); static PyObject *GetViewStateStream(PyObject *self, PyObject *args); static PyObject *GetControlWindow(PyObject *self, PyObject *args); static PyObject *SendControlMsg(PyObject *self, PyObject *args); static PyObject *QueryActiveShellView(PyObject *self, PyObject *args); static PyObject *OnViewWindowActive(PyObject *self, PyObject *args); static PyObject *SetToolbarItems(PyObject *self, PyObject *args); protected: PyIShellBrowser(IUnknown *pdisp); ~PyIShellBrowser(); }; // --------------------------------------------------- // // Gateway Declaration class PyGShellBrowser : public PyGOleWindow, public IShellBrowser { protected: PyGShellBrowser(PyObject *instance) : PyGOleWindow(instance) { ; } PYGATEWAY_MAKE_SUPPORT2(PyGShellBrowser, IShellBrowser, IID_IShellBrowser, PyGOleWindow) // IOleWindow STDMETHOD(GetWindow)( HWND __RPC_FAR * phwnd); STDMETHOD(ContextSensitiveHelp)( BOOL fEnterMode); // IShellBrowser STDMETHOD(InsertMenusSB)( HMENU hmenuShared, LPOLEMENUGROUPWIDTHS lpMenuWidths); STDMETHOD(SetMenuSB)( HMENU hmenuShared, HOLEMENU holemenuRes, HWND hwndActiveObject); STDMETHOD(RemoveMenusSB)( HMENU hmenuShared); STDMETHOD(SetStatusTextSB)( LPCOLESTR pszStatusText); STDMETHOD(EnableModelessSB)( BOOL fEnable); STDMETHOD(TranslateAcceleratorSB)( MSG * pmsg, WORD wID); STDMETHOD(BrowseObject)( LPCITEMIDLIST pidl, UINT wFlags); STDMETHOD(GetViewStateStream)( DWORD grfMode, IStream ** ppStrm); STDMETHOD(GetControlWindow)( UINT id, HWND * phwnd); STDMETHOD(SendControlMsg)( UINT id, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT * pret); STDMETHOD(QueryActiveShellView)( IShellView ** ppshv); STDMETHOD(OnViewWindowActive)( IShellView * pshv); STDMETHOD(SetToolbarItems)( LPTBBUTTONSB lpButtons, UINT nButtons, UINT uFlags); }; --- NEW FILE: PyIShellView.cpp --- // This file implements the IShellView Interface and Gateway for Python. // Generated by makegw.py #include "shell_pch.h" #include "PyIOleWindow.h" #include "PyIShellView.h" // @doc - This file contains autoduck documentation // --------------------------------------------------- // // Interface Implementation PyIShellView::PyIShellView(IUnknown *pdisp): PyIOleWindow(pdisp) { ob_type = &type; } PyIShellView::~PyIShellView() { } /* static */ IShellView *PyIShellView::GetI(PyObject *self) { return (IShellView *)PyIOleWindow::GetI(self); } // @pymethod |PyIShellView|TranslateAccelerator|Description of TranslateAccelerator. PyObject *PyIShellView::TranslateAccelerator(PyObject *self, PyObject *args) { IShellView *pISV = GetI(self); if ( pISV == NULL ) return NULL; MSG msg; PyObject *obpmsg; // @pyparm tuple|pmsg||Description for pmsg if ( !PyArg_ParseTuple(args, "O:TranslateAccelerator", &obpmsg) ) return NULL; BOOL bPythonIsHappy = TRUE; if (bPythonIsHappy && !PyObject_AsMSG( obpmsg, &msg )) bPythonIsHappy = FALSE; if (!bPythonIsHappy) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pISV->TranslateAccelerator( &msg ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pISV, IID_IShellView ); return PyInt_FromLong(hr); } // @pymethod |PyIShellView|EnableModeless|Description of EnableModeless. PyObject *PyIShellView::EnableModeless(PyObject *self, PyObject *args) { IShellView *pISV = GetI(self); if ( pISV == NULL ) return NULL; // @pyparm int|fEnable||Description for fEnable BOOL fEnable; if ( !PyArg_ParseTuple(args, "i:EnableModeless", &fEnable) ) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pISV->EnableModeless( fEnable ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pISV, IID_IShellView ); Py_INCREF(Py_None); return Py_None; } // @pymethod |PyIShellView|UIActivate|Description of UIActivate. PyObject *PyIShellView::UIActivate(PyObject *self, PyObject *args) { IShellView *pISV = GetI(self); if ( pISV == NULL ) return NULL; // @pyparm int|uState||Description for uState UINT uState; if ( !PyArg_ParseTuple(args, "i:UIActivate", &uState) ) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pISV->UIActivate( uState ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pISV, IID_IShellView ); Py_INCREF(Py_None); return Py_None; } // @pymethod |PyIShellView|Refresh|Description of Refresh. PyObject *PyIShellView::Refresh(PyObject *self, PyObject *args) { IShellView *pISV = GetI(self); if ( pISV == NULL ) return NULL; if ( !PyArg_ParseTuple(args, ":Refresh") ) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pISV->Refresh( ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pISV, IID_IShellView ); Py_INCREF(Py_None); return Py_None; } // @pymethod |PyIShellView|CreateViewWindow|Description of CreateViewWindow. PyObject *PyIShellView::CreateViewWindow(PyObject *self, PyObject *args) { IShellView *pISV = GetI(self); if ( pISV == NULL ) return NULL; // @pyparm <o PyIShellView>|psvPrevious||Description for psvPrevious FOLDERSETTINGS fs; PyObject *obpfs; // @pyparm (int, int)|pfs||Description for pfs // @pyparm <o PyIShellBrowser>|psb||Description for psb RECT rcView; PyObject *obprcView; // @pyparm (int, int, int, int)|prcView||Description for prcView PyObject *obpsvPrevious; PyObject *obpsb; IShellView *psvPrevious; IShellBrowser *psb; if ( !PyArg_ParseTuple(args, "OOOO:CreateViewWindow", &obpsvPrevious, &obpfs, &obpsb, &obprcView) ) return NULL; BOOL bPythonIsHappy = TRUE; if (bPythonIsHappy && !PyCom_InterfaceFromPyInstanceOrObject(obpsvPrevious, IID_IShellView, (void **)&psvPrevious, TRUE /* bNoneOK */)) bPythonIsHappy = FALSE; if (bPythonIsHappy && !PyObject_AsFOLDERSETTINGS( obpfs, &fs )) bPythonIsHappy = FALSE; if (bPythonIsHappy && !PyCom_InterfaceFromPyInstanceOrObject(obpsb, IID_IShellBrowser, (void **)&psb, TRUE /* bNoneOK */)) bPythonIsHappy = FALSE; if (bPythonIsHappy && !PyObject_AsRECT( obprcView, &rcView )) bPythonIsHappy = FALSE; if (!bPythonIsHappy) return NULL; HWND hWnd; HRESULT hr; PY_INTERFACE_PRECALL; hr = pISV->CreateViewWindow( psvPrevious, &fs, psb, &rcView, &hWnd ); if (psvPrevious) psvPrevious->Release(); if (psb) psb->Release(); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pISV, IID_IShellView ); return PyLong_FromVoidPtr(hWnd); } // @pymethod |PyIShellView|DestroyViewWindow|Description of DestroyViewWindow. PyObject *PyIShellView::DestroyViewWindow(PyObject *self, PyObject *args) { IShellView *pISV = GetI(self); if ( pISV == NULL ) return NULL; if ( !PyArg_ParseTuple(args, ":DestroyViewWindow") ) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pISV->DestroyViewWindow( ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pISV, IID_IShellView ); Py_INCREF(Py_None); return Py_None; } // @pymethod |PyIShellView|GetCurrentInfo|Description of GetCurrentInfo. PyObject *PyIShellView::GetCurrentInfo(PyObject *self, PyObject *args) { IShellView *pISV = GetI(self); if ( pISV == NULL ) return NULL; FOLDERSETTINGS fs; if ( !PyArg_ParseTuple(args, ":GetCurrentInfo") ) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pISV->GetCurrentInfo(&fs); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pISV, IID_IShellView ); return PyObject_FromFOLDERSETTINGS(&fs); } /* // @pymethod |PyIShellView|AddPropertySheetPages|Description of AddPropertySheetPages. PyObject *PyIShellView::AddPropertySheetPages(PyObject *self, PyObject *args) { IShellView *pISV = GetI(self); if ( pISV == NULL ) return NULL; // @pyparm int|dwReserved||Description for dwReserved // *** The input argument pfn of type "LPFNSVADDPROPSHEETPAGE" was not processed *** // Please check the conversion function is appropriate and exists! LPFNSVADDPROPSHEETPAGE pfn; PyObject *obpfn; // @pyparm <o PyLPFNSVADDPROPSHEETPAGE>|pfn||Description for pfn // @pyparm long|lparam||Description for lparam DWORD dwReserved; LPARAM lparam; if ( !PyArg_ParseTuple(args, "lOl:AddPropertySheetPages", &dwReserved, &obpfn, &lparam) ) return NULL; BOOL bPythonIsHappy = TRUE; if (bPythonIsHappy && !PyObject_AsLPFNSVADDPROPSHEETPAGE( obpfn, &pfn )) bPythonIsHappy = FALSE; if (!bPythonIsHappy) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pISV->AddPropertySheetPages( dwReserved, pfn, lparam ); PyObject_FreeLPFNSVADDPROPSHEETPAGE(pfn); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pISV, IID_IShellView ); Py_INCREF(Py_None); return Py_None; } */ // @pymethod |PyIShellView|SaveViewState|Description of SaveViewState. PyObject *PyIShellView::SaveViewState(PyObject *self, PyObject *args) { IShellView *pISV = GetI(self); if ( pISV == NULL ) return NULL; if ( !PyArg_ParseTuple(args, ":SaveViewState") ) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pISV->SaveViewState( ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pISV, IID_IShellView ); Py_INCREF(Py_None); return Py_None; } // @pymethod |PyIShellView|SelectItem|Description of SelectItem. PyObject *PyIShellView::SelectItem(PyObject *self, PyObject *args) { IShellView *pISV = GetI(self); if ( pISV == NULL ) return NULL; // @pyparm <o PyIDL>|pidlItem||Description for pidlItem // @pyparm int|uFlags||Description for uFlags PyObject *obpidlItem; INT iuFlags; LPITEMIDLIST pidlItem; SVSIF uFlags; if ( !PyArg_ParseTuple(args, "Oi:SelectItem", &obpidlItem, &iuFlags) ) return NULL; BOOL bPythonIsHappy = TRUE; if (bPythonIsHappy && !PyObject_AsPIDL(obpidlItem, &pidlItem)) bPythonIsHappy = FALSE; uFlags = iuFlags; if (!bPythonIsHappy) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pISV->SelectItem( pidlItem, uFlags ); PyObject_FreePIDL(pidlItem); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pISV, IID_IShellView ); Py_INCREF(Py_None); return Py_None; } // @pymethod |PyIShellView|GetItemObject|Description of GetItemObject. PyObject *PyIShellView::GetItemObject(PyObject *self, PyObject *args) { IShellView *pISV = GetI(self); if ( pISV == NULL ) return NULL; // @pyparm int|uItem||Description for uItem // @pyparm <o PyIID>|riid||Description for riid PyObject *obriid; UINT uItem; IID riid; IUnknown *ppv; if ( !PyArg_ParseTuple(args, "iO:GetItemObject", &uItem, &obriid) ) return NULL; BOOL bPythonIsHappy = TRUE; if (!PyWinObject_AsIID(obriid, &riid)) bPythonIsHappy = FALSE; if (!bPythonIsHappy) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pISV->GetItemObject( uItem, riid, (void **)&ppv ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pISV, IID_IShellView ); PyObject *obppv; obppv = PyCom_PyObjectFromIUnknown(ppv, riid, FALSE); PyObject *pyretval = Py_BuildValue("O", obppv); Py_XDECREF(obppv); return pyretval; } // @object PyIShellView|Description of the interface static struct PyMethodDef PyIShellView_methods[] = { { "TranslateAccelerator", PyIShellView::TranslateAccelerator, 1 }, // @pymeth TranslateAccelerator|Description of TranslateAccelerator { "EnableModeless", PyIShellView::EnableModeless, 1 }, // @pymeth EnableModeless|Description of EnableModeless { "UIActivate", PyIShellView::UIActivate, 1 }, // @pymeth UIActivate|Description of UIActivate { "Refresh", PyIShellView::Refresh, 1 }, // @pymeth Refresh|Description of Refresh { "CreateViewWindow", PyIShellView::CreateViewWindow, 1 }, // @pymeth CreateViewWindow|Description of CreateViewWindow { "DestroyViewWindow", PyIShellView::DestroyViewWindow, 1 }, // @pymeth DestroyViewWindow|Description of DestroyViewWindow { "GetCurrentInfo", PyIShellView::GetCurrentInfo, 1 }, // @pymeth GetCurrentInfo|Description of GetCurrentInfo // { "AddPropertySheetPages", PyIShellView::AddPropertySheetPages, 1 }, // @pymeth AddPropertySheetPages|Description of AddPropertySheetPages { "SaveViewState", PyIShellView::SaveViewState, 1 }, // @pymeth SaveViewState|Description of SaveViewState { "SelectItem", PyIShellView::SelectItem, 1 }, // @pymeth SelectItem|Description of SelectItem { "GetItemObject", PyIShellView::GetItemObject, 1 }, // @pymeth GetItemObject|Description of GetItemObject { NULL } }; PyComTypeObject PyIShellView::type("PyIShellView", &PyIOleWindow::type, sizeof(PyIShellView), PyIShellView_methods, GET_PYCOM_CTOR(PyIShellView)); // --------------------------------------------------- // // Gateway Implementation STDMETHODIMP PyGShellView::GetWindow(HWND __RPC_FAR * phwnd) {return PyGOleWindow::GetWindow(phwnd);} STDMETHODIMP PyGShellView::ContextSensitiveHelp(BOOL fEnterMode) {return PyGOleWindow::ContextSensitiveHelp(fEnterMode);} STDMETHODIMP PyGShellView::TranslateAccelerator( /* [in] */ MSG * pmsg) { PY_GATEWAY_METHOD; PyObject *obpmsg = PyObject_FromMSG(pmsg); if (obpmsg==NULL) return PyCom_HandlePythonFailureToCOM(); PyObject *result; HRESULT hr=InvokeViaPolicy("TranslateAccelerator", &result, "(O)", obpmsg); Py_DECREF(obpmsg); if (FAILED(hr)) return hr; // Process the Python results, and convert back to the real params if (PyInt_Check(result) || PyLong_Check(result)) hr = PyInt_AsLong(result); Py_DECREF(result); return hr; } STDMETHODIMP PyGShellView::EnableModeless( /* [in] */ BOOL fEnable) { PY_GATEWAY_METHOD; HRESULT hr=InvokeViaPolicy("EnableModeless", NULL, "i", fEnable); return hr; } STDMETHODIMP PyGShellView::UIActivate( /* [in] */ UINT uState) { PY_GATEWAY_METHOD; HRESULT hr=InvokeViaPolicy("UIActivate", NULL, "i", uState); return hr; } STDMETHODIMP PyGShellView::Refresh( void) { PY_GATEWAY_METHOD; HRESULT hr=InvokeViaPolicy("Refresh", NULL); return hr; } STDMETHODIMP PyGShellView::CreateViewWindow( /* [in] */ IShellView * psvPrevious, /* [in] */ LPCFOLDERSETTINGS pfs, /* [in] */ IShellBrowser * psb, /* [out] */ RECT * prcView, /* [out] */ HWND * phWnd) { PY_GATEWAY_METHOD; PyObject *obpfs = PyObject_FromFOLDERSETTINGS(pfs); if (obpfs==NULL) return PyCom_HandlePythonFailureToCOM(); PyObject *obrect = PyObject_FromRECT(prcView); if (obrect==NULL) return PyCom_HandlePythonFailureToCOM(); PyObject *obpsvPrevious; PyObject *obpsb; obpsvPrevious = PyCom_PyObjectFromIUnknown(psvPrevious, IID_IShellView, TRUE); obpsb = PyCom_PyObjectFromIUnknown(psb, IID_IShellBrowser, TRUE); PyObject *result; HRESULT hr=InvokeViaPolicy("CreateViewWindow", &result, "OOOO", obpsvPrevious, obpfs, obpsb, obrect); Py_XDECREF(obpsvPrevious); Py_DECREF(obpfs); Py_XDECREF(obpsb); Py_DECREF(obrect); if (FAILED(hr)) return hr; // Process the Python results, and convert back to the real params if (PyInt_Check(result) || PyLong_Check(result)) *phWnd = (HWND)PyInt_AsLong(result); Py_DECREF(result); return hr; } STDMETHODIMP PyGShellView::DestroyViewWindow( void) { PY_GATEWAY_METHOD; HRESULT hr=InvokeViaPolicy("DestroyViewWindow", NULL); return hr; } STDMETHODIMP PyGShellView::GetCurrentInfo( /* [out] */ LPFOLDERSETTINGS pfs) { PY_GATEWAY_METHOD; PyObject *result; HRESULT hr=InvokeViaPolicy("GetCurrentInfo", &result); if (FAILED(hr)) return hr; // Process the Python results, and convert back to the real params PyObject_AsFOLDERSETTINGS(result, pfs); return PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/); } STDMETHODIMP PyGShellView::AddPropertySheetPages( /* [in] */ DWORD dwReserved, /* [in] */ LPFNSVADDPROPSHEETPAGE pfn, /* [in] */ LPARAM lparam) { PY_GATEWAY_METHOD; // *** The input argument pfn of type "LPFNSVADDPROPSHEETPAGE" was not processed *** // - Please ensure this conversion function exists, and is appropriate // - The type 'LPFNSVADDPROPSHEETPAGE' (pfn) is unknown. PyObject *obpfn = Py_None; Py_INCREF(Py_None); if (obpfn==NULL) return PyCom_HandlePythonFailureToCOM(); HRESULT hr=InvokeViaPolicy("AddPropertySheetPages", NULL, "lOl", dwReserved, obpfn, lparam); Py_DECREF(obpfn); return hr; } STDMETHODIMP PyGShellView::SaveViewState( void) { PY_GATEWAY_METHOD; HRESULT hr=InvokeViaPolicy("SaveViewState", NULL); return hr; } STDMETHODIMP PyGShellView::SelectItem( /* [in] */ LPCITEMIDLIST pidlItem, /* [in] */ SVSIF uFlags) { PY_GATEWAY_METHOD; PyObject *obpidlItem; obpidlItem = PyObject_FromPIDL(pidlItem, FALSE); HRESULT hr=InvokeViaPolicy("SelectItem", NULL, "Oi", obpidlItem, uFlags); Py_XDECREF(obpidlItem); return hr; } STDMETHODIMP PyGShellView::GetItemObject( /* [in] */ UINT uItem, /* [in] */ REFIID riid, /* [iid_is][out] */ void ** ppv) { PY_GATEWAY_METHOD; *ppv = NULL; PyObject *obriid; obriid = PyWinObject_FromIID(riid); PyObject *result; HRESULT hr=InvokeViaPolicy("GetItemObject", &result, "iO", uItem, obriid); Py_XDECREF(obriid); if (FAILED(hr)) return hr; // Process the Python results, and convert back to the real params PyObject *obppv; if (!PyArg_Parse(result, "O" , &obppv)) return PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/); BOOL bPythonIsHappy = TRUE; if (bPythonIsHappy && !PyCom_InterfaceFromPyInstanceOrObject(obppv, riid, ppv, FALSE/* bNoneOK */)) bPythonIsHappy = FALSE; if (!bPythonIsHappy) hr = PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/); Py_DECREF(result); return hr; } --- NEW FILE: PyIShellView.h --- // This file declares the IShellView Interface and Gateway for Python. // Generated by makegw.py // --------------------------------------------------- // // Interface Declaration class PyIShellView : public PyIOleWindow { public: MAKE_PYCOM_CTOR(PyIShellView); static IShellView *GetI(PyObject *self); static PyComTypeObject type; // The Python methods static PyObject *TranslateAccelerator(PyObject *self, PyObject *args); static PyObject *EnableModeless(PyObject *self, PyObject *args); static PyObject *UIActivate(PyObject *self, PyObject *args); static PyObject *Refresh(PyObject *self, PyObject *args); static PyObject *CreateViewWindow(PyObject *self, PyObject *args); static PyObject *DestroyViewWindow(PyObject *self, PyObject *args); static PyObject *GetCurrentInfo(PyObject *self, PyObject *args); static PyObject *AddPropertySheetPages(PyObject *self, PyObject *args); static PyObject *SaveViewState(PyObject *self, PyObject *args); static PyObject *SelectItem(PyObject *self, PyObject *args); static PyObject *GetItemObject(PyObject *self, PyObject *args); protected: PyIShellView(IUnknown *pdisp); ~PyIShellView(); }; // --------------------------------------------------- // // Gateway Declaration class PyGShellView : public PyGOleWindow, public IShellView { protected: PyGShellView(PyObject *instance) : PyGOleWindow(instance) { ; } PYGATEWAY_MAKE_SUPPORT2(PyGShellView, IShellView, IID_IShellView, PyGOleWindow) // IOleWindow STDMETHOD(GetWindow)( HWND __RPC_FAR * phwnd); STDMETHOD(ContextSensitiveHelp)( BOOL fEnterMode); // IShellView STDMETHOD(TranslateAccelerator)( MSG * pmsg); STDMETHOD(EnableModeless)( BOOL fEnable); STDMETHOD(UIActivate)( UINT uState); STDMETHOD(Refresh)( void); STDMETHOD(CreateViewWindow)( IShellView * psvPrevious, LPCFOLDERSETTINGS pfs, IShellBrowser * psb, RECT * prcView, HWND * phWnd); STDMETHOD(DestroyViewWindow)( void); STDMETHOD(GetCurrentInfo)( LPFOLDERSETTINGS pfs); STDMETHOD(AddPropertySheetPages)( DWORD dwReserved, LPFNSVADDPROPSHEETPAGE pfn, LPARAM lparam); STDMETHOD(SaveViewState)( void); STDMETHOD(SelectItem)( LPCITEMIDLIST pidlItem, SVSIF uFlags); STDMETHOD(GetItemObject)( UINT uItem, REFIID riid, void ** ppv); }; Index: PyIShellExtInit.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/PyIShellExtInit.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PyIShellExtInit.cpp 6 Oct 2003 12:47:57 -0000 1.1 --- PyIShellExtInit.cpp 8 Oct 2003 23:34:41 -0000 1.2 *************** *** 32,36 **** return NULL; // @pyparm <o PyIDL>|pFolder||Description for pFolder ! // @pyparm <o PyIDataObject *>|pDataObject||Description for pDataObject // @pyparm <o PyHANDLE>|hkey||Description for hkey PyObject *obpFolder; --- 32,36 ---- return NULL; // @pyparm <o PyIDL>|pFolder||Description for pFolder ! // @pyparm <o PyIDataObject>|pDataObject||Description for pDataObject // @pyparm <o PyHANDLE>|hkey||Description for hkey PyObject *obpFolder; Index: shell.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/shell.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** shell.cpp 7 Oct 2003 05:13:22 -0000 1.8 --- shell.cpp 8 Oct 2003 23:34:41 -0000 1.9 *************** *** 21,24 **** --- 21,31 ---- #include "PyIEnumIDList.h" #include "PyICopyHook.h" + #include "PyIOleWindow.h" + #include "PyIShellView.h" + #include "PyIShellBrowser.h" + #include "PyIBrowserFrameOptions.h" + #include "PyIPersist.h" + #include "PyIPersistFolder.h" + #include "PythonCOMRegister.h" // For simpler registration of IIDs etc. *************** *** 253,256 **** --- 260,290 ---- } + 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) + { + return Py_BuildValue("iiiii(ii)", msg->hwnd,msg->message,msg->wParam,msg->lParam,msg->time,msg->pt.x,msg->pt.y); + } + + BOOL PyObject_AsFOLDERSETTINGS( PyObject *ob, FOLDERSETTINGS *pf) + { + return PyArg_ParseTuple(ob, "ii", &pf->ViewMode, &pf->fFlags); + } + PyObject *PyObject_FromFOLDERSETTINGS( const FOLDERSETTINGS *pf) + { + return Py_BuildValue("ii", pf->ViewMode, pf->fFlags); + } + + BOOL PyObject_AsRECT( PyObject *ob, RECT *r) + { + return PyArg_ParseTuple(ob, "iiii", &r->left, &r->top, &r->right, &r->bottom); + } + PyObject *PyObject_FromRECT(const RECT *r) + { + return Py_BuildValue("iiii", r->left, r->top, r->right, r->bottom); + } + ////////////////////////////////////////////////// // *************** *** 669,673 **** --- 703,711 ---- PYCOM_INTERFACE_FULL(ShellExtInit), PYCOM_INTERFACE_FULL(ShellFolder), + PYCOM_INTERFACE_FULL(ShellView), + PYCOM_INTERFACE_FULL(ShellBrowser), PYCOM_INTERFACE_FULL(EnumIDList), + PYCOM_INTERFACE_FULL(BrowserFrameOptions), + PYCOM_INTERFACE_FULL(PersistFolder), // IID_ICopyHook doesn't exist - hack it up { &IID_IShellCopyHook, "IShellCopyHook", "IID_IShellCopyHook", &PyICopyHook::type, GET_PYGATEWAY_CTOR(PyGCopyHook) }, Index: shell_pch.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/shell_pch.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** shell_pch.h 6 Oct 2003 12:47:57 -0000 1.2 --- shell_pch.h 8 Oct 2003 23:34:41 -0000 1.3 *************** *** 24,25 **** --- 24,34 ---- void PyObject_FreeSTRRET(STRRET &); PyObject *PyObject_FromSTRRET(STRRET *pci, ITEMIDLIST *pidl, BOOL bFree); + + BOOL PyObject_AsMSG( PyObject *obpmsg, MSG *msg ); + PyObject *PyObject_FromMSG(const MSG *msg); + + BOOL PyObject_AsFOLDERSETTINGS( PyObject *ob, FOLDERSETTINGS *pf); + PyObject *PyObject_FromFOLDERSETTINGS( const FOLDERSETTINGS *pf); + + BOOL PyObject_AsRECT( PyObject *ob, RECT *r); + PyObject *PyObject_FromRECT(const RECT *r); |
From: <mha...@us...> - 2003-10-08 23:33:24
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/demos/servers In directory sc8-pr-cvs1:/tmp/cvs-serv23533 Added Files: shell_view.py Log Message: First cut at a shell view implementation, which is very very sparse, but does create a window! --- NEW FILE: shell_view.py --- # A sample shell namespace view # To demostrate: # * Execute this script to register the namespace. # * Open Windows Explorer # * Note the new folder hanging off "My Computer" # This is still incomplete - but we *do* create a view window - we just do # nothing with it. import sys, os import pythoncom from win32com.shell import shell, shellcon import win32gui import win32con import winerror from win32com.server.util import wrap debug=1 if debug: import win32com.server.dispatcher defaultDispatcher = win32com.server.dispatcher.DefaultDebugDispatcher IOleWindow_Methods = "GetWindow ContextSensitiveHelp".split() IShellView_Methods = IOleWindow_Methods + \ """TranslateAccelerator EnableModeless UIActivate Refresh CreateViewWindow DestroyViewWindow GetCurrentInfo AddPropertySheetPages SaveViewState SelectItem GetItemObject""".split() IShellFolder_Methods = """ParseDisplayName EnumObjects BindToObject BindToStorage CompareIDs CreateViewObject GetAttributesOf GetUIObjectOf GetDisplayNameOf SetNameOf""".split() IBrowserFrame_Methods = ["GetFrameOptions"] IPersist_Methods = ["GetClassID"] IPersistFolder_Methods = IPersist_Methods + ["Initialize"] # Our shell extension. class ShellView: # _reg_progid_ = "Python.ShellExtension.View" # _reg_desc_ = "Python Sample Shell Extension (View)" _public_methods_ = IShellView_Methods _com_interfaces_ = [pythoncom.IID_IOleWindow, shell.IID_IShellView, ] def __init__(self, hwnd): self.hwnd_parent = hwnd # IShellView def CreateViewWindow(self, prev, settings, browser, rect): print "CreateViewWindow", prev, settings, browser, rect import win32ui style = win32con.WS_VISIBLE|win32con.WS_CHILD l = win32ui.CreateListCtrl() l.CreateWindow(style, rect, self.hwnd_parent, 1) l.InsertItem(0, "Hello") return l.GetSafeHwnd() def TranslateAccelerator(self, msg): return winerror.S_FALSE class ShellFolder: _reg_progid_ = "Python.ShellExtension.Folder" _reg_desc_ = "Python Sample Shell Extension (Folder)" _reg_clsid_ = "{f6287035-3074-4cb5-a8a6-d3c80e206944}" _com_interfaces_ = [shell.IID_IBrowserFrameOptions, pythoncom.IID_IPersist, shell.IID_IPersistFolder, shell.IID_IShellFolder, ] _public_methods_ = IBrowserFrame_Methods + \ IPersistFolder_Methods + \ IShellFolder_Methods # IPersistFolder def GetFrameOptions(self, mask): return 0 def GetClassID(self): return self._reg_clsid_ # IPersist def Initialize(self, pidl): print "Got pidl", repr(pidl) # IShellFolder def CreateViewObject(self, hwnd, iid): print "CreateViewObject", hwnd, iid return wrap(ShellView(hwnd), useDispatcher=defaultDispatcher) def DllRegisterServer(): import _winreg key = _winreg.CreateKey(_winreg.HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\" \ "Explorer\\Desktop\\Namespace\\" + \ ShellFolder._reg_clsid_) _winreg.SetValueEx(key, None, 0, _winreg.REG_SZ, ShellFolder._reg_desc_) # And special shell keys under our CLSID key = _winreg.CreateKey(_winreg.HKEY_CLASSES_ROOT, "CLSID\\" + ShellFolder._reg_clsid_ + "\\ShellFolder") # 'Attributes' is an int stored as a binary! use struct attr = shellcon.SFGAO_FOLDER | shellcon.SFGAO_HASSUBFOLDER | \ shellcon.SFGAO_BROWSABLE print attr import struct s = struct.pack("I", attr) _winreg.SetValueEx(key, "Attributes", 0, _winreg.REG_BINARY, s) print ShellFolder._reg_desc_, "registration complete." def DllUnregisterServer(): import _winreg try: key = _winreg.DeleteKey(_winreg.HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\" \ "Explorer\\Desktop\\Namespace\\" + \ ShellFolder._reg_clsid_) except WindowsError, details: import errno if details.errno != errno.ENOENT: raise print ShellFolder._reg_desc_, "unregistration complete." if __name__=='__main__': from win32com.server import register register.UseCommandLine(ShellFolder, finalize_register = DllRegisterServer, finalize_unregister = DllUnregisterServer) |
From: <mha...@us...> - 2003-10-08 08:40:26
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/demos/servers In directory sc8-pr-cvs1:/tmp/cvs-serv14911 Modified Files: copy_hook.py Log Message: Add comments with what the demo is supposed to do. Index: copy_hook.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/demos/servers/copy_hook.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** copy_hook.py 7 Oct 2003 05:13:22 -0000 1.1 --- copy_hook.py 8 Oct 2003 08:40:20 -0000 1.2 *************** *** 3,8 **** # To demostrate: # * Execute this script to register the context menu. ! # * Open Windows Explorer, and browse to a directory with a .py file. ! # * Note the pretty, random selection of icons! import sys, os import pythoncom --- 3,9 ---- # To demostrate: # * Execute this script to register the context menu. ! # * Open Windows Explorer ! # * Attempt to move or copy a directory. ! # * Note our hook's dialog is displayed. import sys, os import pythoncom |
From: <mha...@us...> - 2003-10-08 05:48:02
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/test In directory sc8-pr-cvs1:/tmp/cvs-serv23523 Added Files: testShellFolder.py Log Message: Test a few IShellFolder functions. --- NEW FILE: testShellFolder.py --- from win32com.shell import shell from win32com.shell.shellcon import * sf = shell.SHGetDesktopFolder() print "sf is", sf enum = sf.EnumObjects(0, SHCONTF_FOLDERS | SHCONTF_NONFOLDERS | SHCONTF_INCLUDEHIDDEN) print "enum is", enum for i in enum: name = sf.GetDisplayNameOf(i, SHGDN_NORMAL) print name |
From: <mha...@us...> - 2003-10-08 05:41:23
|
Update of /cvsroot/pywin32/pywin32/Wise In directory sc8-pr-cvs1:/tmp/cvs-serv22711 Modified Files: win32all.wse Log Message: Correct source of the .lib files we install. Index: win32all.wse =================================================================== RCS file: /cvsroot/pywin32/pywin32/Wise/win32all.wse,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** win32all.wse 2 Sep 2003 00:37:53 -0000 1.34 --- win32all.wse 8 Oct 2003 05:41:19 -0000 1.35 *************** *** 18,22 **** Patch Threshold=85 Patch Memory=4000 ! EXE Filename=win32all-158.exe Code Sign Name=Python Win32 combined extensions Code Sign Info=skippinet.com.au --- 18,22 ---- Patch Threshold=85 Patch Memory=4000 ! EXE Filename=win32all-159.exe Code Sign Name=Python Win32 combined extensions Code Sign Info=skippinet.com.au *************** *** 1949,1953 **** end item: Install File ! Source=e:\src\pythonex\win32\Build\System\PyWinTypes.lib Destination=%PY_INST_PATH%\libs\PyWinTypes.lib Description=Core COM Extension DLL --- 1949,1953 ---- end item: Install File ! Source=e:\src\pythonex\win32\Build\PyWinTypes.lib Destination=%PY_INST_PATH%\libs\PyWinTypes.lib Description=Core COM Extension DLL *************** *** 1961,1965 **** end item: Install File ! Source=e:\src\pythonex\com\Build\System\PythonCOM.lib Destination=%PY_INST_PATH%\libs\PythonCOM.lib Description=Core COM Extension DLL --- 1961,1965 ---- end item: Install File ! Source=e:\src\pythonex\com\Build\PythonCOM.lib Destination=%PY_INST_PATH%\libs\PythonCOM.lib Description=Core COM Extension DLL |
From: <mha...@us...> - 2003-10-08 05:37:36
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src In directory sc8-pr-cvs1:/tmp/cvs-serv22147 Modified Files: PythonCOM.cpp Log Message: Correct autoduck documentation for new clipboard functions, and move OleLoadPicture to the axcontrol module. Index: PythonCOM.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/PythonCOM.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** PythonCOM.cpp 8 Oct 2003 04:28:42 -0000 1.21 --- PythonCOM.cpp 8 Oct 2003 05:37:32 -0000 1.22 *************** *** 12,16 **** #include "stdafx.h" #include <objbase.h> - #include "olectl.h" #include "PythonCOM.h" #include "PythonCOMServer.h" --- 12,15 ---- *************** *** 1298,1341 **** } ! static PyObject *pythoncom_OleLoadPicture(PyObject *, PyObject *args) ! { ! PyObject *ret = NULL; ! PyObject *obStream, *obIIDAPI, *obIIDRet = NULL; ! LONG size; ! BOOL runMode; ! if (!PyArg_ParseTuple(args, "OiiO|O", &obStream, &size, &runMode, &obIIDAPI, &obIIDRet)) { ! return NULL; ! } ! ! IUnknown *pUnk = NULL; ! IStream* pStream = NULL; ! IID iidAPI, iidRet; ! HRESULT hr; ! if (!PyCom_InterfaceFromPyInstanceOrObject(obStream, IID_IStream, (void **)&pStream, FALSE)) ! goto done; ! ! if (!PyWinObject_AsIID(obIIDAPI, &iidAPI)) ! goto done; ! if (obIIDRet == NULL) ! iidRet = iidAPI; ! else { ! if (!PyWinObject_AsIID(obIIDRet, &iidRet)) ! goto done; ! } ! Py_BEGIN_ALLOW_THREADS ! hr = ::OleLoadPicture(pStream, size, runMode, iidAPI, (LPVOID*)&pUnk); ! Py_END_ALLOW_THREADS ! if (FAILED(hr)) { ! PyCom_BuildPyException(hr); ! goto done; ! } ! ret = PyCom_PyObjectFromIUnknown(pUnk, iidRet, FALSE); ! done: ! if (pStream) ! pStream->Release(); ! return ret; ! } ! ! // @pymeth <o PyIDataObject>|OleGetClipboard|Retrieves a data object that you can use to access the contents of the clipboard. static PyObject *pythoncom_OleGetClipboard(PyObject *, PyObject *args) { --- 1297,1301 ---- } ! // @pymethod <o PyIDataObject>|pythoncom|OleGetClipboard|Retrieves a data object that you can use to access the contents of the clipboard. static PyObject *pythoncom_OleGetClipboard(PyObject *, PyObject *args) { *************** *** 1354,1358 **** } ! // @pymeth |OleSetClipboard|Places a pointer to a specific data object onto the clipboard. This makes the data object accessible to the OleGetClipboard function. static PyObject *pythoncom_OleSetClipboard(PyObject *, PyObject *args) { --- 1314,1318 ---- } ! // @pymethod |pythoncom|OleSetClipboard|Places a pointer to a specific data object onto the clipboard. This makes the data object accessible to the OleGetClipboard function. static PyObject *pythoncom_OleSetClipboard(PyObject *, PyObject *args) { *************** *** 1376,1380 **** } ! // @pymeth true/false|OleIsCurrentClipboard|Determines whether the data object pointer previously placed on the clipboard by the OleSetClipboard function is still on the clipboard. static PyObject *pythoncom_OleIsCurrentClipboard(PyObject *, PyObject *args) { --- 1336,1340 ---- } ! // @pymethod true/false|pythoncom|OleIsCurrentClipboard|Determines whether the data object pointer previously placed on the clipboard by the OleSetClipboard function is still on the clipboard. static PyObject *pythoncom_OleIsCurrentClipboard(PyObject *, PyObject *args) { *************** *** 1399,1403 **** } ! // @pymeth |OleFlushClipboard|Carries out the clipboard shutdown sequence. It also releases the IDataObject pointer that was placed on the clipboard by the <om pythoncom.OleSetClipboard> function. static PyObject *pythoncom_OleFlushClipboard(PyObject *, PyObject *args) { --- 1359,1363 ---- } ! // @pymethod |pythoncom|OleFlushClipboard|Carries out the clipboard shutdown sequence. It also releases the IDataObject pointer that was placed on the clipboard by the <om pythoncom.OleSetClipboard> function. static PyObject *pythoncom_OleFlushClipboard(PyObject *, PyObject *args) { *************** *** 1483,1487 **** { "OleLoadFromStream", pythoncom_OleLoadFromStream, 1}, // @pymeth OleLoadFromStream|Load an object from an IStream. { "OleSaveToStream", pythoncom_OleSaveToStream, 1}, // @pymeth OleSaveToStream|Save an object to an IStream. - { "OleLoadPicture", pythoncom_OleLoadPicture, 1 }, // @pymeth OleLoadPicture|Creates a new picture object and initializes it from the contents of a stream. { "OleLoad", pythoncom_OleLoad, 1 }, // @pymeth OleLoad|Loads into memory an object nested within a specified storage object. #ifndef MS_WINCE --- 1443,1446 ---- |
From: <mha...@us...> - 2003-10-08 05:36:04
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/axcontrol/src In directory sc8-pr-cvs1:/tmp/cvs-serv22042 Modified Files: AXControl.cpp Log Message: Move OleLoadPicture from pythoncom, and add OleLoadPicturePath Index: AXControl.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axcontrol/src/AXControl.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** AXControl.cpp 9 Feb 2001 07:35:53 -0000 1.2 --- AXControl.cpp 8 Oct 2003 05:36:00 -0000 1.3 *************** *** 17,20 **** --- 17,21 ---- #include "axcontrol_pch.h" #include "stddef.h" // for offsetof + #include "olectl.h" #include "PythonCOMRegister.h" // For simpler registration of IIDs etc. *************** *** 193,196 **** --- 194,293 ---- } + // @pymethod <o PyIUnknown>|axcontrol|OleLoadPicture|Creates a new picture object and initializes it from the contents of a stream. + static PyObject *axcontrol_OleLoadPicture(PyObject *, PyObject *args) + { + PyObject *ret = NULL; + PyObject *obStream, *obIIDAPI, *obIIDRet = NULL; + LONG size; + BOOL runMode; + if (!PyArg_ParseTuple(args, "OiiO|O", + &obStream, // @pyparm <o PyIStream>|stream||The stream that contains picture's data. + &size, // @pyparm int|size||Number of bytes read from the stream + &runMode, // @pyparm int|runMode||The opposite of the initial value of the KeepOriginalFormat property. If TRUE, KeepOriginalFormat is set to FALSE and vice-versa. + &obIIDAPI, // @pyparm <o PyIID>||iid|The identifier of the interface describing the type of interface pointer to return + &obIIDRet)) {// @pyparm <o PyIID>||iidRet|The IID to use for the return object - use only if pythoncom does not support the native interface requested. + return NULL; + } + + IUnknown *pUnk = NULL; + IStream* pStream = NULL; + IID iidAPI, iidRet; + HRESULT hr; + if (!PyCom_InterfaceFromPyInstanceOrObject(obStream, IID_IStream, (void **)&pStream, FALSE)) + goto done; + + if (!PyWinObject_AsIID(obIIDAPI, &iidAPI)) + goto done; + if (obIIDRet == NULL) + iidRet = iidAPI; + else { + if (!PyWinObject_AsIID(obIIDRet, &iidRet)) + goto done; + } + Py_BEGIN_ALLOW_THREADS + hr = ::OleLoadPicture(pStream, size, runMode, iidAPI, (LPVOID*)&pUnk); + Py_END_ALLOW_THREADS + if (FAILED(hr)) { + PyCom_BuildPyException(hr); + goto done; + } + ret = PyCom_PyObjectFromIUnknown(pUnk, iidRet, FALSE); + done: + if (pStream) + pStream->Release(); + return ret; + } + + // @pymethod <o PyIUnknown>|axcontrol|OleLoadPicturePath|Creates a new picture object and initializes it from the contents of a stream. + static PyObject *axcontrol_OleLoadPicturePath(PyObject *, PyObject *args) + { + PyObject *ret = NULL; + WCHAR *szPath = NULL; + PyObject *obPath, *obUnk, *obIIDAPI, *obIIDRet = NULL; + int reserved, clr; + if (!PyArg_ParseTuple(args, "OOiiO|O", + &obPath, // @pyparm string/unicode|url_or_path||The path or url to the file you want to open. + &obUnk, // @pyparm <o PyIUknown>|unk||The IUnknown for COM aggregation. + &reserved, // @pyparm int|reserved||reserved + &clr, // @pyparm int|clr||The color you want to reserve to be transparent. + &obIIDAPI, // @pyparm <o PyIID>||iid|The identifier of the interface describing the type of interface pointer to return + &obIIDRet)) {// @pyparm <o PyIID>||iidRet|The IID to use for the return object - use only if pythoncom does not support the native interface requested. + return NULL; + } + + IUnknown *pUnkRet = NULL; + IUnknown * pUnkIn = NULL; + IID iidAPI, iidRet; + HRESULT hr; + if (!PyWinObject_AsWCHAR(obPath, &szPath, FALSE)) + goto done; + + if (!PyCom_InterfaceFromPyInstanceOrObject(obUnk, IID_IUnknown, (void **)&pUnkIn, TRUE)) + goto done; + + if (!PyWinObject_AsIID(obIIDAPI, &iidAPI)) + goto done; + if (obIIDRet == NULL) + iidRet = iidAPI; + else { + if (!PyWinObject_AsIID(obIIDRet, &iidRet)) + goto done; + } + Py_BEGIN_ALLOW_THREADS + hr = ::OleLoadPicturePath(szPath, pUnkIn, (DWORD)reserved, (OLE_COLOR)clr, iidAPI, (LPVOID*)&pUnkRet); + Py_END_ALLOW_THREADS + if (FAILED(hr)) { + PyCom_BuildPyException(hr); + goto done; + } + ret = PyCom_PyObjectFromIUnknown(pUnkRet, iidRet, FALSE); + done: + if (pUnkIn) + pUnkIn->Release(); + if (szPath) + PyWinObject_FreeWCHAR(szPath); + return ret; + } + *************** *** 200,203 **** --- 297,302 ---- { { "OleCreate", axcontrol_OleCreate, 1 }, // @pymeth OleCreate|Creates a new embedded object identified by a CLSID. + { "OleLoadPicture", axcontrol_OleLoadPicture, 1 }, // @pymeth OleLoadPicture|Creates a new picture object and initializes it from the contents of a stream. + { "OleLoadPicturePath", axcontrol_OleLoadPicturePath, 1}, // @pymeth OleLoadPicturePath|Creates a new picture object and initializes it from the contents of a stream. { NULL, NULL }, }; |
From: <mha...@us...> - 2003-10-08 04:34:15
|
Update of /cvsroot/pywin32/pywin32/com/win32com/makegw In directory sc8-pr-cvs1:/tmp/cvs-serv14566 Modified Files: makegwparse.py Log Message: Add TCHAR support. Index: makegwparse.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/makegw/makegwparse.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** makegwparse.py 6 Oct 2003 13:07:02 -0000 1.9 --- makegwparse.py 8 Oct 2003 04:34:11 -0000 1.10 *************** *** 296,299 **** --- 296,321 ---- return "\tPy_XDECREF(ob%s);\n" % self.arg.name + class ArgFormatterTCHAR(ArgFormatterPythonCOM): + def _GetPythonTypeDesc(self): + return "string/<o unicode>" + def GetUnconstType(self): + if self.arg.type[:3]=="LPC": + return self.arg.type[:2] + self.arg.type[3:] + else: + return self.arg.unc_type + def GetParsePostCode(self): + return "\tif (bPythonIsHappy && !PyWinObject_AsTCHAR(ob%s, %s)) bPythonIsHappy = FALSE;\n" % (self.arg.name, self.GetIndirectedArgName(None, 2)) + def GetInterfaceArgCleanup(self): + return "\tPyWinObject_FreeTCHAR(%s);\n" % self.GetIndirectedArgName(None, 1) + def GetBuildForInterfacePreCode(self): + # the variable was declared with just its builtin indirection + notdirected = self.GetIndirectedArgName(self.builtinIndirection, 1) + return "\tob%s = PyWinObject_FromTCHAR(%s);\n" % \ + (self.arg.name, notdirected) + def GetBuildForInterfacePostCode(self): + return "// ??? - TCHAR post code\n" + def GetBuildForGatewayPostCode(self): + return "\tPy_XDECREF(ob%s);\n" % self.arg.name + class ArgFormatterIID(ArgFormatterPythonCOM): def _GetPythonTypeDesc(self): *************** *** 469,472 **** --- 491,496 ---- "LPWSTR": (ArgFormatterOLECHAR, 1, 1), "LPCSTR": (ArgFormatterOLECHAR, 1, 1), + "LPTSTR": (ArgFormatterTCHAR, 1, 1), + "LPCTSTR": (ArgFormatterTCHAR, 1, 1), "HANDLE": (ArgFormatterHANDLE, 0), "BSTR": (ArgFormatterBSTR, 1, 0), |