1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-07-01 13:50:36 +00:00

Adds _ACCEPTFILEDROP as a function to return true (-1) if active/enabled.

Returns 0 otherwise.
This commit is contained in:
FellippeHeitor 2018-07-31 22:23:34 -03:00
parent ce2d3d4a2f
commit 5e0ff36205
3 changed files with 20 additions and 2 deletions

View file

@ -233,6 +233,7 @@ int32 force_display_update=0;
void sub__delay(double seconds);
void *generic_window_handle=NULL;
int32 acceptFileDrop=0;
#ifdef QB64_WINDOWS
HWND window_handle=NULL;
HDROP hdrop=NULL;
@ -26507,13 +26508,21 @@ void sub__echo(qbs *message){
void sub__filedrop(int32 on_off=NULL) {
#ifdef QB64_WINDOWS
if ((on_off==NULL)||(on_off==1))
if ((on_off==NULL)||(on_off==1)) {
DragAcceptFiles((HWND)func__handle(), TRUE);
if ((on_off==2))
acceptFileDrop=-1;
}
if ((on_off==2)) {
DragAcceptFiles((HWND)func__handle(), FALSE);
acceptFileDrop=0;
}
#endif
}
int32 func__filedrop() {
return acceptFileDrop;
}
void sub__finishdrop() {
#ifdef QB64_WINDOWS
DragFinish(hdrop);

View file

@ -100,6 +100,7 @@ uint8**out_data,int32*out_x,int32 *out_y,int32*out_x_pre_increment,int32*out_x_p
extern void sub__title(qbs *title);
extern void sub__echo(qbs *message);
extern void sub__finishdrop();
extern int32 func__filedrop();
extern void sub__filedrop(int32 on_off=NULL);
extern int32 func__totaldroppedfiles();
extern qbs *func__droppedfile(int32 fileIndex, int32 passed);

View file

@ -908,6 +908,14 @@ id.specialformat = "[{ON|OFF}]"
id.NoCloud = 1
regid
clearid
id.n = "_ACCEPTFILEDROP"
id.subfunc = 1
id.callname = "func__filedrop"
id.ret = LONGTYPE - ISPOINTER
id.NoCloud = 1
regid
clearid
id.n = "_FINISHDROP"
id.subfunc = 2