本文整理汇总了C++中COMPtr::Drop方法的典型用法代码示例。如果您正苦于以下问题:C++ COMPtr::Drop方法的具体用法?C++ COMPtr::Drop怎么用?C++ COMPtr::Drop使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类COMPtr
的用法示例。
在下文中一共展示了COMPtr::Drop方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: doMouseUp
static void doMouseUp(MSG msg)
{
COMPtr<IWebFramePrivate> framePrivate;
if (SUCCEEDED(frame->QueryInterface(&framePrivate)))
framePrivate->layout();
dispatchMessage(&msg);
down = false;
if (draggingInfo) {
COMPtr<IWebView> webView;
COMPtr<IDropTarget> webViewDropTarget;
if (SUCCEEDED(frame->webView(&webView)) && SUCCEEDED(webView->QueryInterface(IID_IDropTarget, (void**)&webViewDropTarget))) {
POINT screenPoint = msg.pt;
::ClientToScreen(webViewWindow, &screenPoint);
HRESULT hr = draggingInfo->dropSource()->QueryContinueDrag(0, 0);
DWORD effect = 0;
webViewDropTarget->DragOver(0, pointl(screenPoint), &effect);
if (hr == DRAGDROP_S_DROP && effect != DROPEFFECT_NONE) {
DWORD effect = 0;
webViewDropTarget->Drop(draggingInfo->dataObject(), 0, pointl(screenPoint), &effect);
} else
webViewDropTarget->DragLeave();
delete draggingInfo;
draggingInfo = 0;
}
}
}
示例2: doMouseUp
static void doMouseUp(MSG msg, HRESULT* oleDragAndDropReturnValue = 0)
{
COMPtr<IWebFramePrivate> framePrivate;
if (SUCCEEDED(frame->QueryInterface(&framePrivate)))
framePrivate->layout();
dispatchMessage(&msg);
down = false;
if (draggingInfo) {
COMPtr<IWebView> webView;
COMPtr<IDropTarget> webViewDropTarget;
if (SUCCEEDED(frame->webView(&webView)) && SUCCEEDED(webView->QueryInterface(IID_IDropTarget, (void**)&webViewDropTarget))) {
POINT screenPoint = msg.pt;
DWORD effect = 0;
::ClientToScreen(webViewWindow, &screenPoint);
if (!didDragEnter) {
webViewDropTarget->DragEnter(draggingInfo->dataObject(), 0, pointl(screenPoint), &effect);
didDragEnter = true;
}
HRESULT hr = draggingInfo->dropSource()->QueryContinueDrag(0, 0);
if (oleDragAndDropReturnValue)
*oleDragAndDropReturnValue = hr;
webViewDropTarget->DragOver(0, pointl(screenPoint), &effect);
if (hr == DRAGDROP_S_DROP && effect != DROPEFFECT_NONE) {
DWORD effect = 0;
webViewDropTarget->Drop(draggingInfo->dataObject(), 0, pointl(screenPoint), &effect);
draggingInfo->setPerformedDropEffect(effect);
} else
webViewDropTarget->DragLeave();
// Reset didDragEnter so that another drag started within the same frame works properly.
didDragEnter = false;
}
}
}