PC SOFT

WINDEV的在线文档

  • Overview
  • Principle
  • Functions specific to the Drag and Drop from the explorer
  • Programming
  • Enabling the management of Drag and Drop from the explorer to the window
  • Processing the "dropped" files
文档页面当前正在翻译。对于此延迟我们深表歉意。
您可以自愿地帮助我们翻译您想要的文档段落,然后只需通过以下地址与我们联系:info@cn.windev.com
产品
WinDevWebDev-服务器代码WebDev-浏览器代码WinDev Mobile报表和查询
平台
WindowsLinuxWindows MobileWindows PhoneWindows Store appsAndroidAndroid Widget iPhone/iPad
语言
JavaPHPAjax用户代码(MCU)外部语言
数据库
HFSQLHFSQL Client/Server存储过程HF 5.5OLE DBODBC本地访问

Drag and Drop from the explorer

Overview
The Drag and Drop from the explorer consists in selecting one or more files in the Windows explorer and in transferring them into a control of a WinDev window.

For example, the "WD Drag and Drop" example is used to display the image files "dropped" from the explorer.

Principle
To allow Drag and Drop to be performed from the explorer to a WinDev application, the different steps are as follows:
  1. Enable the ability to perform a Drag and Drop from the explorer (浏览器接受).
  2. To process the action performed by the user, associate a WLangage procedure with the drop of the file in the window (事件).
  3. In the procedure called whenever a file is dropped in the window, retrieve the characteristics of the "dropped" file with 浏览器获取.

Functions specific to the Drag and Drop from the explorer
The following functions are used to manage Drag and Drop from the Windows explorer to a window of a WinDev application.
09版本和更高版本
浏览器接受
09新版本
浏览器接受
浏览器接受
Enables or disables the ability to perform "Drag and Drop" from the Windows explorer to a WinDev window or control.
09版本和更高版本
浏览器获取
09新版本
浏览器获取
浏览器获取
Retrieves the number and the name of the files "dropped" from the explorer.

Programming

Enabling the management of Drag and Drop from the explorer to the window

To enable the ability to perform Drag and Drop from the explorer to a window, you must declare in the initialization code of the window:
  • the implementation of Drag and Drop,
  • the event used to link a specific WLanguage procedure (GetFiles in our example) to the drop action (Windows event WM_DROPFILES equal to 563). This procedure is a procedure local to the window.
    浏览器接受""
    事件"GetFiles""*."563

Processing the "dropped" files

In the procedure called whenever files are "dropped" in the window, you have the ability to get information and to process the relevant files.

In our example, 浏览器获取 allows you to:

  • find out the number of files "dropped" from the explorer,
  • retrieve the name and the path of each file and display it in a new window.

// Number of files dropped in the application by Drag and Drop
NbFile整数型浏览器获取事件.wParam
sFileName字符串型
// Retrieve all the files
对于i1直到NbFile
sFileName浏览器获取事件.wParami
OpenImagesFileName
结束