zoukankan      html  css  js  c++  java
  • Delphi 从剪贴板拷贝文件示例代码

    uses Windows, Clipbrd, ShellAPI ....;

    var
      DropHandle, DropEffect, Effect : HDROP;
      FileCount:Integer;
      Counter:Integer;
      FileName:array [0..MAX_PATH] of char;
    const
      DROPEFFECT_NONE   = 0;
      DROPEFFECT_COPY   = 1;
      DROPEFFECT_MOVE   = 2;
      DROPEFFECT_LINK   = 4;
      DROPEFFECT_SCROLL = $80000000;
    begin
      OpenClipboard(0);
      DropEffect := RegisterClipboardFormat('Preferred DropEffect');
      DropHandle := GetClipboardData(CF_HDROP);
      if DropHandle>0 then
      begin
        Effect := GetClipboardData(DropEffect);
        if Effect=0 then Effect := DROPEFFECT_COPY
        else Effect := PDWORD(Effect)^;
        case Effect of
          DROPEFFECT_COPY + DROPEFFECT_LINK:ShowMessage('Copy');
          DROPEFFECT_MOVE:ShowMessage('Move');
        end;
        FileCount:=DragQueryFile(DropHandle,Cardinal(-1),nil,0);
        for Counter := 0 to FileCount-1 do
        begin
          DragQueryFile(DropHandle, Counter, FileName, sizeof(FileName));
          ShowMessage(FileName);
        end;
      end;
      CloseClipboard;
    end;

  • 相关阅读:
    UIView+ViewController.h 点击控制器上视图,使视图push下个视图控制的封装
    Touch Demo
    layoutSubviews与drawRect
    UI NS CG CF 区别
    CALayer
    关于CALayer的困惑
    pypy 对接阿里短信平台
    mysql去掉默认值
    GCC升级
    jemalloc 测试
  • 原文地址:https://www.cnblogs.com/MaxWoods/p/1979270.html
Copyright © 2011-2022 走看看