Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7746/com/win32comext/shell/src
Modified Files:
PyIContextMenu.h shell.cpp
Added Files:
PyIContextMenu2.cpp PyIContextMenu2.h PyIContextMenu3.cpp
PyIContextMenu3.h
Log Message:
win32com.shell gets support for IContextMenu2 and IContextMenu3
Index: shell.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/shell.cpp,v
retrieving revision 1.66
retrieving revision 1.67
diff -C2 -d -r1.66 -r1.67
*** shell.cpp 27 Jul 2008 13:01:18 -0000 1.66
--- shell.cpp 9 Aug 2008 01:53:01 -0000 1.67
***************
*** 22,25 ****
--- 22,27 ----
#include "PyICategoryProvider.h"
#include "PyIContextMenu.h"
+ #include "PyIContextMenu2.h"
+ #include "PyIContextMenu3.h"
#include "PyIDefaultExtractIconInit.h"
#include "PyIExtractIcon.h"
***************
*** 3255,3258 ****
--- 3257,3262 ----
PYCOM_INTERFACE_FULL(AsyncOperation),
PYCOM_INTERFACE_FULL(ContextMenu),
+ PYCOM_INTERFACE_SERVER_ONLY(ContextMenu2),
+ PYCOM_INTERFACE_SERVER_ONLY(ContextMenu3),
PYCOM_INTERFACE_FULL(ExtractIcon),
PYCOM_INTERFACE_FULL(ExtractIconW),
Index: PyIContextMenu.h
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/PyIContextMenu.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** PyIContextMenu.h 24 May 2007 06:01:05 -0000 1.2
--- PyIContextMenu.h 9 Aug 2008 01:53:01 -0000 1.3
***************
*** 4,7 ****
--- 4,8 ----
//
// Interface Declaration
+ #pragma once
class PyIContextMenu : public PyIUnknown
--- NEW FILE: PyIContextMenu3.cpp ---
// This file implements the IContextMenu Interface and Gateway for Python.
// Generated by makegw.py
#include "shell_pch.h"
#include "PyIContextMenu3.h"
// @doc - This file contains autoduck documentation
// ---------------------------------------------------
//
// Gateway Implementation
STDMETHODIMP PyGContextMenu3::QueryContextMenu(HMENU hmenu,
UINT indexMenu,
UINT idCmdFirst,
UINT idCmdLast,
UINT uFlags) {
return PyGContextMenu2::QueryContextMenu(hmenu, indexMenu, idCmdFirst,
idCmdLast, uFlags);
}
STDMETHODIMP PyGContextMenu3::InvokeCommand(CMINVOKECOMMANDINFO * lpici) {
return PyGContextMenu2::InvokeCommand(lpici);
}
STDMETHODIMP PyGContextMenu3::GetCommandString(
UINT_PTR idCmd,
UINT uType,
UINT __RPC_FAR * pwReserved,
LPSTR pszName,
UINT cchMax) {
return PyGContextMenu2::GetCommandString(idCmd, uType, pwReserved,
pszName, cchMax);
}
STDMETHODIMP PyGContextMenu3::HandleMenuMsg(
UINT uMsg,
WPARAM wParam,
LPARAM lParam) {
return PyGContextMenu2::HandleMenuMsg(uMsg, wParam, lParam);
}
STDMETHODIMP PyGContextMenu3::HandleMenuMsg2(
UINT uMsg,
WPARAM wParam,
LPARAM lParam,
LRESULT *lpResult)
{
PY_GATEWAY_METHOD;
PyObject *ret;
HRESULT hr=InvokeViaPolicy("HandleMenuMsg2", &ret, "INN", uMsg,
PyWinObject_FromPARAM(wParam),
PyWinObject_FromPARAM(lParam));
if (FAILED(hr)) return hr;
if (lpResult) {
if (ret == Py_None)
*lpResult = FALSE;
else {
PyWinObject_AsPARAM(ret, (WPARAM *)lpResult);
hr = PyCom_SetAndLogCOMErrorFromPyException("HandleMenuMsg2",
IID_IContextMenu3);
}
}
Py_DECREF(ret);
return hr;
}
--- NEW FILE: PyIContextMenu3.h ---
// This file declares the IContextMenu Interface and Gateway for Python.
// Generated by makegw.py
// ---------------------------------------------------
// ---------------------------------------------------
//
// Gateway Declaration
#include "PyIContextMenu2.h"
class PyGContextMenu3 : public PyGContextMenu2, public IContextMenu3
{
protected:
PyGContextMenu3(PyObject *instance) : PyGContextMenu2(instance) { ; }
PYGATEWAY_MAKE_SUPPORT2(PyGContextMenu3, IContextMenu3, IID_IContextMenu3, PyGContextMenu2)
// IContextMenu
STDMETHOD(QueryContextMenu)(
HMENU hmenu,
UINT indexMenu,
UINT idCmdFirst,
UINT idCmdLast,
UINT uFlags);
STDMETHOD(InvokeCommand)(
CMINVOKECOMMANDINFO __RPC_FAR * lpici);
STDMETHOD(GetCommandString)(
UINT_PTR idCmd,
UINT uType,
UINT __RPC_FAR * pwReserved,
LPSTR pszName,
UINT cchMax);
// IContextMenu2
STDMETHOD(HandleMenuMsg)(
UINT uMsg,
WPARAM wParam,
LPARAM lParam);
// IContextMenu3
STDMETHOD(HandleMenuMsg2)(
UINT uMsg,
WPARAM wParam,
LPARAM lParam,
LRESULT *plResult);
};
--- NEW FILE: PyIContextMenu2.cpp ---
// This file implements the IContextMenu Interface and Gateway for Python.
// Generated by makegw.py
#include "shell_pch.h"
#include "PyIContextMenu2.h"
// @doc - This file contains autoduck documentation
// ---------------------------------------------------
//
// Gateway Implementation
STDMETHODIMP PyGContextMenu2::QueryContextMenu(HMENU hmenu,
UINT indexMenu,
UINT idCmdFirst,
UINT idCmdLast,
UINT uFlags) {
return PyGContextMenu::QueryContextMenu(hmenu, indexMenu, idCmdFirst,
idCmdLast, uFlags);
}
STDMETHODIMP PyGContextMenu2::InvokeCommand(CMINVOKECOMMANDINFO * lpici) {
return PyGContextMenu::InvokeCommand(lpici);
}
STDMETHODIMP PyGContextMenu2::GetCommandString(
UINT_PTR idCmd,
UINT uType,
UINT __RPC_FAR * pwReserved,
LPSTR pszName,
UINT cchMax) {
return PyGContextMenu::GetCommandString(idCmd, uType, pwReserved,
pszName, cchMax);
}
STDMETHODIMP PyGContextMenu2::HandleMenuMsg(
UINT uMsg,
WPARAM wParam,
LPARAM lParam)
{
PY_GATEWAY_METHOD;
PyObject *ret;
HRESULT hr=InvokeViaPolicy("HandleMenuMsg", NULL, "INN", uMsg,
PyWinObject_FromPARAM(wParam),
PyWinObject_FromPARAM(lParam));
if (FAILED(hr)) return hr;
return S_OK;
}
--- NEW FILE: PyIContextMenu2.h ---
// This file declares the IContextMenu Interface and Gateway for Python.
// Generated by makegw.py
// ---------------------------------------------------
// ---------------------------------------------------
//
// Gateway Declaration
#pragma once
#include "PyIContextMenu.h"
class PyGContextMenu2 : public PyGContextMenu, public IContextMenu2
{
protected:
PyGContextMenu2(PyObject *instance) : PyGContextMenu(instance) { ; }
PYGATEWAY_MAKE_SUPPORT2(PyGContextMenu2, IContextMenu2, IID_IContextMenu2, PyGContextMenu)
// IContextMenu
STDMETHOD(QueryContextMenu)(
HMENU hmenu,
UINT indexMenu,
UINT idCmdFirst,
UINT idCmdLast,
UINT uFlags);
STDMETHOD(InvokeCommand)(
CMINVOKECOMMANDINFO __RPC_FAR * lpici);
STDMETHOD(GetCommandString)(
UINT_PTR idCmd,
UINT uType,
UINT __RPC_FAR * pwReserved,
LPSTR pszName,
UINT cchMax);
// IContextMenu2
STDMETHOD(HandleMenuMsg)(
UINT uMsg,
WPARAM wParam,
LPARAM lParam);
};
|