IWindowMessageHandler.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #ifndef _CRY_WINDOW_MESSAGE_HANDLER_H_
  9. #define _CRY_WINDOW_MESSAGE_HANDLER_H_
  10. #if defined(WIN32)
  11. #include "platform.h"
  12. #include <AzCore/PlatformIncl.h>
  13. // Summary:
  14. // Window message handler for Windows OS
  15. struct IWindowMessageHandler
  16. {
  17. // Summary:
  18. // The low-level pre-process message handler for Windows
  19. // This is called before TranslateMessage/DispatchMessage (which will eventually end up in the HandleMessage handler)
  20. // Typically, do not implement this function.
  21. virtual void PreprocessMessage([[maybe_unused]] HWND hWnd, [[maybe_unused]] UINT uMsg, [[maybe_unused]] WPARAM wParam, [[maybe_unused]] LPARAM lParam) {}
  22. // Summary:
  23. // The low-level window message handler for Windows
  24. // The return value specifies if the implementation wants to modify the message handling result
  25. // When returning true, the desired result value should be written through the pResult pointer
  26. // When returning false, the value stored through pResult (if any) is ignored
  27. // If more than one implementation write different results, the behavior is undefined
  28. // If none of the implementations write any result, the default OS result will be used instead
  29. // In general, return false if the handler doesn't care about the message, or only uses it for informational purposes
  30. virtual bool HandleMessage([[maybe_unused]] HWND hWnd, [[maybe_unused]] UINT uMsg, [[maybe_unused]] WPARAM wParam, [[maybe_unused]] LPARAM lParam, [[maybe_unused]] LRESULT* pResult) { return false; }
  31. };
  32. #else
  33. // Summary:
  34. // Dummy window message handler
  35. // This is used for platforms that don't use window message handlers
  36. struct IWindowMessageHandler
  37. {
  38. };
  39. #endif
  40. #endif