Preserving Shortcuts

The Windows 95 user interface automatically attempts to resolve shortcuts whose targets have been renamed or moved. When you create a shortcut, the system saves information about the shortcut. Most of this information is the same as that found in the WIN32_FIND_DATA structure (file attributes, creation time, last access time, last write time, and file size). When the IShellLink::Resolve member function is called, the system gets the path associated with the current shortcut by using a pointer to its ID list. The system then searches for the shortcut object in that path and resolves the shortcut if it finds the object.

If it does not find the shortcut object, the system then looks in the same directory for an object that has the same file creation time and file attributes but a different name. This will resolve a shortcut to an object that has been renamed.

If it still does not find the shortcut object, the system next searches the subdirectories of the current directory, recursively searching the directory tree for a match with either the filename or the creation time. If it does not find a match, it displays a dialog box that prompts the user for a location (a browse button). An application can suppress the dialog box by specifying the SLR_NO_UI flag when it calls the IShellLink::Resolve member function.