// .cpp文件
#include “StdAfx.h“
#include “DirectoryWatch.h“
#include
#include
typedef enum
{
MSG_STARTWATCH = (WM_USER + 0x11)
MSG_STOPWATCH
MSG_EXITTHREAD
};
#define MAX_BUFFER_SIZE (1024)
typedef struct _tagWATCHPARAMETERS
{
_tagWATCHPARAMETERS()
{
hFile = INVALID_HANDLE_VALUE;
hEvent = NULL;
memset(&ol 0 sizeof(OVERLAPPED));
pBuffer = NULL;
dwBufferSize = 0;
bExit = FALSE;
pFn_NotifyAction = NULL;
}
HANDLE hFile;
HANDLE hEvent;
OVERLAPPED ol;
BYTE* pBuffer;
DWORD dwBufferSize;
BOOL bExit;
PFN_NotifyAction pFn_NotifyAction;
}WATCH_PARAMETERS *PWATCH_PARAMETERS;
CDirectoryWatch::CDirectoryWatch() : m_hFile(INVALID_HANDLE_VALUE) m_pThread(NULL)
{
memset(m_szDirectory 0 sizeof(m_szDirectory));
m_pThread = AfxBeginThread(ThreadProc NULL 0 CREATE_SUSPENDED 0 NULL);
if(NULL == m_pThread)
{
TRACE(“Error Code : %d\n“ GetLastError());
return ;
}
m_pThread->m_bAutoDelete
评论
共有 条评论