IF pip<0 THEN f=form_error(ABS(pip)-31) : GOTO mm:
REM the dragdrop command can fail...
'cc$=CHR$(1)
'm&=fwrite&(pip,1&,VARPTR(cc$))
'goto mm:
REM but we choose to continue
cc$=CHR$(0)
m&=fwrite&(pip,1&,VARPTR(cc$))
IF mess(3)=m_handle THEN tree=MAIN3
j=rsrc_gaddr(0,tree,tree&)
myobject=objc_find(tree&,0,2,mess(4),mess(5))
IF mess(3)=m_handle THEN
j=objc_change(tree&,myobject,PEEKW(tree&+ob_x),PEEKW(tree&+ob_y),PEEKW(tree&+ob_width),PEEKW(tree&+ob_height),(PEEKW(tree&+ob_sizeof*myobject+ob_state) AND &HFFFE)+1,1)
END IF
REM mess(0)=ap_dragdrop
REM mess(1)=sender's ap_id
REM mess(2)=0
REM mess(3)=handle of window dropped on
REM mess(4)=X pos of mouse when dropped
REM mess(5)=Y pos of mouse at time of drop
REM mess(6)=shift keys(control,shift, alt,etc..) state when dropped
REM mess(7)=?? for U:\PIPE\DRAGDROP.??
REM 32 byte string of supported filenames andor ARGS+PATH e.g .EXT, ARGS, PATH
cc$="ARGS.TXT.MOD"+STRING$(20,0) : REM unused bytes filled with chr$(0)
REM THIS window does not accept PATH
m&=fwrite&(pip,LEN(cc$),VARPTR(cc$))
REM read a word then read header
redo:
cc$=STRING$(2,0)
m&=fread&(pip,LEN(cc$),VARPTR(cc$))
IF m&<1 THEN GOTO mm: REM originator aborted dragdrop:
n=PEEKW(VARPTR(cc$))
cc$=STRING$(n,0) : REM about to read an n byte header.
m&=fread&(pip,n,VARPTR(cc$))
IF m&<1 THEN GOTO mm: REM fault:
REM now for the fun bit!
cconws LEFT$(cc$,4)+CHR$(0)
cconws STR$(PEEKL(VARPTR(cc$)+4))+CHR$(0)
output$=STRING$(PEEKL(VARPTR(cc$)+4),0)
iconname$="" : filename$="" : n=8
geticonname:
IF PEEKB(VARPTR(cc$)+n)=0 THEN INCR n : GOTO getfilename:
iconname$=iconname$+CHR$(PEEKB(VARPTR(cc$)+n)) : INCR n : GOTO geticonname:
getfilename:
IF PEEKB(VARPTR(cc$)+n)=0 THEN GOTO getout:
filename$=filename$+CHR$(PEEKB(VARPTR(cc$)+n)) : INCR n : GOTO getfilename:
getout:
cconws iconname$+CHR$(0)
cconws filename$+CHR$(0)
' if we supported PATH. This program does not recieve "PATH" because
' the window is not a directory window like those of the desktop.
'
' this is what the desktop might do if a file was dragged from an
' application to one of it's windows.
'
' IF left$(cc$,4)="PATH"
' path$="C:\FILES\"+chr$(0) rem save file here (from the title bar of a desktop window)
' if PEEKL(VARPTR(cc$)+4)<len(path$) then gg&=PEEKL(VARPTR(cc$)+4) : rem note to originator applications, this would cause a problem, an incomplete path would be transferred.
' if len(path$)<PEEKL(VARPTR(cc$)+4) then gg&=len(path$)
' if len(path$)=PEEKL(VARPTR(cc$)+4) then gg&=len(path$)
' r&=fwrite&(pip,gg&,varptr(path$))
' goto mm: rem fclose(pip)
IF LEFT$(cc$,4)="ARGS" OR LEFT$(cc$,1)="." THEN cc$=CHR$(myobject) : ELSE cc$=CHR$(2) : m&=fwrite&(pip,1&,VARPTR(cc$)) : GOTO redo:
m&=fwrite&(pip,1&,VARPTR(cc$))
REM if myobject=0 then continue...
IF myobject=1 THEN GOTO mm: REM abort
IF myobject=2 THEN GOTO redo: REM I cannnot accept data in this file format e.g. .???, try another format.
IF myobject=3 THEN GOTO redo: REM I cannot accept this much data (I.e. out of memory), try with less data to be sent.
IF myobject=4 THEN GOTO mm: REM Delete data
IF myobject=5 THEN GOTO mm: REM Print data
IF myobject=6 THEN GOTO mm: REM Copy data to clipboard
m&=fread&(pip,LEN(output$),VARPTR(output$))
j=form_alert(1,"[4][Path to load module from|"+output$+"][OK]")
mm:
IF mess(3)=M_handle THEN
j=objc_change(tree&,myobject,PEEKW(tree&+ob_x),PEEKW(tree&+ob_y),PEEKW(tree&+ob_width),PEEKW(tree&+ob_height),(PEEKW(tree&+ob_sizeof*myobject+ob_state) AND &HFFFE),1)