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.

60 lines
2.2 KiB

  1. /*++
  2. Copyright (c) 2000-2001, Microsoft Corporation All rights reserved.
  3. Module Name:
  4. hook.h
  5. Abstract:
  6. This file contains the declares for the functions in hook.c that callers will need
  7. Revision History:
  8. 27 Jan 2001 v-michka Created.
  9. --*/
  10. #ifndef HOOK_H
  11. #define HOOK_H
  12. // Creates the window hook we use for window creation sniffing
  13. #define INIT_WINDOW_SNIFF(h) \
  14. h = SetWindowsHookExA(WH_CBT, &CBTProc, NULL, GetCurrentThreadId())
  15. // terminates our window hook if it exists
  16. #define TERM_WINDOW_SNIFF(h) \
  17. if(h) \
  18. { \
  19. UnhookWindowsHookEx(h); \
  20. h = NULL; \
  21. }
  22. // forward declares for hooks that do significant things
  23. LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  24. INT_PTR CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
  25. LRESULT CALLBACK CBTProc(int nCode, WPARAM wParam, LPARAM lParam);
  26. UINT_PTR CALLBACK FRHookProcFind(HWND hdlg, UINT uiMsg, WPARAM wParam, LPARAM lParam);
  27. UINT_PTR CALLBACK FRHookProcReplace(HWND hdlg, UINT uiMsg, WPARAM wParam, LPARAM lParam);
  28. UINT_PTR CALLBACK OFNHookProc(HWND hdlg, UINT uiMsg, WPARAM wParam, LPARAM lParam);
  29. UINT_PTR CALLBACK OFNHookProcSave(HWND hdlg, UINT uiMsg, WPARAM wParam, LPARAM lParam);
  30. // hooks that are only here for tagging child controls
  31. UINT_PTR CALLBACK CCHookProc(HWND hdlg, UINT uiMsg, WPARAM wParam, LPARAM lParam);
  32. UINT_PTR CALLBACK CFHookProc(HWND hdlg, UINT uiMsg, WPARAM wParam, LPARAM lParam);
  33. UINT_PTR CALLBACK PagePaintHook(HWND hdlg, UINT uiMsg, WPARAM wParam, LPARAM lParam);
  34. UINT_PTR CALLBACK PageSetupHook(HWND hdlg, UINT uiMsg, WPARAM wParam, LPARAM lParam);
  35. UINT_PTR CALLBACK PrintHookProc(HWND hdlg, UINT uiMsg, WPARAM wParam, LPARAM lParam);
  36. UINT_PTR CALLBACK SetupHookProc(HWND hdlg, UINT uiMsg, WPARAM wParam, LPARAM lParam);
  37. UINT_PTR CALLBACK OFNHookProcOldStyle(HWND hdlg, UINT uiMsg, WPARAM wParam, LPARAM lParam);
  38. UINT_PTR CALLBACK OFNHookProcOldStyleSave(HWND hdlg, UINT uiMsg, WPARAM wParam, LPARAM lParam);
  39. // support functions
  40. BOOL IsFontDialog(HWND hdlg);
  41. BOOL IsNewFileOpenDialog(HWND hdlg);
  42. BOOL IsCaptureWindow(HWND hdlg);
  43. void RemoveComdlgPropIfPresent(HWND hdlg);
  44. void SetCaptureWindowProp(HWND hdlg);
  45. #endif // HOOK_H