Source code of Windows XP (NT5)
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.

132 lines
4.4 KiB

  1. #ifndef UTILS_H
  2. #define UTILS_H
  3. #include <htmlhelp.h>
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. #ifdef UNICODE
  8. HRESULT IExtractIcon_GetIconLocationThunk(IExtractIconW *peiw, UINT uFlags, LPSTR szIconFile, UINT cchMax, int * piIndex, UINT * pwFlags);
  9. HRESULT IExtractIcon_ExtractThunk(IExtractIconW *peiw, LPCSTR pszFile, UINT nIconIndex, HICON * phiconLarge, HICON * phiconSmall, UINT nIconSize);
  10. #endif
  11. void FireSubscriptionEvent(int nCmdID, const SUBSCRIPTIONCOOKIE UNALIGNED *pCookie);
  12. int WCMessageBox(HWND hwnd, UINT idTextFmt, UINT idCaption, UINT uType, ...);
  13. HRESULT GetCacheInfo(LPINTERNET_CACHE_CONFIG_INFOA *, DWORD *, DWORD *);
  14. HRESULT SetCacheSize(LPINTERNET_CACHE_CONFIG_INFOA, DWORD);
  15. HRESULT _CreatePropSheet(HWND, POOEBuf);
  16. int _GetCmdID(LPCSTR);
  17. int _CompareShortName(LPMYPIDL, LPMYPIDL);
  18. int _CompareURL(LPMYPIDL, LPMYPIDL);
  19. int _CompareNextUpdate(LPMYPIDL, LPMYPIDL);
  20. int _CompareLastUpdate(LPMYPIDL, LPMYPIDL);
  21. int _CompareIdentities(LPMYPIDL, LPMYPIDL);
  22. int _CompareGroup(LPMYPIDL, LPMYPIDL);
  23. int _CompareStatus(LPMYPIDL, LPMYPIDL);
  24. int _ComparePriority(LPMYPIDL, LPMYPIDL);
  25. void _GenerateEvent(LONG, LPITEMIDLIST, LPITEMIDLIST, BOOL bRefresh = TRUE);
  26. int _LaunchApp(HWND, LPCTSTR);
  27. BOOL _ValidateIDListArray(UINT cidl, LPCITEMIDLIST *ppidl);
  28. UINT BufferSize(POOEBuf);
  29. VOID CannotSaveProperty(HWND);
  30. BOOL ConfirmDelete(HWND, UINT, LPMYPIDL *);
  31. void CopyToMyPooe(POOEBuf, POOEntry);
  32. void CopyToOOEBuf(POOEntry, POOEBuf);
  33. HRESULT CreateBSTRFromTSTR(BSTR *, LPCTSTR);
  34. BOOL DATE2DateTimeString(CFileTime&, LPTSTR);
  35. BOOL Date2LocalDateString(SYSTEMTIME *, LPTSTR, int);
  36. void VariantTimeToFileTime(double dt, FILETIME& ft);
  37. void FileTimeToVariantTime(FILETIME& ft, double *pdt);
  38. void SetListViewToString (HWND hLV, LPCTSTR pszString);
  39. void GlobalAutoDial_Enable (BOOL bEnable);
  40. BOOL GlobalAutoDial_IsEnabled (void);
  41. BOOL GlobalAutoDial_ShouldEnable (HWND hParentWnd);
  42. BOOL FailsWin95SecurityCheck (HWND hParentWnd);
  43. BOOL IsHTTPPrefixed(LPCTSTR szURL);
  44. HRESULT LoadOOEntryInfo(POOEBuf pooeBuf, SUBSCRIPTIONCOOKIE *pCookie, DWORD *pdwSize);
  45. HRESULT LoadSubscription(LPCTSTR, LPMYPIDL *);
  46. UINT MergeMenuHierarchy(HMENU, HMENU, UINT, UINT, BOOL);
  47. UINT MergePopupMenu(HMENU *phMenu, UINT idResource, UINT uSubOffset, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast);
  48. HRESULT MergeOOEBuf(OOEBuf *pBuf1, OOEBuf *pBuf2, DWORD fMask);
  49. HRESULT SendUpdateRequests(HWND hwnd, CLSID *, UINT count);
  50. HRESULT PersistUpdate(POOEntry, BOOL bCreate);
  51. HRESULT SaveBufferChange(POOEBuf newBuf, BOOL bCreate);
  52. HRESULT LoadGroupCookie(NOTIFICATIONCOOKIE *, SUBSCRIPTIONSCHEDULE subGroup);
  53. DWORD Random(DWORD nMax);
  54. void CreateCookie(GUID UNALIGNED *pCookie);
  55. BOOL _InitComCtl32();
  56. //REVIEW Do we need the indirect versions?
  57. #undef CreateDialogParam
  58. #undef CreateDialog
  59. #undef DialogBoxParam
  60. #undef DialogBox
  61. #undef PropertySheet
  62. inline HWND CreateDialogParam(HINSTANCE hInstance, LPCTSTR lpTemplateName,
  63. HWND hWndParent, DLGPROC lpDialogFunc,
  64. LPARAM dwInitParam)
  65. {
  66. _InitComCtl32();
  67. #ifdef UNICODE
  68. return CreateDialogParamW(hInstance, lpTemplateName, hWndParent,
  69. lpDialogFunc, dwInitParam);
  70. #else
  71. return CreateDialogParamA(hInstance, lpTemplateName, hWndParent,
  72. lpDialogFunc, dwInitParam);
  73. #endif
  74. }
  75. inline HWND CreateDialog(HINSTANCE hInstance, LPCTSTR lpTemplateName,
  76. HWND hWndParent, DLGPROC lpDialogFunc)
  77. {
  78. return CreateDialogParam(hInstance, lpTemplateName, hWndParent, lpDialogFunc, 0L);
  79. }
  80. inline INT_PTR DialogBoxParam(HINSTANCE hInstance, LPCTSTR lpTemplateName, HWND hWndParent,
  81. DLGPROC lpDialogFunc, LPARAM dwInitParam)
  82. {
  83. _InitComCtl32();
  84. #ifdef UNICODE
  85. return DialogBoxParamW(hInstance, lpTemplateName, hWndParent,
  86. lpDialogFunc, dwInitParam);
  87. #else
  88. return DialogBoxParamA(hInstance, lpTemplateName, hWndParent,
  89. lpDialogFunc, dwInitParam);
  90. #endif
  91. }
  92. inline INT_PTR DialogBox(HINSTANCE hInstance, LPCTSTR lpTemplate, HWND hWndParent,
  93. DLGPROC lpDialogFunc)
  94. {
  95. return DialogBoxParam(hInstance, lpTemplate, hWndParent, lpDialogFunc, 0L);
  96. }
  97. inline INT_PTR PropertySheet(LPCPROPSHEETHEADER lppsph)
  98. {
  99. _InitComCtl32();
  100. #ifdef UNICODE
  101. return PropertySheetW(lppsph);
  102. #else
  103. return PropertySheetA(lppsph);
  104. #endif
  105. }
  106. #ifdef __cplusplus
  107. };
  108. #endif
  109. #endif UTILS_H