- Timestamp:
- Jan 11, 2011, 11:47:27 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/ole32/ole2.c
r10432 r21554 562 562 563 563 hwndTrackWindow = CreateWindowA(OLEDD_DRAGTRACKERCLASS, 564 565 566 567 568 569 570 571 564 "TrackerWindow", 565 WS_POPUP, 566 CW_USEDEFAULT, CW_USEDEFAULT, 567 CW_USEDEFAULT, CW_USEDEFAULT, 568 0, 569 0, 570 0, 571 (LPVOID)&trackerInfo); 572 572 573 573 if (hwndTrackWindow!=0) … … 588 588 { 589 589 if ( (msg.message >= WM_KEYFIRST) && 590 590 (msg.message <= WM_KEYLAST) ) 591 591 { 592 592 #ifdef __WIN32OS2__ 593 593 dprintf(("dragloop: key msg %x\n", msg.message)); 594 594 #endif 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 595 /* 596 * When keyboard messages are sent to windows on this thread, we 597 * want to ignore notify the drop source that the state changed. 598 * in the case of the Escape key, we also notify the drop source 599 * we give it a special meaning. 600 */ 601 if ( (msg.message==WM_KEYDOWN) && 602 (msg.wParam==VK_ESCAPE) ) 603 { 604 trackerInfo.escPressed = TRUE; 605 } 606 607 /* 608 * Notify the drop source. 609 */ 610 OLEDD_TrackStateChange(&trackerInfo, 611 msg.pt, 612 OLEDD_GetButtonState()); 613 613 } 614 614 else … … 617 617 dprintf(("dragloop: dispmsg %x\n", msg.message)); 618 618 #endif 619 620 621 622 619 /* 620 * Dispatch the messages only when it's not a keyboard message. 621 */ 622 DispatchMessageA(&msg); 623 623 } 624 624 } … … 1524 1524 } 1525 1525 } 1526 } 1526 } 1527 1527 1528 1528 WARN_(accel)("couldn't translate accelerator key\n"); … … 1559 1559 DeleteFileW(pmedium->u.lpszFileName); 1560 1560 } 1561 1561 1562 1562 CoTaskMemFree(pmedium->u.lpszFileName); 1563 1563 } … … 1896 1896 * Track the movement of the mouse. 1897 1897 */ 1898 1898 #ifdef __WIN32OS2__ 1899 1899 wParam = OLEDD_GetButtonState(); 1900 1900 #endif 1901 1901 OLEDD_TrackMouseMove(trackerInfo, mousePos, wParam); 1902 1902 … … 2001 2001 #endif 2002 2002 IDropTarget_DragOver(trackerInfo->curDragTarget, 2003 2004 2005 2003 keyState, 2004 mousePosParam, 2005 trackerInfo->pdwEffect); 2006 2006 #ifdef __WIN32OS2__ 2007 TRACE("OLEDD_TrackMouseMove: IDropTarget_DragEnter -> %x, *pdwEffect=%x\n", hr, *trackerInfo->pdwEffect);2007 TRACE("OLEDD_TrackMouseMove: IDropTarget_DragOver -> %x, *pdwEffect=%x\n", hr, *trackerInfo->pdwEffect); 2008 2008 #endif 2009 2009 } … … 2039 2039 2040 2040 do { 2041 newDropTargetNode = OLEDD_FindDropTarget(nexttar); 2042 } while (!newDropTargetNode && (nexttar = GetParent(nexttar)) != 0); 2043 if(nexttar) hwndNewTarget = nexttar; 2041 newDropTargetNode = OLEDD_FindDropTarget(nexttar); 2042 } 2043 while (!newDropTargetNode && (nexttar = GetParent(nexttar)) != 0); 2044 2045 if (nexttar) 2046 hwndNewTarget = nexttar; 2044 2047 2045 2048 trackerInfo->curDragTargetHWND = hwndNewTarget; … … 2051 2054 if (trackerInfo->curDragTarget!=0) 2052 2055 { 2053 POINTL mousePosParam;2054 2055 /*2056 * The documentation tells me that the coordinate should be in the target2057 * window's coordinate space. However, the tests I made tell me the2058 * coordinates should be in screen coordinates.2059 */2060 mousePosParam.x = mousePos.x;2061 mousePosParam.y = mousePos.y;2062 2056 POINTL mousePosParam; 2057 2058 /* 2059 * The documentation tells me that the coordinate should be in the target 2060 * window's coordinate space. However, the tests I made tell me the 2061 * coordinates should be in screen coordinates. 2062 */ 2063 mousePosParam.x = mousePos.x; 2064 mousePosParam.y = mousePos.y; 2065 2063 2066 #ifdef __WIN32OS2__ 2064 2067 hr = 2065 2068 #endif 2066 IDropTarget_DragEnter(trackerInfo->curDragTarget,2067 2068 2069 2070 2069 IDropTarget_DragEnter(trackerInfo->curDragTarget, 2070 trackerInfo->dataObject, 2071 keyState, 2072 mousePosParam, 2073 trackerInfo->pdwEffect); 2071 2074 #ifdef __WIN32OS2__ 2072 2075 TRACE("OLEDD_TrackMouseMove: IDropTarget_DragEnter -> %x, *pdwEffect=%x\n", hr, *trackerInfo->pdwEffect); … … 2189 2192 switch (trackerInfo->returnValue) 2190 2193 { 2191 /*2192 * If the source wants us to complete the operation, we tell2193 * the drop target that we just dropped the object in it.2194 */2194 /* 2195 * If the source wants us to complete the operation, we tell 2196 * the drop target that we just dropped the object in it. 2197 */ 2195 2198 case DRAGDROP_S_DROP: 2196 2197 2198 2199 /*2200 * The documentation tells me that the coordinate should be2201 * in the target window's coordinate space. However, the tests2202 * I made tell me the coordinates should be in screen coordinates.2203 */2204 mousePosParam.x = mousePos.x;2205 mousePosParam.y = mousePos.y;2206 2207 IDropTarget_Drop(trackerInfo->curDragTarget,2208 trackerInfo->dataObject,2209 keyState,2210 mousePosParam,2211 trackerInfo->pdwEffect);2212 break;2213 2214 /*2215 * If the source told us that we should cancel, fool the drop2216 * target by telling it that the mouse left it's window.2217 * Also set the drop effect to "NONE" in case the application2218 * ignores the result of DoDragDrop.2219 */2199 { 2200 POINTL mousePosParam; 2201 2202 /* 2203 * The documentation tells me that the coordinate should be 2204 * in the target window's coordinate space. However, the tests 2205 * I made tell me the coordinates should be in screen coordinates. 2206 */ 2207 mousePosParam.x = mousePos.x; 2208 mousePosParam.y = mousePos.y; 2209 2210 IDropTarget_Drop(trackerInfo->curDragTarget, 2211 trackerInfo->dataObject, 2212 keyState, 2213 mousePosParam, 2214 trackerInfo->pdwEffect); 2215 break; 2216 } 2217 /* 2218 * If the source told us that we should cancel, fool the drop 2219 * target by telling it that the mouse left it's window. 2220 * Also set the drop effect to "NONE" in case the application 2221 * ignores the result of DoDragDrop. 2222 */ 2220 2223 case DRAGDROP_S_CANCEL: 2221 2222 2223 2224 IDropTarget_DragLeave(trackerInfo->curDragTarget); 2225 *trackerInfo->pdwEffect = DROPEFFECT_NONE; 2226 break; 2224 2227 2225 2228 #ifdef __WIN32OS2__ … … 2699 2702 IEnumFORMATETCImpl* ef; 2700 2703 DWORD size=cfmt * sizeof(FORMATETC); 2701 2704 2702 2705 ef=(IEnumFORMATETCImpl*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IEnumFORMATETCImpl)); 2703 2706 … … 2855 2858 ICOM_VTBL(dto) = &dtovt; 2856 2859 } 2857 2860 2858 2861 return (LPDATAOBJECT)dto; 2859 2862 } … … 2959 2962 { 2960 2963 ICOM_THIS(IDataObjectImpl,iface); 2961 2964 2962 2965 dprintf(("IDataObject_fnGetDataHere %x %x STUB", pformatetc, pmedium)); 2963 2966 return E_NOTIMPL; … … 2968 2971 ICOM_THIS(IDataObjectImpl,iface); 2969 2972 UINT i; 2970 2973 2971 2974 dprintf(("IDataObject_fnQueryGetData (%p)->(fmt=0x%08x tym=0x%08lx)\n", This, pformatetc->cfFormat, pformatetc->tymed)); 2972 2975 2973 2976 if(!(DVASPECT_CONTENT & pformatetc->dwAspect)) 2974 2977 return DV_E_DVASPECT; … … 2993 2996 { 2994 2997 ICOM_THIS(IDataObjectImpl,iface); 2995 2998 2996 2999 dprintf(("IDataObject_fnGetCanonicalFormatEtc STUB")); 2997 3000 return DATA_S_SAMEFORMATETC; … … 3075 3078 return (*ppenumFormatEtc) ? S_OK : E_FAIL; 3076 3079 } 3077 3080 3078 3081 return E_NOTIMPL; 3079 3082 } … … 3433 3436 if(IDataObject_EnumFormatEtc(pDataObject, DATADIR_GET, &enumfmt) == S_OK) { 3434 3437 for (;;) { 3435 3438 3436 3439 FORMATETC tmp; 3437 3440 ULONG actual = 1, res; … … 3621 3624 ICOM_VTBL(dto) = &droptarget; 3622 3625 } 3623 3626 3624 3627 return (IDropTarget *)dto; 3625 3628 }
Note:
See TracChangeset
for help on using the changeset viewer.