Detecting Window's Maximize Window Click

Alex Tweedly alex at tweedly.net
Wed May 31 10:19:17 EDT 2006


Rob Cozens wrote:

> Hi Ken,
>
>>>> Actually this doesn't work on Windows, Rob
>>>
>>>
>>> It looks like it's working fine here (WinXP TPC Edition 2005).
>>
>>
>> Well, I tried it on Win XP Pro SP 2 with this code:
>>
>>     on resizeStack newWidth,newHeight,oldWidth,oldHeight
>>         if newWidth = oldWidth and newHeight = oldHeight then
>>           put "Maximized"
>>         else
>>           put newWidth,newHeight,oldWidth,oldHeight
>>         end if
>>      end resizeStack
>>
>> it never put "maximized"... it always put the sizes in the message 
>> box, and
>> the numbers I get are something like:
>>
>>   1280,934,256,256
>>
>> so it's obvious that there's no match going on...
>>
That code never will (never should) put "Maximized"
What the Maximize icon does, on Win, is flip back and forward between 
"normal" size and "full screen" (in Rev, "full screen" is 
"windowBoundingRect", not "screenRect").

SO one time you should see (something like)
  1280,934,256,256
next time
   256,256,1280,934
next time
  1280,934,256,256
etc.

(When I say "never", I mean "almost never" - you could of course re-size 
the window by dragging until it is exactly the same size as it becomes 
when Maximized - then it should say it matched :-)

>
> Looking more closely at what's going on here it appears you are correct.
>
> What I'm seeing with an empty stack and your script is that clicking 
> on the Maximize Box reverses the width & height of the stack on WinXP.
>
> This is _not_ the response I get when clicking the Maximize Box on MS 
> applications like WordPad & NotePad: in those cases the Window grows 
> to full screen size or shrinks back to "normal" size.
>
> So is there a bug in Rev's Maximize Box logic for Windows?  It 
> certainly seems so to moi...especially since the behavior on MacOS is 
> different.
>
It works for me on 2.6.1., WinXP and Mac.  - flips between (in my case) 
927 x 674 and 400 x 400.

(Sorry - I haven't been following this thread closely, so if it's 2.7 
specific, then there may be a problem I haven't seen yet).



-- 
Alex Tweedly       http://www.tweedly.net



-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.7.3/350 - Release Date: 28/05/2006




More information about the use-livecode mailing list