home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / winui / shell / shellext / copyhook.cpp next >
Encoding:
C/C++ Source or Header  |  1997-10-05  |  2.5 KB  |  67 lines

  1. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
  2. // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
  3. // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
  4. // PARTICULAR PURPOSE.
  5. //
  6. // Copyright (C) 1993-1997  Microsoft Corporation.  All Rights Reserved.
  7. //
  8. //  MODULE:   copyhook.cpp
  9. //
  10. //  PURPOSE:   Implements the ICopyHook member functions necessary to support
  11. //             the copy hook portioins of this shell extension.  
  12. //             Copy hook handlers are called each time a folder is copied, moved, 
  13. //             renamed, etc. in the system.  Note that the CopyCallback is NOT
  14. //             called for each file, but only for entire folders.
  15. //
  16.  
  17. #include "priv.h"
  18. #include "shellext.h"
  19.  
  20.  
  21. //
  22. //  FUNCTION: CShellExt::CopyCallback(HWND,
  23. //                                    UINT, 
  24. //                                    UINT, 
  25. //                                    LPCSTR,
  26. //                                    DWORD,
  27. //                                    LPCSTR,
  28. //                                    DWORD)
  29. //
  30. //  PURPOSE: Called by the shell when a folder is being manipulated.
  31. //
  32. //  PARAMETERS:
  33. //    hwnd          - Window handle to use for any UI stuff
  34. //    wFunc         - what operation is being done
  35. //    wFlags        - and flags (FOF_*) set in the initial call 
  36. //                    to the file operation
  37. //    pszSrcFile    - name of the source file
  38. //    dwSrcAttribs  - file attributes of the source file
  39. //    pszDestFile   - name of the destiation file (for move and renames)
  40. //    dwDestAttribs - file attributes of the destination file
  41. //
  42. //  RETURN VALUE:
  43. //
  44. //    IDYES    - allow the operation
  45. //    IDNO     - disallow the operation on this file, but continue with
  46. //               any other operations (eg. batch copy)
  47. //    IDCANCEL - disallow the current operation and cancel any pending
  48. //               operations
  49. //
  50. //  COMMENTS:
  51. //
  52.  
  53. STDMETHODIMP_(UINT) CShellExt::CopyCallback(HWND hwnd, 
  54.                                             UINT wFunc, 
  55.                                             UINT wFlags, 
  56.                                             LPCSTR pszSrcFile, 
  57.                                             DWORD dwSrcAttribs,
  58.                                             LPCSTR pszDestFile, 
  59.                                             DWORD dwDestAttribs)
  60. {
  61.     ODS("CShellExt::CopyCallback\r\n");
  62.  
  63.     MessageBox(NULL, "CopyCallback!", "SHELLEXT", MB_OK);
  64.  
  65.     return IDYES;
  66. }
  67.