Drag open file

xiaoxiao2021-03-06  57

Description: DragDropfiles is a message letter defined in a function declaration

DragQueryFile and DragFinish are all API functions, and they are referenced to the shellapi unit on the PAS head before calling.

OpenFile is a function you really use to open the file, and the other is to get the file name of the file that is dragged in.

Procedure Dragdropfiles (Var Message: TMESSAGE); Message WM_Dropfiles;

Procedure tfm_main.dragdropfiles; var p: array [0..254] of char; i: word; begin inherited; i: = dragqueryfile (Message.WParam, $ fffffff, nil, 0); for i : = 0 to i - 1 DO Begin Dragqueryfile (Message.WParam, I, P, 255); END; TRPAS (P)) Then OpenFile (StrPas (P)); Finally Dragfinish (HDrop (Merssis (Mssage.WParam) ));

转载请注明原文地址:https://www.9cbs.com/read-118407.html

New Post(0)