网站首页  词典首页

请输入您要查询的函数:

 

术语 shaddtorecentdocs
释义 SHAddToRecentDocs
语法:
void SHAddToRecentDocs( UINT uFlags,
LPCVOID pv
);
SHAddToRecentDocs功能
通知对这些项目的跟踪的目的,该项目已被浏览系统,可用于最近和最频繁。此功能也可以用来清除所有的使用数据。
参数
uFlags
[in]从陶片枚举显示的信息形式的价值指向的光电参数。
光伏
[in]一个指针的数据,指的是已经被浏览项目。该项目可以指定此参数在下列形式之一:
一个以null 结尾的字符串,包含路径和文件的项目名称。
对一个项目标识符列表(的PIDL),用于标识该项目的文件对象的指针。
Windows 7和更高版本。阿SHARDAPPIDINFO,SHARDAPPIDINFOIDLIST,或SHARDAPPIDINFOLINK结构,通过一个应用程序标识用户模型标识(AppUserModelID)的项目。有关更多信息,应用程序用户模型标识(AppUserModelIDs)。
Windows 7和更高版本。一个IShellLink对象标识,通过该项目的快捷方式。
将此参数设置为NULL,以清除所有项目都使用数据。
返回值
没有返回值。
备注
的使用,通过这种方法调用收集的统计来确定访问的物品清单,最近和最频繁。这些名单出现在开始菜单,在Windows 7及更高版本,在应用程序的跳转表。
当这种方法被调用,它影响到以下几个方面:
为相关的应用程序的跳转表的更新和频繁的最近清单。
添加一个快捷方式到用户的最近的文件夹(FOLDERID_Recent,CSIDL_RECENT)。这反映在我最近的文档(Windows XP中)和最近的项目(Windows Vista和更高版本)在开始菜单中的菜单。
添加一个快捷方式经典开始菜单的文件菜单。 (请注意,经典开始菜单选项在Windows 7和更高版本。)
项目出席了IShellLink不会添加到最近的文件夹,虽然他们是在应用程序的跳转表中反映出来。
在某些情况下,尤其是当用户打开Windows资源管理器,通过一个项目或使用通用文件对话框的打开,保存,或创建一个文件,壳牌呼吁代表应用程序SHAddToRecentDocs。一个应用程序,有一个自定义用户界面选择项目(UI)的,应立即调用SHAddToRecentDocs明确,以确保准确的统计数字。重复调用是由系统占这么没有扭曲这样的数据的风险。
可执行(。exe)是从最近使用的文件在Windows XP和更高版本的列表筛选文件。虽然SHAddToRecentDocs将接受一个可执行文件的路径,该文件将不会出现在列表中最近的项目。
文件夹也接受SHAddToRecentDocs,但只出现在Windows资源管理器的任务栏按钮跳转名单。文件夹不会出现在任何其他应用程序的跳转表。

