⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 unit2.pas

📁 在delphi中实现windows核心编程.原书光盘代码核心编程.原书光盘代码
💻 PAS
字号:
unit Unit2;

interface

uses
  Classes, SysUtils, windows;

type
  TFileChangeNotify = class(TThread)
  private

  protected
    procedure Execute; override;
    procedure filenotify; 
  end;
var
  qh1: thandle;
implementation

uses
  unit1;

procedure TFileChangeNotify.filenotify;
begin
  form1.refreshlist;
end;

procedure TFileChangeNotify.Execute;
var
  pdir: array[0..10] of char;
  st: integer;
begin
  freeOnTerminate:=true;
  strcopy(pdir,pchar(form1.combobox1.items[form1.combobox1.itemindex]));
  qh1 := 0;
  qh1 := FindFirstChangeNotification(pdir, True, FILE_NOTIFY_CHANGE_LAST_WRITE);
  while not Terminated do
  begin
    st := WaitForSingleObject(qh1, INFINITE);
    if Terminated then break;
    if st = WAIT_OBJECT_0 then
    begin
      Synchronize(filenotify);
      SHUpdateRecycleBinIcon;
    end;
    if not findnextchangenotification(qh1) then Terminate;
  end;
end;


end.

 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -