MRU-Functions.3w

Langue: en

Version: Jun 2009 (debian - 07/07/09)

Section: 3 (Bibliothèques de fonctions)

NAME

MRU Functions

NOTES

The MRU-Api is a set of functions to manipulate lists of M.R.U. (Most Recently Used) items. It is an undocumented Api that is used (at least) by the shell and explorer to implement their recent documents feature.

Since these functions are undocumented, they are unsupported by Microsoft(tm) and may change at any time.

Internally, the list is implemented as a last in, last out list of items persisted into the system registry under a caller chosen key. Each list item is given a one character identifier in the Ascii range from 'a' to '}'. A list of the identifiers in order from newest to oldest is stored under the same key in a value named "MRUList".

Items are re-ordered by changing the order of the values in the MRUList value. When a new item is added, it becomes the new value of the oldest identifier, and that identifier is moved to the front of the MRUList value.

Wine stores MRU-lists in the same registry format as Windows, so when switching between the builtin and native comctl32.dll no problems or incompatibilities should occur.

The following undocumented structure is used to create an MRU-list:
typedef INT (CALLBACK *MRUStringCmpFn)(LPCTSTR lhs, LPCTSTR rhs);
typedef INT (CALLBACK *MRUBinaryCmpFn)(LPCVOID lhs, LPCVOID rhs, DWORD length);


typedef struct tagCREATEMRULIST
{

    DWORD   cbSize;

    DWORD   nMaxItems;

    DWORD   dwFlags;

    HKEY    hKey;

    LPTSTR  lpszSubKey;

    PROC    lpfnCompare;
} CREATEMRULIST, *LPCREATEMRULIST;.

MEMBERS

cbSize [In] The size of the CREATEMRULIST structure. This must be set to sizeof(CREATEMRULIST) by the caller.

nMaxItems [In] The maximum number of items allowed in the list. Because of the limited number of identifiers, this should be set to a value from 1 to 30 by the caller.

dwFlags [In] If bit 0 is set, the list will be used to store binary data, otherwise it is assumed to store strings. If bit 1 is set, every change made to the list will be reflected in the registry immediately, otherwise changes will only be written when the list is closed.

hKey [In] The registry key that the list should be written under. This must be supplied by the caller.

lpszSubKey [In] A caller supplied name of a subkey under hKey to write the list to. This may not be blank.

lpfnCompare [In] A caller supplied comparison function, which may be either an MRUStringCmpFn if dwFlags does not have bit 0 set, or a MRUBinaryCmpFn otherwise.

FUNCTIONS

- Create an MRU-list with CreateMRUList(3w) or CreateMRUListLazy(3w).

- Add items to an MRU-list with AddMRUString(3w) or AddMRUData(3w).

- Remove items from an MRU-list with DelMRUString(3w).

- Find data in an MRU-list with FindMRUString(3w) or FindMRUData(3w).

- Iterate through an MRU-list with EnumMRUList(3w).

- Free an MRU-list with FreeMRUList(3w).