From: Roger U. <ru...@us...> - 2007-01-22 21:19:03
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6151/com/win32comext/shell/src Modified Files: PyIShellBrowser.cpp Log Message: Change places where handles treated as ints or longs Use "I" format for UINTS Index: PyIShellBrowser.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/PyIShellBrowser.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PyIShellBrowser.cpp 12 Jun 2004 13:28:15 -0000 1.5 --- PyIShellBrowser.cpp 22 Jan 2007 21:18:58 -0000 1.6 *************** *** 32,36 **** } ! // @pymethod |PyIShellBrowser|InsertMenusSB|Description of InsertMenusSB. PyObject *PyIShellBrowser::InsertMenusSB(PyObject *self, PyObject *args) { --- 32,36 ---- } ! // @pymethod <o PyLPOLEMENUGROUPWIDTHS>|PyIShellBrowser|InsertMenusSB|Updates a composite menu with container's options PyObject *PyIShellBrowser::InsertMenusSB(PyObject *self, PyObject *args) { *************** *** 38,53 **** if ( pISB == NULL ) return NULL; - // @pyparm int|hmenuShared||Description for hmenuShared OLEMENUGROUPWIDTHS menuWidths; ! PyObject *obMenuWidths; ! // @pyparm <o PyLPOLEMENUGROUPWIDTHS>|lpMenuWidths||Description for lpMenuWidths ! INT ihmenuShared; HMENU hmenuShared; ! if ( !PyArg_ParseTuple(args, "iO:InsertMenusSB", &ihmenuShared, &obMenuWidths) ) return NULL; - BOOL bPythonIsHappy = TRUE; - hmenuShared = (HMENU)ihmenuShared; - if (bPythonIsHappy && !PyObject_AsOLEMENUGROUPWIDTHS( obMenuWidths, &menuWidths )) bPythonIsHappy = FALSE; - if (!bPythonIsHappy) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; --- 38,52 ---- if ( pISB == NULL ) return NULL; OLEMENUGROUPWIDTHS menuWidths; ! PyObject *obMenuWidths, *obhmenuShared; HMENU hmenuShared; ! if ( !PyArg_ParseTuple(args, "OO:InsertMenusSB", ! &obhmenuShared, // @pyparm <o PyHANDLE>|hmenuShared||Newly created menu that contains no items ! &obMenuWidths)) // @pyparm <o PyLPOLEMENUGROUPWIDTHS>|lpMenuWidths||Tuple of 6 ints. Items 0,2,and 4 are updated when the tuple is returned. ! return NULL; ! if (!PyWinObject_AsHANDLE(obhmenuShared, (HANDLE *)&hmenuShared, FALSE)) ! return NULL; ! if (!PyObject_AsOLEMENUGROUPWIDTHS( obMenuWidths, &menuWidths)) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; *************** *** 59,63 **** } ! // @pymethod |PyIShellBrowser|SetMenuSB|Description of SetMenuSB. PyObject *PyIShellBrowser::SetMenuSB(PyObject *self, PyObject *args) { --- 58,62 ---- } ! // @pymethod |PyIShellBrowser|SetMenuSB|Attaches a shared menu to a shell view window PyObject *PyIShellBrowser::SetMenuSB(PyObject *self, PyObject *args) { *************** *** 65,86 **** 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; --- 64,86 ---- 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, FALSE)) ! return NULL; ! if (!PyWinObject_AsHANDLE(obholemenuRes, (HANDLE *)&holemenuRes, TRUE)) ! return NULL; ! if (!PyWinObject_AsHANDLE(obhwndActiveObject, (HANDLE *)&hwndActiveObject, FALSE)) ! return NULL; ! HRESULT hr; PY_INTERFACE_PRECALL; hr = pISB->SetMenuSB( hmenuShared, holemenuRes, hwndActiveObject ); PY_INTERFACE_POSTCALL; *************** *** 92,96 **** } ! // @pymethod |PyIShellBrowser|RemoveMenusSB|Description of RemoveMenusSB. PyObject *PyIShellBrowser::RemoveMenusSB(PyObject *self, PyObject *args) { --- 92,96 ---- } ! // @pymethod |PyIShellBrowser|RemoveMenusSB|Asks container to remove any items it added to a composite menu PyObject *PyIShellBrowser::RemoveMenusSB(PyObject *self, PyObject *args) { *************** *** 98,109 **** 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; --- 98,109 ---- if ( pISB == NULL ) return NULL; ! PyObject *obhmenuShared; HMENU hmenuShared; ! if (!PyArg_ParseTuple(args, "O:RemoveMenusSB", ! &obhmenuShared)) // @pyparm <o PyHANDLE>|hmenuShared||Handle to the composite menu return NULL; ! if (!PyWinObject_AsHANDLE(obhmenuShared, (HANDLE *)&hmenuShared, FALSE)) ! return NULL; ! HRESULT hr; PY_INTERFACE_PRECALL; *************** *** 119,123 **** } ! // @pymethod |PyIShellBrowser|SetStatusTextSB|Description of SetStatusTextSB. PyObject *PyIShellBrowser::SetStatusTextSB(PyObject *self, PyObject *args) { --- 119,123 ---- } ! // @pymethod |PyIShellBrowser|SetStatusTextSB|Sets the status text in view's status bar PyObject *PyIShellBrowser::SetStatusTextSB(PyObject *self, PyObject *args) { *************** *** 125,136 **** 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; --- 125,135 ---- if ( pISB == NULL ) return NULL; PyObject *obpszStatusText; LPOLESTR pszStatusText; ! if (!PyArg_ParseTuple(args, "O:SetStatusTextSB", ! &obpszStatusText)) // @pyparm <o PyUnicode>|pszStatusText||New status to be displayed ! return NULL; ! if (!PyWinObject_AsBstr(obpszStatusText, &pszStatusText)) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; *************** *** 147,151 **** } ! // @pymethod |PyIShellBrowser|EnableModelessSB|Description of EnableModelessSB. PyObject *PyIShellBrowser::EnableModelessSB(PyObject *self, PyObject *args) { --- 146,150 ---- } ! // @pymethod |PyIShellBrowser|EnableModelessSB|Enables or disables modeless dialogs PyObject *PyIShellBrowser::EnableModelessSB(PyObject *self, PyObject *args) { *************** *** 153,159 **** if ( pISB == NULL ) return NULL; - // @pyparm int|fEnable||Description for fEnable BOOL fEnable; ! if ( !PyArg_ParseTuple(args, "i:EnableModelessSB", &fEnable) ) return NULL; HRESULT hr; --- 152,158 ---- if ( pISB == NULL ) return NULL; BOOL fEnable; ! if (!PyArg_ParseTuple(args, "i:EnableModelessSB", ! &fEnable)) // @pyparm boolean|fEnable||Use True to enable or False to disable modeless dialog boxes return NULL; HRESULT hr; *************** *** 170,174 **** } ! // @pymethod |PyIShellBrowser|TranslateAcceleratorSB|Description of TranslateAcceleratorSB. PyObject *PyIShellBrowser::TranslateAcceleratorSB(PyObject *self, PyObject *args) { --- 169,173 ---- } ! // @pymethod |PyIShellBrowser|TranslateAcceleratorSB|Translates keystrokes used as menu item activators PyObject *PyIShellBrowser::TranslateAcceleratorSB(PyObject *self, PyObject *args) { *************** *** 176,193 **** 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; --- 175,188 ---- if ( pISB == NULL ) return NULL; MSG msg; PyObject *obpmsg; WORD wID; ! if (!PyArg_ParseTuple(args, "OH:TranslateAcceleratorSB", ! &obpmsg, // @pyparm <o PyMSG>|pmsg||Keystroke message to be translated ! &wID)) // @pyparm int|wID||Menu command id for the keystroke return NULL; ! if (!PyObject_AsMSG(obpmsg, &msg)) ! return NULL; ! HRESULT hr; PY_INTERFACE_PRECALL; *************** *** 200,204 **** } ! // @pymethod |PyIShellBrowser|BrowseObject|Description of BrowseObject. PyObject *PyIShellBrowser::BrowseObject(PyObject *self, PyObject *args) { --- 195,199 ---- } ! // @pymethod |PyIShellBrowser|BrowseObject|Navigates to a different location PyObject *PyIShellBrowser::BrowseObject(PyObject *self, PyObject *args) { *************** *** 206,219 **** 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; --- 201,213 ---- if ( pISB == NULL ) return NULL; PyObject *obpidl; LPITEMIDLIST pidl; UINT wFlags; ! if ( !PyArg_ParseTuple(args, "OI:BrowseObject", ! &obpidl, // @pyparm <o PyIDL>|pidl||Item id list that specifies the new browse location, can be None ! &wFlags)) // @pyparm int|wFlags||Combination of shellcon.SBSP_* flags ! return NULL; ! if (!PyObject_AsPIDL(obpidl, &pidl, TRUE)) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; *************** *** 227,231 **** } ! // @pymethod |PyIShellBrowser|GetViewStateStream|Description of GetViewStateStream. PyObject *PyIShellBrowser::GetViewStateStream(PyObject *self, PyObject *args) { --- 221,225 ---- } ! // @pymethod <o PyIStream>|PyIShellBrowser|GetViewStateStream|Returns a stream that can be used to access view state information PyObject *PyIShellBrowser::GetViewStateStream(PyObject *self, PyObject *args) { *************** *** 233,237 **** if ( pISB == NULL ) return NULL; ! // @pyparm int|grfMode||Description for grfMode DWORD grfMode; IStream * ppStrm; --- 227,231 ---- if ( pISB == NULL ) return NULL; ! // @pyparm int|grfMode||Read/write mode, one of STGM_READ,STGM_WRITE,STGM_READWRITE DWORD grfMode; IStream * ppStrm; *************** *** 247,251 **** } ! // @pymethod |PyIShellBrowser|GetControlWindow|Description of GetControlWindow. PyObject *PyIShellBrowser::GetControlWindow(PyObject *self, PyObject *args) { --- 241,245 ---- } ! // @pymethod |PyIShellBrowser|GetControlWindow|Returns a handle to one of the browser's control elements PyObject *PyIShellBrowser::GetControlWindow(PyObject *self, PyObject *args) { *************** *** 253,259 **** if ( pISB == NULL ) return NULL; ! // @pyparm int|id||Description for id UINT id; ! if ( !PyArg_ParseTuple(args, "i:GetControlWindow", &id) ) return NULL; HWND hwnd; --- 247,253 ---- if ( pISB == NULL ) return NULL; ! // @pyparm int|id||One of shellcon.FCW_* values UINT id; ! if ( !PyArg_ParseTuple(args, "I:GetControlWindow", &id) ) return NULL; HWND hwnd; *************** *** 264,268 **** if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pISB, IID_IShellBrowser ); ! return PyLong_FromVoidPtr(hwnd); } --- 258,262 ---- if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pISB, IID_IShellBrowser ); ! return PyWinLong_FromHANDLE(hwnd); } *************** *** 298,302 **** } ! // @pymethod |PyIShellBrowser|SendControlMsg|Description of SendControlMsg. PyObject *PyIShellBrowser::SendControlMsg(PyObject *self, PyObject *args) { --- 292,296 ---- } ! // @pymethod int|PyIShellBrowser|SendControlMsg|Sends a control msg to browser's toolbar or status bar PyObject *PyIShellBrowser::SendControlMsg(PyObject *self, PyObject *args) { *************** *** 304,315 **** 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; PyObject *obwparam, *oblparam; ! if ( !PyArg_ParseTuple(args, "iiOO:SendControlMsg", &id, &uMsg, &obwparam, &oblparam) ) return NULL; WPARAM wParam; --- 298,309 ---- if ( pISB == NULL ) return NULL; ! // @pyparm int|id||shellcon.FCW_TOOLBAR or FCW_STATUS ! // @pyparm int|uMsg||The message to send ! // @pyparm int|wParam||Value is dependent on the message ! // @pyparm long|lParam||Value is dependent on the message UINT id; UINT uMsg; PyObject *obwparam, *oblparam; ! if ( !PyArg_ParseTuple(args, "IIOO:SendControlMsg", &id, &uMsg, &obwparam, &oblparam) ) return NULL; WPARAM wParam; *************** *** 330,334 **** } ! // @pymethod |PyIShellBrowser|QueryActiveShellView|Description of QueryActiveShellView. PyObject *PyIShellBrowser::QueryActiveShellView(PyObject *self, PyObject *args) { --- 324,328 ---- } ! // @pymethod <o PyIShellView>|PyIShellBrowser|QueryActiveShellView|Returns the currently displayed view PyObject *PyIShellBrowser::QueryActiveShellView(PyObject *self, PyObject *args) { *************** *** 348,352 **** } ! // @pymethod |PyIShellBrowser|OnViewWindowActive|Description of OnViewWindowActive. PyObject *PyIShellBrowser::OnViewWindowActive(PyObject *self, PyObject *args) { --- 342,346 ---- } ! // @pymethod |PyIShellBrowser|OnViewWindowActive|Callback triggered when a view window is activated PyObject *PyIShellBrowser::OnViewWindowActive(PyObject *self, PyObject *args) { *************** *** 354,366 **** 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; --- 348,358 ---- if ( pISB == NULL ) return NULL; ! // @pyparm <o PyIShellView>|pshv||The activated view object PyObject *obpshv; IShellView *pshv; if ( !PyArg_ParseTuple(args, "O:OnViewWindowActive", &obpshv) ) return NULL; ! if (!PyCom_InterfaceFromPyInstanceOrObject(obpshv, IID_IShellView, (void **)&pshv, TRUE /* bNoneOK */)) ! return NULL; HRESULT hr; PY_INTERFACE_PRECALL; *************** *** 375,379 **** } ! // @pymethod |PyIShellBrowser|SetToolbarItems|Description of SetToolbarItems. PyObject *PyIShellBrowser::SetToolbarItems(PyObject *self, PyObject *args) { --- 367,371 ---- } ! // @pymethod |PyIShellBrowser|SetToolbarItems|Adds toolbar buttons to the browser's toolbar PyObject *PyIShellBrowser::SetToolbarItems(PyObject *self, PyObject *args) { *************** *** 383,395 **** LPTBBUTTONSB lpButtons; PyObject *oblpButtons; ! // @pyparm <o PyLPTBBUTTONSB>|lpButtons||Description for lpButtons ! // @pyparm int|uFlags||Description for uFlags UINT nButtons; UINT uFlags; ! if ( !PyArg_ParseTuple(args, "Oi:SetToolbarItems", &oblpButtons, &uFlags) ) return NULL; - BOOL bPythonIsHappy = TRUE; - if (bPythonIsHappy && !PyObject_AsTBBUTTONs( oblpButtons, &lpButtons, &nButtons )) bPythonIsHappy = FALSE; - if (!bPythonIsHappy) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; --- 375,388 ---- LPTBBUTTONSB lpButtons; PyObject *oblpButtons; ! ! UINT nButtons; UINT uFlags; ! if (!PyArg_ParseTuple(args, "OI:SetToolbarItems", ! &oblpButtons, // @pyparm <o PyLPTBBUTTONSB>|lpButtons||Sequence of tuples describing the buttons to be added ! &uFlags)) // @pyparm int|uFlags||Indicates button positions, combination of shellcon.FCT_* ! return NULL; ! if (!PyObject_AsTBBUTTONs( oblpButtons, &lpButtons, &nButtons )) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; *************** *** 408,424 **** 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 OnViewWindowActive { NULL } }; --- 401,417 ---- static struct PyMethodDef PyIShellBrowser_methods[] = { ! { "InsertMenusSB", PyIShellBrowser::InsertMenusSB, 1 }, // @pymeth InsertMenusSB|Updates a composite menu with container's options ! { "SetMenuSB", PyIShellBrowser::SetMenuSB, 1 }, // @pymeth SetMenuSB|Attaches a shared menu to a shell view window ! { "RemoveMenusSB", PyIShellBrowser::RemoveMenusSB, 1 }, // @pymeth RemoveMenusSB|Asks container to remove any items it added to a composite menu ! { "SetStatusTextSB", PyIShellBrowser::SetStatusTextSB, 1 }, // @pymeth SetStatusTextSB|Sets the status text in view's status bar ! { "EnableModelessSB", PyIShellBrowser::EnableModelessSB, 1 }, // @pymeth EnableModelessSB|Enables or disables modeless dialogs ! { "TranslateAcceleratorSB", PyIShellBrowser::TranslateAcceleratorSB, 1 }, // @pymeth TranslateAcceleratorSB|Translates keystrokes used as menu item activators ! { "BrowseObject", PyIShellBrowser::BrowseObject, 1 }, // @pymeth BrowseObject|Navigates to a different location ! { "GetViewStateStream", PyIShellBrowser::GetViewStateStream, 1 }, // @pymeth GetViewStateStream|Returns a stream that can be used to access view state information ! { "GetControlWindow", PyIShellBrowser::GetControlWindow, 1 }, // @pymeth GetControlWindow|Returns a handle to one of the browser's control elements ! { "SendControlMsg", PyIShellBrowser::SendControlMsg, 1 }, // @pymeth SendControlMsg|Sends a control msg to browser's toolbar or status bar ! { "QueryActiveShellView", PyIShellBrowser::QueryActiveShellView, 1 }, // @pymeth QueryActiveShellView|Returns the currently displayed view ! { "OnViewWindowActive", PyIShellBrowser::OnViewWindowActive, 1 }, // @pymeth OnViewWindowActive|Callback triggered when a view window is activated ! { "SetToolbarItems", PyIShellBrowser::SetToolbarItems, 1}, // @pymeth SetToolbarItems|Adds toolbar buttons to the browser's toolbar { NULL } }; *************** *** 442,446 **** if (oblpMenuWidths==NULL) return PyCom_HandlePythonFailureToCOM(); PyObject *result; ! HRESULT hr=InvokeViaPolicy("InsertMenusSB", &result, "iO", hmenuShared, oblpMenuWidths); Py_DECREF(oblpMenuWidths); if (FAILED(hr)) return hr; --- 435,439 ---- if (oblpMenuWidths==NULL) return PyCom_HandlePythonFailureToCOM(); PyObject *result; ! HRESULT hr=InvokeViaPolicy("InsertMenusSB", &result, "NO", PyWinLong_FromHANDLE(hmenuShared), oblpMenuWidths); Py_DECREF(oblpMenuWidths); if (FAILED(hr)) return hr; *************** *** 456,460 **** { PY_GATEWAY_METHOD; ! HRESULT hr=InvokeViaPolicy("SetMenuSB", NULL, "iil", hmenuShared, holemenuRes, hwndActiveObject); return hr; } --- 449,454 ---- { PY_GATEWAY_METHOD; ! HRESULT hr=InvokeViaPolicy("SetMenuSB", NULL, "NNN", PyWinLong_FromHANDLE(hmenuShared), ! PyWinLong_FromHANDLE(holemenuRes), PyWinLong_FromHANDLE(hwndActiveObject)); return hr; } *************** *** 464,468 **** { PY_GATEWAY_METHOD; ! HRESULT hr=InvokeViaPolicy("RemoveMenusSB", NULL, "i", hmenuShared); return hr; } --- 458,462 ---- { PY_GATEWAY_METHOD; ! HRESULT hr=InvokeViaPolicy("RemoveMenusSB", NULL, "N", PyWinLong_FromHANDLE(hmenuShared)); return hr; } *************** *** 494,498 **** PyObject *obpmsg = PyObject_FromMSG(pmsg); if (obpmsg==NULL) return PyCom_HandlePythonFailureToCOM(); ! HRESULT hr=InvokeViaPolicy("TranslateAcceleratorSB", NULL, "Oi", obpmsg, wID); Py_DECREF(obpmsg); return hr; --- 488,492 ---- PyObject *obpmsg = PyObject_FromMSG(pmsg); if (obpmsg==NULL) return PyCom_HandlePythonFailureToCOM(); ! HRESULT hr=InvokeViaPolicy("TranslateAcceleratorSB", NULL, "OH", obpmsg, wID); Py_DECREF(obpmsg); return hr; *************** *** 506,510 **** PyObject *obpidl; obpidl = PyObject_FromPIDL(pidl, FALSE); ! HRESULT hr=InvokeViaPolicy("BrowseObject", NULL, "Oi", obpidl, wFlags); Py_XDECREF(obpidl); return hr; --- 500,504 ---- PyObject *obpidl; obpidl = PyObject_FromPIDL(pidl, FALSE); ! HRESULT hr=InvokeViaPolicy("BrowseObject", NULL, "OI", obpidl, wFlags); Py_XDECREF(obpidl); return hr; *************** *** 536,544 **** 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; --- 530,538 ---- 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 (!PyWinObject_AsHANDLE(result, (HANDLE *)phwnd, TRUE)) ! hr = PyCom_HandlePythonFailureToCOM(); Py_DECREF(result); return hr; |