Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
File (filename) dropping unto the _SCREEN object
Message
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01454355
Message ID:
01454356
Views:
78
Check http://www.berezniker.com/display/VFP/Copy+Files+to+Clipboard though not sure if applicable for this problem.

>Hi,
>
>I am trying to enable the _SCREEN object so that it receives file names as an OLE Drop from a Windows Explorer Drag. I have no problems being able to do this unto a regular FORM, however, it is the main VFP SCREEN that I want to do this with. Running the code below doesn't result in errors but it also doesn't trigger anything.
>
>
>
>_SCREEN.OLEDROPMODE = 1
>*!*_SCREEN.OLEDROPEFFECTS = 4
>
>oScrOleDrop = CREATEOBJECT("ScrOleDrop")
>BINDEVENT(_SCREEN,"OLEDragDrop",oScrOleDrop,"OLEDRAGDROP")
>BINDEVENT(_SCREEN,"OLEDragOver",oScrOleDrop,"OLEDRAGOVER")
>
>DEFINE CLASS ScrOleDrop AS Custom
>	PROCEDURE OLEDRAGDROP
>	LPARAMETERS oDataObject, nEffect, nButton, nShift, nXCoord, nYCoord
>	IF oDataObject.GETFORMAT(15) && File list from Windows Explorer
>		LOCAL laFiles(1)
>		oDataObject.GETDATA(15,@laFiles)
>		FOR EACH lcFile IN laFiles
>			WAIT WINDOW lcFile	&& For testing... will be substituted
>		NEXT
>	ENDIF
>	ENDPROC
>
>	PROCEDURE OLEDRAGOVER
>	LPARAMETERS oDataObject, nEffect, nButton, nShift, nXCoord, nYCoord, nState
>	DO CASE
>		CASE nState == 0	&& DRAG_ENTER
>			IF oDataObject.Getformat(15)   && File list from Windows Explorer
>				_SCREEN.OLEDropHasData = 1 && DROPHASDATA_USEFUL
>				_SCREEN.OLEDropEffects = 4 && 1=Copy, 2=Move, 4=Link
>
>				THIS.OLEDropHasData = 1 && DROPHASDATA_USEFUL
>				THIS.OLEDropEffects = 4 && 1=Copy, 2=Move, 4=Link
>
>				nEffect = 4
>			ENDIF
>		CASE nState == 1	&& DRAG_LEAVE
>	*!*	CASE nState == DRAG_OVER
>	*!*		WAIT WINDOW "Drag over"
>	ENDCASE
>	ENDPROC
>ENDDEFINE
>
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform