Announcement

Collapse
No announcement yet.

Windows 10 Version 1803 missing %WM_SIZE messages in Power Basic for Windows 9.05

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Windows 10 Version 1803 missing %WM_SIZE messages in Power Basic for Windows 9.05


    Since my reluctant transistion to Windows 10 I have had to perform some Code modifications. The most troublesome seemed to be only after the Windows 10 Version 1803 Update. Under this Windows 10 Version, some of my programs seem to have the %WM_SIZE messages disappear after a few Size Changes. A convenient example of this is my EZ_Size Demo Code https://forum.powerbasic.com/forum/u...g-ez_size2-inc In addition to the INCLUDE File Code, make sure to get the 25 Mar 2014, 05:53 PM Demo Code since somehow the original got truncated.

    50 years ago when you might get a hernia carrying 8K of memory around I was OK with Code but not so much anymore and would appreciate help.

    My stumbling fix added a STATIC SizeBusy (LONG) variable to the Process FUNCTION and Changed the CASE %WM_SIZE as follows:

    Code:
    '''''' Deleted CASE %WM_SIZE ' <========== Must be included Called when window changes size
    CASE %WM_SIZE, %WM_WINDOWPOSCHANGING ' <========== Must be included Called when window changes size '''''' Added
    
    ' ===================== Start Group 1 ========================================================================
    IF ISTRUE SizeBusy THEN EXIT FUNCTION ELSE SizeBusy = %TRUE '''''' Added
    
    ' Must be included and called first
    EZ_Size CBHNDL, EZ_SizeData(), 0, "Initialize"
    
    ' Note: Box1a, Box1b, Box1c and Box2a are not re-sized however
    ' the default command is "Anchor Top Left"
    EZ_Size CBHNDL, EZ_SizeData(), %BoxA1d, "Stretch Horizontal Anchor Top"
    EZ_Size CBHNDL, EZ_SizeData(), %BoxA2b, "Stretch"
    EZ_Size CBHNDL, EZ_SizeData(), %BoxA2c, "Stretch Vertical Anchor Right"
    EZ_Size CBHNDL, EZ_SizeData(), %BoxA2d, "Anchor Top Right"
    EZ_Size CBHNDL, EZ_SizeData(), %BoxA3a, "Stretch Vertical Anchor Left"
    EZ_Size CBHNDL, EZ_SizeData(), %BoxA3b, "Anchor Bottom Left"
    EZ_Size CBHNDL, EZ_SizeData(), %BoxA3c, "Stretch Horizontal Anchor Bottom"
    EZ_Size CBHNDL, EZ_SizeData(), %BoxA3d, "Stretch Vertical Anchor Right"
    EZ_Size CBHNDL, EZ_SizeData(), %BoxA4a, "Anchor Bottom Left"
    EZ_Size CBHNDL, EZ_SizeData(), %BoxA4b, "Anchor Bottom Left"
    EZ_Size CBHNDL, EZ_SizeData(), %BoxA4c, "Anchor Bottom Left"
    EZ_Size CBHNDL, EZ_SizeData(), %BoxA4d, "Stretch Horizontal Anchor Bottom"
    
    EZ_Size CBHNDL, EZ_SizeData(), 0, "Clean-up"
    ' Must be included and called last
    SizeBusy = %FALSE '''''' Added

    The %WM_WINDOWPOSCHANGING picks up for the absense of %WM_SIZE messages and the SizeBusy keeps the Code from stepping on it's own tail. I know this is most probably not the proper way to handle things but I would like to know the proper way.

    All Help is appreciated!

    Last edited by Bob Scott; 5 Jul 2018, 06:13 PM. Reason: Added CODE Tags

  • #2
    Hey Bob!

    to have the %WM_SIZE messages disappear after a few Size Changes.
    I've never seen this happen. How did you come across the problem? Any additional details that would let me look for the problem in my own apps? I use %WM_Size code in pretty much all of my apps. Is it something that you've seen echoed on the web in other places?

    Have you seen it in a minimal code example, to be certain there's no other code conflicts involved?

    Comment


    • #3
      Gary, I have never seen this problem in any other Version of Windows but I have seen other Windows users seeing this problem even in Vista. I'll poke around with Google and see if I can get some links.

      Comment


      • #4
        I really doubt that Windows (version 1803) somehow stops sending the WM_SIZE messages. That would break too many apps if that happened. Now PB's DDT engine could have a bug in it which causes the problem on the latest version of Windows, but that would only be likely if Bob Zale did something internal which didn't follow the rules of the Windows API's and that too sounds unlikely to me. PB has worked flawlessly (in this case) for many years on previous versions of Windows, so the idea that something has changed in Windows is far fetched.

        I would look at the logic of your own code to see if maybe it has broken some of the rules of how things work in the WIN32 API. It has been my experience that some versions of Windows has tolerated some errors, when making an API call improperly, and then later versions of Windows they fix this so it no longer tolerates the error. This is one of the most common causes of the old "worked on previous version of Windows, but doesn't on latest version" problem.
        Chris Boss
        Computer Workshop
        Developer of "EZGUI"
        http://cwsof.com
        http://twitter.com/EZGUIProGuy

        Comment


        • #5

          From https://docs.microsoft.com/en-us/windows/desktop/winmsg the difference between WM_SIZE and WM_WINDOWPOSCHANGING is as follows.

          WM_SIZE message - Sent to a window after its size has changed.

          WM_WINDOWPOSCHANGING message - Sent to a window whose size, position, or place in the Z order is about to change as a result of a call to the SetWindowPos function or another window-management function.

          So, maybe this might explain why WM_SIZE messages are not seen after the application no longer responds to Re-Size requests.

          Maybe the WS_THICKFRAME dialog style is not properly functioning for some reason.

          If of any significance, I am running Windows 10 Pro Version 1803 (64 bit Operating System)
          Last edited by Bob Scott; 6 Jul 2018, 07:43 AM. Reason: Added Opersting System

          Comment


          • #6
            Bob,

            Be careful not to be quick to assume that Windows has broken something in it's latest iteration. In my experience it is usually something we did in our code that causes the problem. If there was something inherently wrong with WM_SIZE my EZGUI designer (used by many customers) would have shown it up very quickly (a lot of resizing done) , as well as my autoresize engine in EZGUI. I would have gotten a lot of complaints by now by customers, but haven't. I can't vouch that PB isn't part of the cause, but I also think it very unlikely (but not impossible).

            In my experience one thing I have seen a lot is programmers doing things in certain window messages which really is not advisable. Just because we have access to a Window message, does not mean we can do anything we want in that message. Especially in the low level window messages like WM_PAINT, WM_SIZE, etc. this is so. Why ?

            Because we often don't take into consideration what Windows is doing during that window message. WM_SIZE for example, may have a lot of things going on when it occurs. If we do something during that message which Windows does not like, then if run long enough it can create an instability. There is a clue to your problem in your statement:

            some of my programs seem to have the %WM_SIZE messages disappear after a few Size Changes
            When something works initially and then after a few iterations of the task it now stops, this is a tell-tale clue that possibly we have done something during a window message we shouldn't and if done long enough it breaks something. This is a tricky problem because one version of Windows may tolerate the error (or at least much longer), but a new version of Windows Microsoft may have fixed something or tightened the tolerances so that our "bug in waiting" now shows itself. This is far more common that most programmers realize.

            Chris Boss
            Computer Workshop
            Developer of "EZGUI"
            http://cwsof.com
            http://twitter.com/EZGUIProGuy

            Comment


            • #7
              Chris,

              You are probably correct by saying:
              When something works initially and then after a few iterations of the task it now stops, this is a tell-tale clue that possibly we have done something during a window message we shouldn't and if done long enough it breaks something.
              Remember in my initial post I said:
              50 years ago when you might get a hernia carrying 8K of memory around I was OK with Code but not so much anymore and would appreciate help.
              I guess it's time to look at my Re-Size Code......

              Comment

              Working...
              X