Wm_entersizemove / wm_exitsizemove
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Wm_entersizemove / wm_exitsizemove

Hybrid View

  1. #1
    John E is offline Elite Member Power Poster
    Join Date
    Apr 2001
    Location
    Manchester, England
    Posts
    4,258

    Wm_entersizemove / wm_exitsizemove

    I'm trying to fix a bug that I've found in the Windows version of libgdk. Consider this code fragment from a switch statement:-

    Code:
        case WM_ENTERSIZEMOVE:
        case WM_ENTERMENULOOP:
          _gdk_win32_begin_modal_call ();
          break;
    
        case WM_EXITSIZEMOVE:
        case WM_EXITMENULOOP:
          _gdk_win32_end_modal_call ();
          break;
    The way the code is currently written, every call to _gdk_win32_begin_modal_call() is expected to be matched by a subsequent call to _gdk_win32_end_modal_call(). WM_ENTERSIZEMOVE seems to get sent whenever a user right-clicks on a top level window's title bar (e.g. to select "Move" from the popup menu that gets displayed).

    If I do actually move the window, when I release my mouse button (to finish the move) WM_EXITSIZEMOVE gets sent which neatly calls _gdk_win32_end_modal_call()

    BUT.... if I right-click a title bar, then (without moving the window) I simply cancel the move by left-clicking my mouse on the desktop, WM_EXITSIZEMOVE doesn't seem to get get sent. The way the code is written, this causes a crash if I subsequently right-click the title bar again.

    Is there some other message I can trap to detect when the user cancels a move before it even begins?
    "A problem well stated is a problem half solved. - Charles F. Kettering

  2. #2
    John E is offline Elite Member Power Poster
    Join Date
    Apr 2001
    Location
    Manchester, England
    Posts
    4,258

    Re: Wm_entersizemove / wm_exitsizemove

    Seems strange that there's a message to indicate when a resize operation begins and another one to indicate when it ended - but no message to indicate that it was abandoned. Anyway, I managed to get around it by intercepting WM_CAPTURECHANGED
    "A problem well stated is a problem half solved. - Charles F. Kettering

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center