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.

104 lines
3.5 KiB

  1. #ifndef _UTIL_H
  2. #define _UTIL_H
  3. #include "cabinet.h"
  4. #define RECTWIDTH(rc) ((rc).right-(rc).left)
  5. #define RECTHEIGHT(rc) ((rc).bottom-(rc).top)
  6. ULONG _RegisterNotify(HWND hwnd, UINT nMsg, LPITEMIDLIST pidl, BOOL fRecursive);
  7. void _UnregisterNotify(ULONG nNotify);
  8. void _MirrorBitmapInDC(HDC hdc, HBITMAP hbmOrig);
  9. BOOL Reg_GetStruct(HKEY hkey, LPCTSTR pszSubKey, LPCTSTR pszValue, void *pData, DWORD *pcbData);
  10. BOOL Reg_SetStruct(HKEY hkey, LPCTSTR pszSubKey, LPCTSTR pszValue, void *lpData, DWORD cbData);
  11. HMENU LoadMenuPopup(LPCTSTR id);
  12. BOOL SetWindowZorder(HWND hwnd, HWND hwndInsertAfter); // from shell\lib
  13. __inline BOOL IsChildOrHWND(HWND hwnd, HWND hwndChild) { return (SHIsChildOrSelf(hwnd, hwndChild) == S_OK); }
  14. WORD _GetHotkeyFromFolderItem(LPSHELLFOLDER psf, LPCITEMIDLIST pidl);
  15. DWORD MsgWaitForMultipleObjectsLoop(HANDLE hEvent, DWORD dwTimeout);
  16. BOOL _Restricted(HWND hwnd, RESTRICTIONS rest);
  17. int Window_GetClientGapHeight(HWND hwnd);
  18. #define DOCKSTATE_DOCKED 0
  19. #define DOCKSTATE_UNDOCKED 1
  20. #define DOCKSTATE_UNKNOWN 2
  21. BOOL IsDisplayChangeSafe();
  22. DWORD GetMinDisplayRes(void);
  23. void HandleDisplayChange(int x, int y, BOOL fCritical);
  24. UINT GetDDEExecMsg();
  25. BOOL _CheckAssociations(void);
  26. void _ShowFolder(HWND hwnd, UINT csidl, UINT uFlags);
  27. STDAPI_(IShellFolder*) BindToFolder(LPCITEMIDLIST pidl);
  28. void RunSystemMonitor(void);
  29. HRESULT SHIsParentOwnerOrSelf(HWND hwndParent, HWND hwnd);
  30. #define RECTWIDTH(rc) ((rc).right-(rc).left)
  31. #define RECTHEIGHT(rc) ((rc).bottom-(rc).top)
  32. void SHAllowSetForegroundWindow(HWND hwnd);
  33. void DoInitialization();
  34. void DoCleanup();
  35. BOOL IsEjectAllowed(BOOL fForceUpdateCache);
  36. void SetBiDiDateFlags(int *piDateFormat);
  37. BOOL AppCommandTryRegistry(int cmd);
  38. void RECTtoRECTL(LPRECT prc, LPRECTL lprcl);
  39. int Toolbar_GetUniqueID(HWND hwndTB);
  40. BYTE ToolBar_GetStateByIndex(HWND hwnd, INT_PTR iIndex);
  41. int ToolBar_IndexToCommand(HWND hwnd, INT_PTR iIndex);
  42. UINT SHGetImageListFlags(HWND hwndToolbar);
  43. HRESULT SHExeNameFromHWND(HWND hWnd, LPWSTR pszExeName, UINT cchExeName);
  44. BOOL GetMonitorRects(HMONITOR hMon, LPRECT prc, BOOL bWork);
  45. #define GetMonitorRect(hMon, prc) \
  46. GetMonitorRects((hMon), (prc), FALSE)
  47. BOOL ShouldTaskbarAnimate();
  48. #define DCHF_TOPALIGN 0x00000002 // default is center-align
  49. #define DCHF_HORIZONTAL 0x00000004 // default is vertical
  50. #define DCHF_HOT 0x00000008 // default is flat
  51. #define DCHF_PUSHED 0x00000010 // default is flat
  52. #define DCHF_FLIPPED 0x00000020 // if horiz, default is pointing right
  53. // if vert, default is pointing up
  54. #define DCHF_TRANSPARENT 0x00000040
  55. #define DCHF_INACTIVE 0x00000080
  56. #define DCHF_NOBORDER 0x00000100
  57. void DrawChevron(HDC hdc, LPRECT lprc, DWORD dwFlags);
  58. void SetWindowStyle(HWND hwnd, DWORD dwStyle, BOOL fOn);
  59. void SetWindowStyleEx(HWND hwnd, DWORD dwStyleEx, BOOL fOn);
  60. // Review chrisny: this can be moved into an object easily to handle generic droptarget, dropcursor
  61. // , autoscrool, etc. . .
  62. void _DragEnter(HWND hwndTarget, const POINTL ptStart, IDataObject *pdtObject);
  63. void _DragMove(HWND hwndTarget, const POINTL ptStart);
  64. BOOL SHSendPrintRect(HWND hwndParent, HWND hwnd, HDC hdc, RECT* prc);
  65. BOOL CreateProcessWithArgs(LPCTSTR pszApp, LPCTSTR pszArgs, LPCTSTR pszDirectory, PROCESS_INFORMATION *ppi);
  66. BOOL IsDirectXAppRunningFullScreen();
  67. BOOL _IsDirectXExclusiveMode();
  68. #endif // _UTIL_H