WM_FILECHANGEINFO

This notification message is sent by SendNotifyMessage from the shell to the window that was registered with SHChangeNotifyRegister.

A window receives this message through its WindowProc function.

LRESULT CALLBACK WindowProc(
  HWND hwnd,
  UINT msg,
  WPARAM wParam,
  LPARAM lParam
);

Parameters

  • hwnd
    Handle to the window that was registered with the SHChangeNotifyRegister function and will receive the WM_FILECHANGEINFO message.
  • msg
    Window message that is sent by SendNotifyMessage from the shell.
  • wParam
    Not used.
  • lParam
    Pointer to a FILECHANGENOTIFY structure containing all of the relevant data.

Remarks

The following code example shows how to process the WM_FILECHANGEINFO message.

LRESULT CALLBACK SomeWndProc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
{
  FILECHANGENOTIFY  * lpfcn;
  FILECHANGEINFO  * lpfci; 
  switch (msg) {
    case WM_FILECHANGEINFO:
      lpfcn = (FILECHANGENOTIFY  * )lp;
      if (lpfcn == NULL) {
        break;
      }
      lpfci = &(lpfcn->fci);
      if (lpfci == NULL) {
        break;
      }
      switch (lpfci->wEventId) {
        case SHCNE_MKDIR:
            // A directory was created. dwItem1 is the name of
            // the new directory.
          break;

        case SHCNE_RENAMEITEM:
            // An item (file) was renamed. dwItem1 is old name,
            // dwItem2 is new name.
          break;
      }

      SHChangeNotifyFree(lpfcn);
      break;

    default:
      return DefWindowProc(hwnd, msg, wp, lp);
  }
  return 0;
}

Requirements

OS Versions: Windows CE .NET 4.2 and later.
Header: Commctrl.h, Prsht.h, Shlguid.h.
Link Library: Ceshell.lib.

See Also

AYGShell Messages | SendNotifyMessage | SHChangeNotifyRegister | WindowProc | FILECHANGENOTIFY | SHChangeNotifyRegister

Last updated on Wednesday, April 13, 2005

© 2005 Microsoft Corporation. All rights reserved.