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);
|