PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → [WD20] Drag and Drop multiple MDI child programs
[WD20] Drag and Drop multiple MDI child programs
Iniciado por guest, 24,mar. 2016 17:29 - 2 respuestas
Publicado el 24,marzo 2016 - 17:29
Hi,

I have two MDI child programs. On each program I can drop a file (or multiple files) from windows explorer. But If i do this and both programs are open then both events voor handling the dropped files are executed. How to prevent this. Only the event in the program where the files are dropped should be executed.

In the global declaration of the programs 1 I use:

ExplorerAccept(True)
Event(GetFiles,"*.",563)

In the global declaration of the programs 2 I use:
ExplorerAccept(True)
Event(DoSomething,"*.",563)


When program 1 en 2 are open and program 2 have focus, dropping files also execute Event Getfiles in program 1.

Regards,
Herro
Publicado el 24,marzo 2016 - 18:34
Hi Herro,

you can probably:
- test if you have the focus or not and therefore accept the file or not (a flag in the get focus/loose focus codes)
- test if the mouse position was over your window (don't know what would happen if both program were stacked, though)

Best regards
Publicado el 24,marzo 2016 - 22:34
Hi Fabrice,

Setting a flag (boolean) in the get focus/loose focus an check on this flag works fine.

Thanks.

Best regards

Herro Wijnholds
Pragmata B.V.