Search results for 'Extract Filenames from Clipboard'. 1 post(s) found.
- 2007/09/20 How to Get Filenames from Clipboard ?
"If I use the Windows Explorer to copy a file, how can I use the paste function in my application?"
This code retrieves the filenames from the Clipboard to a memo component. Drop a memo and a button on a form and set the OnClick of a button to:
uses
clipbrd, shellapi;
procedure TForm1.Button1Click(Sender: TObject) ;
var
f: THandle;
buffer: Array [0..MAX_PATH] of Char;
i, numFiles: Integer;
begin
Clipboard.Open;
try
f:= Clipboard.GetAsHandle( CF_HDROP ) ;
If f <> 0 Then Begin
numFiles := DragQueryFile( f, $FFFFFFFF, nil, 0 ) ;
memo1.Clear;
for i:= 0 to numfiles - 1 do begin
buffer[0] := #0;
DragQueryFile( f, i, buffer, sizeof(buffer)) ;
memo1.lines.add( buffer ) ;
end;
end;
finally
Clipboard.close;
end;
end;
clipbrd, shellapi;
procedure TForm1.Button1Click(Sender: TObject) ;
var
f: THandle;
buffer: Array [0..MAX_PATH] of Char;
i, numFiles: Integer;
begin
Clipboard.Open;
try
f:= Clipboard.GetAsHandle( CF_HDROP ) ;
If f <> 0 Then Begin
numFiles := DragQueryFile( f, $FFFFFFFF, nil, 0 ) ;
memo1.Clear;
for i:= 0 to numfiles - 1 do begin
buffer[0] := #0;
DragQueryFile( f, i, buffer, sizeof(buffer)) ;
memo1.lines.add( buffer ) ;
end;
end;
finally
Clipboard.close;
end;
end;
Another posts included in "Delphi"
| Get system info (free memory, etc) (0) | 2007/09/20 |
| Get dimensions of usable space on monitor (work area) (0) | 2007/09/20 |
| Get text from the control at pos x,y on screen (0) | 2007/09/20 |
| How to Get Windows OS Version ? (0) | 2007/09/20 |
| Get Windows Temp directory (0) | 2007/09/20 |
| Disable ALT+TAB, CTRL+ESC, CTRL+ALT+DEL (0) | 2007/09/19 |
| Display Standard Windows Properties dialog (0) | 2007/09/19 |
| Disable Mouse and Keyboard from Delphi Code (0) | 2007/09/19 |
Trackback : Cannot send a trackbact to this post.
-
Subject different money making ideas
2010/01/29 00:07
moneyideas
-
Subject different money making ideas
2010/01/29 08:31
moneyideas
-
Subject different money making ideas
2010/01/31 16:40
moneyideas

Prev

Rss Feed