if (dataTypes.length == 0) return false;  event.widget = this; event.x = pt_x; event.y = pt_y; event.time = OS.GetMessageTime(); event.feedback = DND.FEEDBACK_SELECT; event.dataTypes = dataTypes; event.dataType = dataTypes[0]; event.operations = operations[0]; event.detail = operation; return true; }
private boolean setEventData(DNDEvent event, int pDataObject, int grfKeyState, int pt_x, int pt_y, int pdwEffect) {		if (pDataObject == 0 || pdwEffect == 0) return false;		// get allowed operations	int style = getStyle();	int[] operations = new int[1];	OS.MoveMemory(operations, pdwEffect, 4);	operations[0] = osToOp(operations[0]) & style;	if (operations[0] == DND.DROP_NONE) return false;		// get current operation	int operation = getOperationFromKeyState(grfKeyState);	keyOperation = operation;	if (operation == DND.DROP_DEFAULT) {		if ((style & DND.DROP_DEFAULT) == 0) {			operation = (operations[0] & DND.DROP_MOVE) != 0 ? DND.DROP_MOVE : DND.DROP_NONE;		}	} else {		if ((operation & operations[0]) == 0) operation = DND.DROP_NONE;	}		// Get allowed transfer types	TransferData[] dataTypes = new TransferData[0];	IDataObject dataObject = new IDataObject(pDataObject);	dataObject.AddRef();	try {		int[] address = new int[1];		if (dataObject.EnumFormatEtc(COM.DATADIR_GET, address) != COM.S_OK) {			return false;		}		IEnumFORMATETC enum = new IEnumFORMATETC(address[0]);		try {			// Loop over enumerator and save any types that match what we are looking for			int rgelt = OS.GlobalAlloc(OS.GMEM_FIXED | OS.GMEM_ZEROINIT, FORMATETC.sizeof);			try {				int[] pceltFetched = new int[1];				enum.Reset();				while (enum.Next(1, rgelt, pceltFetched) == COM.S_OK && pceltFetched[0] == 1) {					TransferData transferData = new TransferData();					transferData.formatetc = new FORMATETC();					COM.MoveMemory(transferData.formatetc, rgelt, FORMATETC.sizeof);					transferData.type = transferData.formatetc.cfFormat;					transferData.pIDataObject = pDataObject;					for (int i = 0; i < transferAgents.length; i++){						if (transferAgents[i].isSupportedType(transferData)){							TransferData[] newDataTypes = new TransferData[dataTypes.length + 1];							System.arraycopy(dataTypes, 0, newDataTypes, 0, dataTypes.length);							newDataTypes[dataTypes.length] = transferData;							dataTypes = newDataTypes;							break;						}					}				}			} finally {				OS.GlobalFree(rgelt);			}		} finally {			enum.Release();		}	} finally {		dataObject.Release();	}