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.

115 lines
4.1 KiB

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