///////////////////////////////////////////////////////
| 723 | |
| 724 | //////////////////////////////////////////////////////////// |
| 725 | void WindowImplWin32::processEvent(UINT message, WPARAM wParam, LPARAM lParam) |
| 726 | { |
| 727 | // Don't process any message until window is created |
| 728 | if (m_handle == nullptr) |
| 729 | return; |
| 730 | |
| 731 | switch (message) |
| 732 | { |
| 733 | // Destroy event |
| 734 | case WM_DESTROY: |
| 735 | { |
| 736 | // Here we must cleanup resources ! |
| 737 | cleanup(); |
| 738 | break; |
| 739 | } |
| 740 | |
| 741 | // Set cursor event |
| 742 | case WM_SETCURSOR: |
| 743 | { |
| 744 | // The mouse has moved, if the cursor is in our window we must refresh the cursor |
| 745 | if (LOWORD(lParam) == HTCLIENT) |
| 746 | { |
| 747 | SetCursor(m_cursorVisible ? m_lastCursor : nullptr); |
| 748 | } |
| 749 | |
| 750 | break; |
| 751 | } |
| 752 | |
| 753 | // Close event |
| 754 | case WM_CLOSE: |
| 755 | { |
| 756 | pushEvent(Event::Closed{}); |
| 757 | break; |
| 758 | } |
| 759 | |
| 760 | // Resize event |
| 761 | case WM_SIZE: |
| 762 | { |
| 763 | // Consider only events triggered by a maximize or a un-maximize |
| 764 | if (wParam != SIZE_MINIMIZED && !m_resizing && m_lastSize != getSize()) |
| 765 | { |
| 766 | // Update the last handled size |
| 767 | m_lastSize = getSize(); |
| 768 | |
| 769 | // Push a resize event |
| 770 | pushEvent(Event::Resized{m_lastSize}); |
| 771 | |
| 772 | // Restore/update cursor grabbing |
| 773 | grabCursor(m_cursorGrabbed); |
| 774 | } |
| 775 | break; |
| 776 | } |
| 777 | |
| 778 | // Start resizing |
| 779 | case WM_ENTERSIZEMOVE: |
| 780 | { |
| 781 | m_resizing = true; |
| 782 | grabCursor(false); |
no test coverage detected