在某些情况下,SHAddToRecentDocs试图注册的应用程序来处理的文件类型,它是没有登记的处理。出现这种情况在这种情况下:
应用程序显式调用的文件类型,这不是注册来处理SHAddToRecentDocs。这也适用于作出的关于代表应用程序通用文件对话框SHAddToRecentDocs电话,但只有当该对话框用于打开一个文件,不使用时节省之一。
用户下降的一个应用程序未注册的处理应用程序的任务栏按钮类型的文件。
完成此注册为用户。
一系列的规定必须满足的注册,可顺利完成:
应用程序必须注册在HKEY_CLASSES_ROOT \\应用。
,登记不能包含NoOpenWith价值。见就NoOpenWith详细的文件类型。
,登记无法提供SupportedTypes子项下的数据。见子项的SupportedTypes详细的文件类型。
应用程序的可执行文件不能被列在KillList价值在这里找到:
HKEY_LOCAL_MACHINE
软件
微软
视窗
CurrentVersion
浏览器
FileAssociation
KillList
注意第三方应用程序不应该修改KillList价值。它应被视为只读。
应用程序的HKEY_CLASSES_ROOT \\申请的登记必须有一个定义下HKEY_CLASSES_ROOT \\应用\\ ExampleApp.exe \\空壳子项的默认动词集。
如果SHAddToRecentDocs企图作为一拖的结果登记和,到任务栏按钮下降,创建子壳如果它不存在,只要现有的应用程序的注册不包含NoOpenWith价值和应用程序的可执行没有列在KillList价值。
呼吁制止向SHAddToRecentDocs
在Microsoft Windows版本的Windows 7之前,文件类型可以设置FTA_NoRecentDocs标志,以防止该文件类型被添加到最近的文件夹。这种机制也支持在Windows 7及更高版本。有关更多信息,文件类型。
SHAddToRecentDocs跟踪是通过调用来访问这些文件的动词文件使用统计信息。注册IContextMenu处理程序提供的动词进行跟踪,这些项目在我最近的文档(Windows XP中)和(Windows Vista)的最近的项目出现。在Windows 7,文件的父文件夹出现在Windows资源管理器的任务栏按钮跳转名单。然而,通过这些文件访问IContextMenu动词不会出现在应用程序跳转名单。这些项目出现在应用程序的跳转表,应用程序必须调用SHAddToRecentDocs明确。
在此之前的Windows 7,只有在一个开放的动词来SHAddToRecentDocs调用结果。在Windows 7和更高版本,其他动词还可以生成使用统计信息。此信息是用来制造跳转名单的目的地,更完整和准确。
然而,文件类型关联注册或个人IContextMenu实现一些类是不恰当的这种跟踪排序。的使用情况跟踪点生成的项目列表,用户很可能要再次访问。如果某个动词删除,例如,本质上是对一个项目,该用户将无法再次访问,或者是次要的行动,例如病毒扫描的文件调用,这是不恰当的动词跟踪。文件类型类应该删除该跟踪通过注册表项NoRecentDocs自己。 NoRecentDocs是REG_SZ类型,并没有相关的数据。它的存在是所有需要防止向SHAddToRecentDocs调用。
例如,上下文菜单扩展和注册类HKEY_CLASSES_ROOT下,如“*”静态动词,“AllFileSystemObjects”或“文件夹”不应被跟踪。在这样的情况下,NoRecentDocs项被添加到类的主要根源如下所示以禁止通过任何动词或注册该类文件的扩展推出追踪:
HKEY_CLASSES_ROOT
AllFileSystemObjects
NoRecentDocs
该NoRecentDocs项是指定默认为*,AllFileSystemObjects,文件夹,目录和DesktopBackground类子项。
个人IContextMenu实现可以选择退出,加入NoRecentDocs子项的组件对象模型(COM)对象的登记,在其shellex子项,如下所示跟踪:
HKEY_CLASSES_ROOT
的CLSID
(093C7AAB - 5E72 - 454f - A91D - CA1BC991FCEC)
shellex
NoRecentDocs
该子项不存在任何IContextMenu上实现的默认。
功能信息
最低DLL版本 shell32.dll 4.0或更高版本
自定义ImplementationNo
Headershlobj.h
import libraryshell32.lib
最低经营systemsWindows NT 4.0中,Windows 95中
参见
SHGetFolderLocation,将SHGetFolderPath
==英文原文==SHAddToRecentDocs Function
Notifies the system that an item has been accessed, for the purposes of tracking those items used most recently and most frequently. This function can also be used to clear all usage data.
Syntax
void SHAddToRecentDocs( UINT uFlags,
LPCVOID pv
);
Parameters
uFlags
[in] A value from the SHARD enumeration that indicates the form of the information pointed to by the pv parameter.
pv
[in] A pointer to data that identifies the item that has been accessed. The item can be specified in this parameter in one of the following forms:
A null-terminated string that contains the path and file name of the item.
A pointer to an item identifier list (PIDL) that identifies the item's file object.
Windows 7 and later only. A SHARDAPPIDINFO , SHARDAPPIDINFOIDLIST , or SHARDAPPIDINFOLINK structure that identifies the item through an Application User Model ID (AppUserModelID). See Application User Model IDs (AppUserModelIDs) for more information.
Windows 7 and later only. An IShellLink object that identifies the item through a shortcut.
Set this parameter to NULL to clear all usage data on all items.
Return Value
No return value.
Remarks
The usage statistics gathered through calls to this method are used to determine lists of items accessed most recently and most frequently. These lists are seen in the Start menu and, in Windows 7 and later, in an application's Jump List.
When this method is called, it affects the following areas:
Updates the Recent and Frequent lists for the associated application's Jump List.
Adds a shortcut to the user's Recent folder ( FOLDERID_Recent , CSIDL_RECENT ). This is reflected in the My Recent Documents (Windows XP) and Recent Items (Windows Vista and later) menu in the Start menu.
Adds a shortcut to the Classic Start menu's Documents submenu. (Note that the Classic Start menu option is not available in Windows 7 and later.)
Items represented by an IShellLink are not added to the Recent folder, although they are reflected in an application's Jump List.
In some cases, notably when a user opens an item through Windows Explorer or uses the common file dialog to open, save, or create a file, the Shell calls SHAddToRecentDocs on behalf of the application. An application that has a custom user interface (UI) for selecting items should call SHAddToRecentDocs explicitly to ensure accurate statistics. Duplicate calls are accounted for by the system so there is no risk of skewing the data by doing so.
Executable (.exe) files are filtered from the recently used documents list in Windows XP and later versions. Although SHAddToRecentDocs will accept the path of an executable file, that file will not appear in the Recent Items list.
Folders are also accepted by SHAddToRecentDocs, but appear only in the Jump List for the Windows Explorer taskbar button. Folders do not appear in any other application's Jump List.

