网站首页  词典首页

请输入您要查询的函数:

 

术语 findfirstchangenotification
释义 FindFirstChangeNotification
语法:
C++
HANDLE WINAPI FindFirstChangeNotification(
__in LPCTSTR lpPathName,
__in BOOL bWatchSubtree,
__in DWORD dwNotifyFilter
);
FindFirstChangeNotification函数
创建更改通知处理,并设置了初步筛选条件变更通知。通知上的一个成功处理等待匹配更改时发生的筛选条件在指定的目录或子树。该函数不向指定的目录本身的变化。
此功能并不表明是满足等待条件的变化。检索有关作为通知的一部分具体变化信息,请使用ReadDirectoryChangesW函数。
参数
lpPathName [in]
该目录的完整路径密切加以注意。这不可能是一个相对路径或一个空字符串。
在此函数的ANSI版本,名称被限制为MAX_PATH字符。为了延长此限制,以32,767宽字符,调用的功能和前面加上“\\ Unicode版本\\?\\”的路径。有关更多信息,请参见命名一个文件。
bWatchSubtree [in]
如果此参数为TRUE,函数监测目录树在指定的目录根深蒂固,如果它是假,它可以监控一个指定的目录。
dwNotifyFilter [in]
该过滤器条件,满足更改通知等。此参数可以是一个或多个下列值。
ValueMeaning
FILE_NOTIFY_CHANGE_FILE_NAME
0x00000001Any文件在观看目录或子树名称的变更会导致更改通知等待操作返回。更改包括重命名,创建或删除一个文件名。
FILE_NOTIFY_CHANGE_DIR_NAME
0x00000002Any目录在观看目录或子树名称的变更会导致更改通知等待操作返回。更改包括创建或删除一个目录。
FILE_NOTIFY_CHANGE_ATTRIBUTES
在观看目录或树0x00000004Any属性的变化会导致更改通知等待操作返回。
FILE_NOTIFY_CHANGE_SIZE
0x00000008Any文件在观看目录或子树大小的变化会导致更改通知等待操作返回。作业系统检测到文件的大小改变只有当文件被写入到磁盘。对于操作系统,使用广泛的缓存,只有当检测时有足够的缓存刷新。
FILE_NOTIFY_CHANGE_LAST_WRITE
0x00000010Any改变过去写在观看目录或子树的文件时会导致更改通知等待操作返回。作业系统侦测到的变化最后写时间只有当文件被写入到磁盘。对于操作系统,使用广泛的缓存,只有当检测时有足够的缓存刷新。
FILE_NOTIFY_CHANGE_SECURITY
0x00000100Any保安在观看目录或树描述更改导致更改通知等待操作返回。
返回值
如果函数成功,返回值是一个句柄找到更改通知的对象。
如果函数失败,返回值是INVALID_HANDLE_VALUE。为了获得更多错误信息,调用GetLastError。
备注
在等待函数可以监视通过处理由FindFirstChangeNotification函数返回指定的目录或子树。等待是满足的时候,过滤器的条件之一,在被监测的目录或子树发生。
等待后得到满足,应用程序可以应对这一情况,并继续监测调用FindNextChangeNotification功能和适当的等待功能的目录。当处理不再需要,可以关闭使用FindCloseChangeNotification功能。
通知可能无法返回时,呼吁远程文件系统FindFirstChangeNotification。
符号链接的行为,如果路径指向一个符号链接,通知句柄创建为目标。
如果应用程序已注册接收目录,其中包含符号链接更改通知,该应用程序时,才通知的符号链接已被更改,而不是目标文件。
实例
有关示例,请参见获取目录Change_Notifications。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinBase.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
Unicode和ANSI namesFindFirstChangeNotificationW(Unicode)和FindFirstChangeNotificationA(ANSI)的
参见
目录管理功能
FindCloseChangeNotification
FindNextChangeNotification
ReadDirectoryChangesW
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年9月3日
==英文原文==FindFirstChangeNotification Function
Creates a change notification handle and sets up initial change notification filter conditions. A wait on a notification handle succeeds when a change matching the filter conditions occurs in the specified directory or subtree. The function does not report changes to the specified directory itself.
This function does not indicate the change that satisfied the wait condition. To retrieve information about the specific change as part of the notification, use the ReadDirectoryChangesW function.
Syntax
C++
HANDLE WINAPI FindFirstChangeNotification(
__in LPCTSTR lpPathName,
__in BOOL bWatchSubtree,
__in DWORD dwNotifyFilter
);
Parameters
lpPathName [in]
The full path of the directory to be watched. This cannot be a relative path or an empty string.
In the ANSI version of this function, the name is limited to MAX_PATH characters. To extend this limit to 32,767 wide characters, call the Unicode version of the function and prepend "\\\\?\\" to the path. For more information, see Naming a File .
bWatchSubtree [in]
If this parameter is TRUE, the function monitors the directory tree rooted at the specified directory; if it is FALSE, it monitors only the specified directory.
dwNotifyFilter [in]
The filter conditions that satisfy a change notification wait. This parameter can be one or more of the following values.
ValueMeaning
FILE_NOTIFY_CHANGE_FILE_NAME
0x00000001Any file name change in the watched directory or subtree causes a change notification wait operation to return. Changes include renaming, creating, or deleting a file name.
FILE_NOTIFY_CHANGE_DIR_NAME
0x00000002Any directory-name change in the watched directory or subtree causes a change notification wait operation to return. Changes include creating or deleting a directory.
FILE_NOTIFY_CHANGE_ATTRIBUTES
0x00000004Any attribute change in the watched directory or subtree causes a change notification wait operation to return.
FILE_NOTIFY_CHANGE_SIZE
0x00000008Any file-size change in the watched directory or subtree causes a change notification wait operation to return. The operating system detects a change in file size only when the file is written to the disk. For operating systems that use extensive caching, detection occurs only when the cache is sufficiently flushed.
FILE_NOTIFY_CHANGE_LAST_WRITE
0x00000010Any change to the last write-time of files in the watched directory or subtree causes a change notification wait operation to return. The operating system detects a change to the last write-time only when the file is written to the disk. For operating systems that use extensive caching, detection occurs only when the cache is sufficiently flushed.
FILE_NOTIFY_CHANGE_SECURITY
0x00000100Any security-descriptor change in the watched directory or subtree causes a change notification wait operation to return.

