Jump to content
Fórum Script Brasil
  • 0

Drop Explorer windows 10


Question

Olá bom dia..

Estou aqui de novo precisando de ajuda...
Estou com o seguinte problema:

Com este código abaixo, Me possibilita arrastar do Explorer e adicionar em um ListBox.

uses
  Winapi.ShellApi;

type
  TMyform = class(TForm)
  ...
  protected
    procedure WMDropFiles(var Message: TWMDropFiles); message WM_DROPFILES;
  ...
  end;

procedure TMyform.WMDropFiles(var Message: TWMDropFiles);
var
  numfiles: integer;
  buf: array[0..MAX_PATH] of char;
begin
  numfiles := DragQueryFile(Message.Drop,$FFFFFFFF,nil,0);
  if numfiles>0 then begin
    Application.BringToFront;
    // only open 1 file at a time
    // - you could open more than 1 file
    // at a time by looping thru numfiles
    DragQueryFile(Message.Drop,0,buf,MAX_PATH);

    { call some method which opens the file
      - buf gets automatically
      typecast to a string if necessary }
    ListBox1.Items.Add(buf);

    DragFinish(Message.Drop); // clean up
  end;
end;
no formCreatte
    DragAcceptFiles(Handle, true);
e no formDestroy
    DragAcceptFiles(Handle, false);

o problema se eu executar o aplicar como administrador, não adiciona no listbox, isso só acontece no windows 10 já no windows 7 ultimate funcionar tudo normal.

Será alguém aqui pode da uma ideia do que pode ser ?!

 

Obrigado pela atenção...

Link to post
Share on other sites

1 answer to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      148681
    • Total Posts
      644509
×
×
  • Create New...