本文整理汇总了C++中IShellBrowser::SetMenuSB方法的典型用法代码示例。如果您正苦于以下问题:C++ IShellBrowser::SetMenuSB方法的具体用法?C++ IShellBrowser::SetMenuSB怎么用?C++ IShellBrowser::SetMenuSB使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IShellBrowser
的用法示例。
在下文中一共展示了IShellBrowser::SetMenuSB方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PyCom_BuildPyException
// @pymethod |PyIShellBrowser|SetMenuSB|Attaches a shared menu to a shell view window
PyObject *PyIShellBrowser::SetMenuSB(PyObject *self, PyObject *args)
{
IShellBrowser *pISB = GetI(self);
if ( pISB == NULL )
return NULL;
HMENU hmenuShared;
HOLEMENU holemenuRes;
HWND hwndActiveObject;
PyObject *obhmenuShared, *obholemenuRes, *obhwndActiveObject;
if (!PyArg_ParseTuple(args, "OOO:SetMenuSB",
&obhmenuShared, // @pyparm <o PyHANDLE>|hmenuShared||Handle to the shared menu
&obholemenuRes, // @pyparm <o PyHANDLE>|holemenuRes||Reserved, use only None (or 0)
&obhwndActiveObject)) // @pyparm <o PyHANDLE>|hwndActiveObject||Handle to the shell window
return NULL;
if (!PyWinObject_AsHANDLE(obhmenuShared, (HANDLE *)&hmenuShared))
return NULL;
if (!PyWinObject_AsHANDLE(obholemenuRes, (HANDLE *)&holemenuRes))
return NULL;
if (!PyWinObject_AsHANDLE(obhwndActiveObject, (HANDLE *)&hwndActiveObject))
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;
}