Windows messages

Posted by: mike on 15 December 2019, 10:49 pm EST

    • Post Options:
    • Link

    Posted 15 December 2019, 10:49 pm EST

    Seems like C1RibbonForm eats some windows messages that would be very handy to have.

    For example, a C1RibbonForm’s WndProc does not receive WM_ENTERSIZEMOVE and WM_EXITSIZEMOVE messages. I think there are some others as well, related to the sizing/moving that are not sent.

    Can you check if there is a workaround for this?

  • Posted 16 December 2019, 12:35 pm EST

    I took your file and ran it. I get WM_ENTERSIZEMOVE when it is System.WIndows.Forms.Form. Changed it to put out specific output when that message is received, otherwise too many messages.

    From the original output (partial):

    msg=0xa1 (WM_NCLBUTTONDOWN) hwnd=0x6b12ea wparam=0xb lparam=0x11402fb result=0x0

    msg=0x112 (WM_SYSCOMMAND) hwnd=0x6b12ea wparam=0xf002 lparam=0x11402fb result=0x0

    msg=0x24 (WM_GETMINMAXINFO) hwnd=0x6b12ea wparam=0x0 lparam=0x8fe1dc result=0x0

    msg=0x231 (WM_ENTERSIZEMOVE) hwnd=0x6b12ea wparam=0x0 lparam=0x0 result=0x0

    am attaching

    C1Ribbon_HighDpi.zip

  • Posted 17 December 2019, 2:02 am EST

    Hello,

    Thanks for the modified application. However, executing the same returned WM_ENTERSIZEMOVE and WM_EXITSIZEMOVE messages for both the windows form and C1RibbonForm.

    The attched gif shows this observation from our end.

    Regards,

    Esha

    Demo1.zip

  • Posted 17 December 2019, 2:03 am EST

    Hello,

    I executed the attached application, such that the form is a normal System.Windows.Form i.e. in Form1.Designer.cs, the class declaration is:

      partial class Form1: System.Windows.Forms.Form
    { .....}
    

    Even in this case, WM_ENTERSIZEMOVE and WM_EXITSIZEMOVE messages are not received when the form is resized.

    If we change the class declaration to:

        partial class Form1: C1.Win.Ribbon.C1RibbonForm
    {......}
    

    the observation is the same, as checked with 4.5.20193.393 builds.

    This seems to be coming from the general behavior of the forms and is not specific to C1RibbonForm.

    Regards,

    Esha

    C1Ribbon.zip

  • Posted 17 December 2019, 2:34 am EST

    I am sorry, I may not have communicated this correctly.

    The messages do not happen for C1RibbonForm when resizing the form by dragging the border. Moving the form the messages do fire.

  • Posted 17 December 2019, 3:56 am EST

    Hello,

    I could observe that WM_ENTERSIZEMOVE and WM_EXITSIZEMOVE messages were not returned for a C1RibbonForm, when it is resized.

    I have escalated the same to the development team [Internal Tracking ID: 413399] and will get back to you once I receive any information. In the mean time, do you wish to let us know about any other message that’s not returned?

    Thanks,

    Esha

  • Posted 17 December 2019, 9:36 am EST

    The reason I was looking at those messages: our windows may be “locked” by users - which means they can be maximized/minimized, but not closed, moved or sized. I can detect closing, but I cannot find a way to detect and prevent sizing (I could set the BorderStyle to fixed, but I need to detect the attempt to move or size so I could notify the user that the window is closed).

    Any suggestions would be welcome.

  • Posted 17 December 2019, 1:49 pm EST

    And another thing: I tried intercepting the WM_WINDOWPOSCHANGING message and changing the struct it is passing to restrict the width/height. Which works fine - in a visual-styled C1RibbonForm.

    BUT if it is a themed C1RibbonForm and it has some Dock-ed controls, those Dock-ed controls are being resized based on the imaginary width as the border is being dragged. That is, the window’s width stays the same but the Dock-ed controls are being resized based on the bigger width (if I am dragging the right border to the right).

    Checking during the SizeChanged event of the controls shows me that the window Width is let’s say 648 but its ClientRectangle’s Width is 708.

  • Posted 18 December 2019, 5:04 am EST

    Hello,

    Thank you for all the information and observations.

    We are investigating on the same and shall get back to you once it is done.

    Thanks.

  • Posted 17 March 2020, 8:42 am EST

    Hi Mike,

    The issue has been fixed in 2020V1 release and now WM_ENTERSIZEMOVE and WM_EXITSIZEMOVE messages are returned correctly when resizing the c1RibbonForm.

    Please upgrade your controls to the latest version to use this feature.

    Regards,

    Prabhat

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels