Callback Functions

Callback Functions


This section describes the Microsoft® Windows® shell callback functions.
BrowseCallbackProc
FMExtensionProc
UndeleteFile

BrowseCallbackProc

int CALLBACK BrowseCallbackProc(
    HWND hwnd, 
    UINT uMsg, 
    LPARAM lParam, 
    LPARAM lpData
    ); 

Specifies an application-defined callback function used with the SHBrowseForFolder function. The browse dialog box calls this function to notify it about events.

hwnd
Window handle to the browse dialog box. The callback function can send the following messages to this window:
BFFM_ENABLEOK Enables or disables the dialog's OK button. If the message's lParam is nonzero, the button is enabled. If the message's lParam is zero, the button is disabled.
BFFM_SETSELECTION Selects the specified folder. The message's lParam is the PIDL of the folder to select if wParam is FALSE, or the path of the folder otherwise.
BFFM_SETSTATUSTEXT Sets the status text to the null-terminated string specified by the message's lParam parameter.
uMsg
Value identifying the event. This can be one of the following values:
BFFM_INITIALIZED Indicates the browse dialog box has finished initializing. The lParam parameter is NULL.
BFFM_SELCHANGED Indicates the selection has changed. The lParam parameter contains the address of the item identifier list for the newly selected folder.
BFFM_VALIDATEFAILED Version 4.71. Indicates the user typed an invalid name into the edit box of the browse dialog. The lParam parameter is the address of a character buffer that contains the invalid name. An application can use this message to inform the user that the name entered was not valid. Return zero to allow the dialog to be dismissed or nonzero to keep the dialog displayed.
lParam
Value dependent upon the message contained in the uMsg parameter.
lpData
Application-defined value that was specified in the lParam member of the BROWSEINFO structure.

FMExtensionProc

LONG WINAPI FMExtensionProc(
    HWND hwnd,
    WORD wMsg,
    LONG lParam
);

Application-defined callback function called by File Manager to communicate with a File Manager extension.

hwnd
Window handle to File Manager. An extension should use this handle to specify the parent window for any dialog box or message box it must display; it should also use this handle to send query messages to File Manager.
wMsg
One of the following File Manager messages:
1 through 99 User selected an item from the extension-supplied menu. The value is the identifier of the selected menu item.
FMEVENT_HELPMENUITEM User pressed F1 while selecting an extension menu or toolbar command item. File Manager wants the extension to call WinHelp appropriately for the command item.
FMEVENT_HELPSTRING User selected an extension menu or toolbar command item. File Manager wants the extension to supply a Help string.
FMEVENT_INITMENU User selected the extension's menu. The extension should initialize items in the menu.
FMEVENT_LOAD File Manager is loading the extension DLL and prompts the DLL for information about the menu that the DLL supplies.
FMEVENT_SELCHANGE Selection in the File Manager directory window or Search Results window has changed.
FMEVENT_TOOLBARLOAD File Manager is creating the toolbar and prompts the extension DLL for information about any buttons the DLL adds to the toolbar.
FMEVENT_UNLOAD File Manager is unloading the extension DLL.
FMEVENT_USER_REFRESH User selected the Refresh command from the Window menu. The extension should update items in the menu, if necessary.
lParam
Message-specific value.

UndeleteFile

DWORD APIENTRY UndeleteFile(
    HWND hwndOwner, 
    LPSTR lpszDir 
);	

Application-defined callback function called by File Manager when the user chooses the Undelete command from the File menu.

hwndOwner
Window handle to File Manager. An undelete dynamic-link library (DLL) should use this handle to specify the owner window for any dialog box or message box the DLL might display.
lpszDir
Address of a null-terminated string that contains the name of the initial directory.

© 1997 Microsoft Corporation. All rights reserved. Terms of Use.