#include <windows.h>
#include <stdlib.h>
#include <stdio.h>
#include <tchar.h>
Go to the source code of this file.
|
#define | _wsplitpath_s(f, d, dl, p, pl, n, nl, e, el) _wsplitpath(f, d, p, n, e) |
|
#define | _splitpath_s(f, d, dl, p, pl, n, nl, e, el) _splitpath(f, d, p, n, e) |
|
◆ _splitpath_s
#define _splitpath_s |
( |
|
f, |
|
|
|
d, |
|
|
|
dl, |
|
|
|
p, |
|
|
|
pl, |
|
|
|
n, |
|
|
|
nl, |
|
|
|
e, |
|
|
|
el |
|
) |
| _splitpath(f, d, p, n, e) |
◆ _wsplitpath_s
#define _wsplitpath_s |
( |
|
f, |
|
|
|
d, |
|
|
|
dl, |
|
|
|
p, |
|
|
|
pl, |
|
|
|
n, |
|
|
|
nl, |
|
|
|
e, |
|
|
|
el |
|
) |
| _wsplitpath(f, d, p, n, e) |
◆ _tmain()
Definition at line 23 of file notificationtest.c.
24{
26 {
28 return -1;
29 }
30
32
33 return 0;
34}
void WatchDirectory(LPTSTR)
◆ RefreshDirectory()
◆ RefreshTree()
◆ WatchDirectory()
Definition at line 36 of file notificationtest.c.
37{
43
45
46 lpDrive[2] = (
TCHAR)
'\\';
47 lpDrive[3] = (
TCHAR)
'\0';
48
49
50
52 lpDir,
55
57 {
58 printf(
"\n ERROR: FindFirstChangeNotification function failed.\n");
60 }
61
62
63
65 lpDrive,
68
70 {
71 printf(
"\n ERROR: FindFirstChangeNotification function failed.\n");
73 }
74
75
76
77
78 if ((dwChangeHandles[0] ==
NULL) || (dwChangeHandles[1] ==
NULL))
79 {
80 printf(
"\n ERROR: Unexpected NULL from FindFirstChangeNotification.\n");
82 }
83
84
85
86
88 {
89
90
91 printf(
"\nWaiting for notification...\n");
92
95
96 switch (dwWaitStatus)
97 {
99
100
101
102
105 {
106 printf(
"\n ERROR: FindNextChangeNotification function failed.\n");
108 }
109 break;
110
112
113
114
115
118 {
119 printf(
"\n ERROR: FindNextChangeNotification function failed.\n");
121 }
122 break;
123
125
126
127
128
129
130
131 printf(
"\nNo changes in the timeout period.\n");
132 break;
133
134 default:
135 printf(
"\n ERROR: Unhandled dwWaitStatus.\n");
137 break;
138 }
139 }
140}
BOOL WINAPI FindNextChangeNotification(IN HANDLE hChangeHandle)
#define INVALID_HANDLE_VALUE
VOID WINAPI ExitProcess(IN UINT uExitCode)
void RefreshDirectory(LPTSTR)
DWORD WINAPI WaitForMultipleObjects(IN DWORD nCount, IN CONST HANDLE *lpHandles, IN BOOL bWaitAll, IN DWORD dwMilliseconds)
DWORD WINAPI GetLastError(void)
#define FindFirstChangeNotification
#define FILE_NOTIFY_CHANGE_FILE_NAME
#define FILE_NOTIFY_CHANGE_DIR_NAME
Referenced by _tmain().