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

📄 tfisfilenotification.h

📁 计算文件的CRC校验(
💻 H
字号:
//---------------------------------------------------------------------------
#ifndef TfisFileNotificationH
#define TfisFileNotificationH
//---------------------------------------------------------------------------
#include <SysUtils.hpp>
#include <Controls.hpp>
#include <Classes.hpp>
#include <Forms.hpp>
//---------------------------------------------------------------------------
class TDirThread : public TThread
{
private:
    AnsiString prDirectory;
    HANDLE prKillEvent;
    bool prSubTree;
    DWORD prNotifyFilter;
    TTimer *prTimer;
protected:
    void __fastcall Execute();
public:
    __fastcall TDirThread(AnsiString aDirectory, bool aSubTree, DWORD aNotifyFilter,
        TTimer *aTimer);
    __fastcall ~TDirThread();
};
//---------------------------------------------------------------------------
enum TNotifyOption
{
    noFilename,
    noDirname,
    noAttributes,
    noSize,
    noLastWrite,
    noLastAccess,
    noCreation
};

typedef Set<TNotifyOption, noFilename, noCreation>  TNotifyOptions;
//---------------------------------------------------------------------------
class PACKAGE TfisFileNotification : public TComponent
{
private:
    bool prStarted;
    bool FSubTree;
    TNotifyOptions FOptions;
    AnsiString FDirectory;
    TNotifyEvent FOnDirectoryChanged;
    TDirThread *thrDirThread;
    TTimer *prTimer;
protected:
    void __fastcall Timer(TObject *Sender);
public:
    __fastcall TfisFileNotification(TComponent* Owner);
    __fastcall ~TfisFileNotification(void);
    void __fastcall Start(void);
    void __fastcall Stop(void);
__published:
    __property TNotifyEvent OnDirectoryChanged = {read = FOnDirectoryChanged,
        write = FOnDirectoryChanged};
    __property bool SubTree = {read = FSubTree, write = FSubTree,
        default = false};
    __property AnsiString Directory = {read = FDirectory, write = FDirectory};
    __property TNotifyOptions Notification = {read = FOptions, write = FOptions,
        default = noLastWrite};
};
//---------------------------------------------------------------------------
#endif

⌨️ 快捷键说明

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