In certain cases, SHAddToRecentDocs attempts to register an application to handle a file type that it is not registered to handle. This occurs under these circumstances:
An application explicitly calls SHAddToRecentDocs with a file type that it is not registered to handle. This also applies to calls made to SHAddToRecentDocs by the common file dialog on behalf of the application, but only when the dialog is used to open a file, not when it is used to save one.
The user drops a file of a type that the application is not registered to handle on the application's taskbar button.
This registration is done per-user.
A set of requirements must be met for the registration to be accomplished successfully:
The application must be registered under HKEY_CLASSES_ROOT\\Applications .
That registration cannot include the NoOpenWith value. See File Types for more details on NoOpenWith.
That registration cannot supply data under a SupportedTypes subkey. See File Types for more details on the SupportedTypes subkey.
The application's executable file cannot be listed in the KillList value found here:
HKEY_LOCAL_MACHINE
Software
Microsoft
Windows
CurrentVersion
Explorer
FileAssociation
KillList
Note Third party applications should not modify the KillList value. It should be regarded as read-only.
The application's HKEY_CLASSES_ROOT\\Applications registration must have a set of default verbs defined under a HKEY_CLASSES_ROOT\\Applications\\ExampleApp.exe\\shell subkey.
If SHAddToRecentDocs is attempting the registration as the result of a drag-and-drop onto the taskbar button, the shell subkey is created if it does not already exist, as long as the existing application registration does not contain a NoOpenWith value and the application's executable is not listed in the KillList value.
Suppressing Calls to SHAddToRecentDocs
In versions of Microsoft Windows before Windows 7, a file type could set the FTA_NoRecentDocs flag to prevent that file type from being added to the Recent folder. This mechanism is also supported under Windows 7 and later. See File Types for more information.
SHAddToRecentDocs tracks document usage statistics through the verbs that are invoked to access those documents. Verbs supplied by registered IContextMenu handlers are tracked, those items appear in My Recent Documents (Windows XP) and Recent Items (Windows Vista). In Windows 7, the parent folders of the documents appear in the Jump List for the Windows Explorer taskbar button. However, the documents accessed through those IContextMenu verbs do not appear in application Jump Lists. For those items to appear in an application's Jump List, an application must call SHAddToRecentDocs explicitly.
Prior to Windows 7, only the open verb resulted in a call to SHAddToRecentDocs. In Windows 7 and later, other verbs can also generate usage statistics. This information is used to make a Jump List's destinations more complete and accurate.
However, some classes of file type association registrations or individual IContextMenu implementations are not appropriate for this sort of tracking. The point of usage tracking is to generate a list of items that the user is likely to want to access again. If a particular verb—delete, for instance—is inherently invoked on an item that the user will not access again, or is a secondary action such as a virus scan on a file, that verb is not appropriate for tracking. File type classes should remove themselves from this tracking through the registry entry NoRecentDocs. NoRecentDocs is of type REG_SZ and has no associated data. Its presence is all that is required to prevent the call to SHAddToRecentDocs.
For example, context menu extensions and static verbs registered under HKEY_CLASSES_ROOT in classes such as "*", "AllFileSystemObjects", or "Folder" should not be tracked. In cases such as these, the NoRecentDocs entry is added to the root of the class key as shown here to suppress tracking of documents launched through any verb or extension registered to that class:
HKEY_CLASSES_ROOT
AllFileSystemObjects
NoRecentDocs
The NoRecentDocs entry is assigned by default to the * , AllFileSystemObjects , Folder , Directory , and DesktopBackground class subkeys.
Individual IContextMenu implementations can opt out of tracking by adding a NoRecentDocs subkey to its Component Object Model (COM) object's registration, in its shellex subkey, as shown here:
HKEY_CLASSES_ROOT
CLSID
{093C7AAB-5E72-454f-A91D-CA1BC991FCEC}
shellex
NoRecentDocs
This subkey is not present by default on any IContextMenu implementation.
Function Information
Minimum DLL Versionshell32.dll version 4.0 or later
Custom ImplementationNo
Headershlobj.h
Import libraryshell32.lib
Minimum operating systemsWindows NT 4.0, Windows 95
See Also
SHGetFolderLocation , SHGetFolderPath
==原始网址==http://msdn.microsoft.com/en-us/library/bb762105(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 13:26:35