dirnotify.h
来自「Dir Notify Mointor」· C头文件 代码 · 共 73 行
H
73 行
//---------------------------------------------------------------------------
#ifndef DirNotifyH
#define DirNotifyH
//---------------------------------------------------------------------------
#include <SysUtils.hpp>
#include <Controls.hpp>
#include <Classes.hpp>
#include <Forms.hpp>
//---------------------------------------------------------------------------
class TNotificationThread;
typedef Shortint TNotifyFilter;
namespace TNotifyFilters
{
static const Shortint nfFileName = FILE_NOTIFY_CHANGE_FILE_NAME;
static const Shortint nfDirName = FILE_NOTIFY_CHANGE_DIR_NAME;
static const Shortint nfAttributes = FILE_NOTIFY_CHANGE_ATTRIBUTES;
static const Shortint nfSize = FILE_NOTIFY_CHANGE_SIZE;
static const Shortint nfLastWrite = FILE_NOTIFY_CHANGE_LAST_WRITE;
static const Shortint nfSecurity = FILE_NOTIFY_CHANGE_SECURITY;
}
//---------------------------------------------------------------------------
class PACKAGE TDirNotify : public TComponent
{
private:
bool FEnabled;
bool FWatchSubTree;
AnsiString FPath;
TNotifyFilter FFilter;
TNotifyEvent FOnChange;
TNotificationThread *FNotificationThread;
void __fastcall SetEnabled(bool Value);
void __fastcall SetFilter(Shortint Value);
void __fastcall SetOnChange(TNotifyEvent Value);
void __fastcall SetPath(AnsiString Value);
void __fastcall SetWatchSubTree(bool Value);
void __fastcall RecreateThread(TObject *Sender);
protected:
public:
__fastcall TDirNotify(TComponent* Owner);
void __fastcall Change(void);
__published:
__property bool Enabled = {read = FEnabled, write = SetEnabled, default = 0};
__property TNotifyFilter Filter = {read = FFilter, write = SetFilter, nodefault};
__property TNotifyEvent OnChange = {read = FOnChange, write = SetOnChange};
__property AnsiString Path = {read = FPath, write = SetPath};
__property bool WatchSubTree = {read = FWatchSubTree, write = SetWatchSubTree};
};
//---------------------------------------------------------------------------
class TNotificationThread : public TThread
{
private:
TDirNotify *DirNotifyOwner;
protected:
void __fastcall Execute();
public:
__fastcall TNotificationThread (bool CreateSuspended, TObject *Sender);
void __fastcall DoChange(void);
};
//---------------------------------------------------------------------------------
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?