diff options
author | MikalaiR <nikolay.romanovich@narod.ru> | 2016-01-23 16:28:19 +0000 |
---|---|---|
committer | MikalaiR <nikolay.romanovich@narod.ru> | 2016-01-23 16:28:19 +0000 |
commit | 5e10673c45a91e474680a1a998cd6934f9627faa (patch) | |
tree | c9d5154187226f0003613cfdcbb76345402161e6 /plugins/IEView/src/IEView.cpp | |
parent | dee551f9874195814e7357c94045aa0c2e77cc4f (diff) |
this is bad idea
git-svn-id: http://svn.miranda-ng.org/main/trunk@16148 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/IEView/src/IEView.cpp')
-rw-r--r-- | plugins/IEView/src/IEView.cpp | 66 |
1 files changed, 28 insertions, 38 deletions
diff --git a/plugins/IEView/src/IEView.cpp b/plugins/IEView/src/IEView.cpp index 2be1e2eacf..3a0ed4bafd 100644 --- a/plugins/IEView/src/IEView.cpp +++ b/plugins/IEView/src/IEView.cpp @@ -436,8 +436,6 @@ STDMETHODIMP IEView::GetIDsOfNames(REFIID /*riid*/, LPOLESTR *rgszNames, UINT cN else if (!wcscmp(L"win32_CopyToClipboard", rgszNames[i]))
rgDispId[i] = DISPID_EXTERNAL_WIN32_COPY_TO_CLIPBOARD;
- else if (!wcscmp(L"IEView_SetContextMenuHandler", rgszNames[i]))
- rgDispId[i] = DISPID_EXTERNAL_SET_CONTEXTMENUHANDLER;
else if (!wcscmp(L"IEView_GetCurrentContact", rgszNames[i]))
rgDispId[i] = DISPID_EXTERNAL_GET_CURRENTCONTACT;
@@ -480,8 +478,6 @@ STDMETHODIMP IEView::Invoke(DISPID dispIdMember, case DISPID_EXTERNAL_GET_CURRENTCONTACT:
return External::IEView_GetCurrentContact(this, pDispParams, pVarResult);
- case DISPID_EXTERNAL_SET_CONTEXTMENUHANDLER:
- return External::IEView_SetContextMenuHandler(this, pDispParams, pVarResult);
}
return DISP_E_MEMBERNOTFOUND;
@@ -620,41 +616,35 @@ STDMETHODIMP IEView::ShowContextMenu(DWORD dwID, POINT *ppt, IUnknown *pcmdTarge */
}
#else
- if (wszContextMenuHandler != nullptr)
- {
- CallJScript(wszContextMenuHandler, 1, CMStringW(FORMAT, L"%d", dwID));
- }
- else
- {
- CComPtr<IOleCommandTarget> pOleCommandTarget;
- if (SUCCEEDED(pcmdTarget->QueryInterface(IID_IOleCommandTarget, (void**)&pOleCommandTarget))) {
- CComPtr<IOleWindow> pOleWindow;
- if (SUCCEEDED(pOleCommandTarget.QueryInterface(&pOleWindow))) {
- HWND hSPWnd;
- pOleWindow->GetWindow(&hSPWnd);
-
- HMENU hMenu = GetSubMenu(LoadMenu(hInstance, MAKEINTRESOURCE(IDR_CONTEXTMENU)), 0);
- TranslateMenu(hMenu);
- if (dwID == 5) // anchor
- EnableMenuItem(hMenu, ID_MENU_COPYLINK, MF_BYCOMMAND | MF_ENABLED);
- else if (dwID == 4) // text select
- EnableMenuItem(hMenu, ID_MENU_COPY, MF_BYCOMMAND | MF_ENABLED);
- else if (dwID == 1) // control (image)
- EnableMenuItem(hMenu, ID_MENU_SAVEIMAGE, MF_BYCOMMAND | MF_ENABLED);
- int iSelection = TrackPopupMenu(hMenu,
- TPM_LEFTALIGN | TPM_RIGHTBUTTON | TPM_RETURNCMD,
- ppt->x,
- ppt->y,
- 0,
- hwnd,
- (RECT*)NULL);
- DestroyMenu(hMenu);
- if (iSelection == ID_MENU_CLEARLOG)
- clear(NULL);
- else
- SendMessage(hSPWnd, WM_COMMAND, iSelection, (LPARAM)NULL);
- }
+ CComPtr<IOleCommandTarget> pOleCommandTarget;
+ if (SUCCEEDED(pcmdTarget->QueryInterface(IID_IOleCommandTarget, (void**)&pOleCommandTarget))) {
+ CComPtr<IOleWindow> pOleWindow;
+ if (SUCCEEDED(pOleCommandTarget.QueryInterface(&pOleWindow))) {
+ HWND hSPWnd;
+ pOleWindow->GetWindow(&hSPWnd);
+
+ HMENU hMenu = GetSubMenu(LoadMenu(hInstance, MAKEINTRESOURCE(IDR_CONTEXTMENU)), 0);
+ TranslateMenu(hMenu);
+ if (dwID == 5) // anchor
+ EnableMenuItem(hMenu, ID_MENU_COPYLINK, MF_BYCOMMAND | MF_ENABLED);
+ else if (dwID == 4) // text select
+ EnableMenuItem(hMenu, ID_MENU_COPY, MF_BYCOMMAND | MF_ENABLED);
+ else if (dwID == 1) // control (image)
+ EnableMenuItem(hMenu, ID_MENU_SAVEIMAGE, MF_BYCOMMAND | MF_ENABLED);
+
+ int iSelection = TrackPopupMenu(hMenu,
+ TPM_LEFTALIGN | TPM_RIGHTBUTTON | TPM_RETURNCMD,
+ ppt->x,
+ ppt->y,
+ 0,
+ hwnd,
+ (RECT*)NULL);
+ DestroyMenu(hMenu);
+ if (iSelection == ID_MENU_CLEARLOG)
+ clear(NULL);
+ else
+ SendMessage(hSPWnd, WM_COMMAND, iSelection, (LPARAM)NULL);
}
}
#endif
|