Return Value
If the function succeeds, the return value is a handle to a find change notification object.
If the function fails, the return value is INVALID_HANDLE_VALUE. To get extended error information, call GetLastError .
Remarks
The wait functions can monitor the specified directory or subtree by using the handle returned by the FindFirstChangeNotification function. A wait is satisfied when one of the filter conditions occurs in the monitored directory or subtree.
After the wait has been satisfied, the application can respond to this condition and continue monitoring the directory by calling the FindNextChangeNotification function and the appropriate wait function. When the handle is no longer needed, it can be closed by using the FindCloseChangeNotification function.
Notifications may not be returned when calling FindFirstChangeNotification for a remote file system.
Symbolic link behavior—If the path points to a symbolic link, the notification handle is created for the target.
If an application has registered to receive change notifications for a directory that contains symbolic links, the application is only notified when the symbolic links have been changed, not the target files.
Examples
For an example, see Obtaining Directory Change_Notifications .
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinBase.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
Unicode and ANSI namesFindFirstChangeNotificationW (Unicode) and FindFirstChangeNotificationA (ANSI)
See Also
Directory Management Functions
FindCloseChangeNotification
FindNextChangeNotification
ReadDirectoryChangesW
Send comments about this topic to Microsoft
Build date: 9/3/2009
==原始网址==http://msdn.microsoft.com/en-us/library/aa364417(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 11:23:09