Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

106 lines
3.3 KiB

  1. /**************************************************************************
  2. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
  3. ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
  4. THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
  5. PARTICULAR PURPOSE.
  6. Copyright 1998 Microsoft Corporation. All Rights Reserved.
  7. **************************************************************************/
  8. /**************************************************************************
  9. File: Utility.h
  10. Description: Utility definitions.
  11. **************************************************************************/
  12. #ifndef UTILITY_H
  13. #define UTILITY_H
  14. /**************************************************************************
  15. #include statements
  16. **************************************************************************/
  17. #include <windows.h>
  18. #include <windowsx.h>
  19. #include <shlobj.h>
  20. #include <Regstr.h>
  21. #ifndef SFGAO_BROWSABLE
  22. #define SFGAO_BROWSABLE (0)
  23. #endif
  24. #ifndef SHGDN_INCLUDE_NONFILESYS
  25. #define SHGDN_INCLUDE_NONFILESYS (0)
  26. #endif
  27. #ifdef _cplusplus
  28. extern "C" {
  29. #endif //_cplusplus
  30. typedef struct {
  31. BOOL fCut;
  32. UINT cidl;
  33. UINT aoffset[1];
  34. }PRIVCLIPDATA, FAR *LPPRIVCLIPDATA;
  35. /**************************************************************************
  36. global variables
  37. **************************************************************************/
  38. #define TITLE_SIZE 64
  39. #define FILTER_ATTRIBUTES (FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN)
  40. #define INITIAL_COLUMN_SIZE 100
  41. #define CFSTR_SAMPVIEWDATA TEXT("SampleViewDataFormat")
  42. #define NS_CLASS_NAME (TEXT("SampleViewNSClass"))
  43. #define VIEW_POINTER_OFFSET GWL_USERDATA
  44. extern HINSTANCE g_hInst;
  45. extern UINT g_DllRefCount;
  46. extern HIMAGELIST g_himlLarge;
  47. extern HIMAGELIST g_himlSmall;
  48. extern TCHAR g_szStoragePath[];
  49. extern TCHAR g_szExtTitle[];
  50. extern const TCHAR c_szDataFile[];
  51. extern const TCHAR c_szSection[];
  52. extern const TCHAR g_szXMLUrl[];
  53. extern int g_nColumn;
  54. /**************************************************************************
  55. function prototypes
  56. **************************************************************************/
  57. //utility functions
  58. int CALLBACK CompareItems(LPARAM, LPARAM, LPARAM);
  59. BOOL SaveGlobalSettings(VOID);
  60. VOID GetGlobalSettings(VOID);
  61. VOID CreateImageLists(VOID);
  62. VOID DestroyImageLists(VOID);
  63. int WideCharToLocal(LPTSTR, LPWSTR, DWORD);
  64. int LocalToWideChar(LPWSTR, LPTSTR, DWORD);
  65. int LocalToAnsi(LPSTR, LPCTSTR, DWORD);
  66. VOID SmartAppendBackslash(LPTSTR);
  67. int BuildDataFileName(LPTSTR, LPCTSTR, DWORD);
  68. BOOL GetTextFromSTRRET(IMalloc*, LPSTRRET, LPCITEMIDLIST, LPTSTR, DWORD);
  69. BOOL IsViewWindow(HWND);
  70. BOOL DeleteDirectory(LPCTSTR);
  71. HGLOBAL CreatePrivateClipboardData(LPITEMIDLIST, LPITEMIDLIST*, UINT, BOOL);
  72. HGLOBAL CreateShellIDList(LPITEMIDLIST, LPITEMIDLIST*, UINT);
  73. BOOL CALLBACK ItemDataDlgProc(HWND, UINT, WPARAM, LPARAM);
  74. LPVOID GetViewInterface(HWND);
  75. UINT AddViewMenuItems(HMENU, UINT, UINT, BOOL);
  76. UINT AddFileMenuItems(HMENU, UINT, UINT, BOOL);
  77. int AddIconImageList(HIMAGELIST, LPCTSTR);
  78. #ifdef _cplusplus
  79. }
  80. #endif //_cplusplus
  81. #define ARRAYSIZE(a) (sizeof(a)/sizeof(a[0]))
  82. #endif //UTILITY_H