PureBasic Forum
https://www.purebasic.fr/english/

ResizeWindow() - a known issue with Windows 10?
https://www.purebasic.fr/english/viewtopic.php?f=5&t=75458
Page 1 of 1

Author:  StarWarsFan [ Thu Jun 04, 2020 11:15 am ]
Post subject:  ResizeWindow() - a known issue with Windows 10?

Hey friends!
Hope you are all doing fine and C19 does not bite you!

Got this issue: I found out that some code that I wrote which resizes a window depending on how much dynamic data (a list) is shown
- works well on Windows 7
- but totally screws up the display on Windows 10
I have melted down the issue to be related to the command "ResizeWindow()". Everything else works well.

Before I begin the discussion I wish to ask: Is this a known bug?

Author:  BarryG [ Thu Jun 04, 2020 11:51 am ]
Post subject:  Re: ResizeWindow() - a known issue with Windows 10?

StarWarsFan wrote:
Is this a known bug?

Short: No.
Long: We need to see some code.

Author:  StarWarsFan [ Thu Jun 04, 2020 11:57 am ]
Post subject:  Re: ResizeWindow() - a known issue with Windows 10?

Hey Barry! Nice to see you again!

Okay, then let me get home and post some code (Got that code at home on laptop).

Author:  Kiffi [ Thu Jun 04, 2020 12:11 pm ]
Post subject:  Re: ResizeWindow() - a known issue with Windows 10?

StarWarsFan wrote:
Okay, then let me get home and post some code

Please only post executable code that is as short as possible and with which we can reproduce your problem.

Author:  StarWarsFan [ Fri Jun 05, 2020 1:19 pm ]
Post subject:  Re: ResizeWindow() - a known issue with Windows 10?

I was experimenting with ResizeWindow() to display a little "window-animation". Enlarging the window to show more data.
This works fine under Win7, it does not on Win10.

The code that I use on Win7 is:
Code:
scrollREIN:  ;- scrollREIN
  summe=0
  For x= 1 To 5 : ResizeWindow(#main,WindowX(#main)-1,#PB_Ignore,WindowWidth(#main)+1,#PB_Ignore) : Mydelay(10) : Next : summe +x*1
  For x= 1 To 6 : ResizeWindow(#main,WindowX(#main)-2,#PB_Ignore,WindowWidth(#main)+2,#PB_Ignore) : Mydelay(10) : Next : summe +x*2
  For x= 1 To 8 : ResizeWindow(#main,WindowX(#main)-4,#PB_Ignore,WindowWidth(#main)+4,#PB_Ignore) : Mydelay(10) : Next : summe +x*4
  For x= 1 To 25: ResizeWindow(#main,WindowX(#main)-5,#PB_Ignore,WindowWidth(#main)+5,#PB_Ignore) : Mydelay(10) : Next : summe +x*5
  For x= 1 To 8 : ResizeWindow(#main,WindowX(#main)-4,#PB_Ignore,WindowWidth(#main)+4,#PB_Ignore) : Mydelay(10) : Next : summe +x*4
  For x= 1 To 6 : ResizeWindow(#main,WindowX(#main)-2,#PB_Ignore,WindowWidth(#main)+2,#PB_Ignore) : Mydelay(10) : Next : summe +x*2
  For x= 1 To 5 : ResizeWindow(#main,WindowX(#main)-1,#PB_Ignore,WindowWidth(#main)+1,#PB_Ignore) : Mydelay(10) : Next : summe +x*1
Return

scrollRAUS:  ;- scrollRAUS
  summe=0
  For x= 1 To 5 : ResizeWindow(#main,WindowX(#main)+1,#PB_Ignore,WindowWidth(#main)-1,#PB_Ignore) : Mydelay(10) : Next : summe +x*1
  For x= 1 To 6 : ResizeWindow(#main,WindowX(#main)+2,#PB_Ignore,WindowWidth(#main)-2,#PB_Ignore) : Mydelay(10) : Next : summe +x*2
  For x= 1 To 8 : ResizeWindow(#main,WindowX(#main)+4,#PB_Ignore,WindowWidth(#main)-4,#PB_Ignore) : Mydelay(10) : Next : summe +x*4
  For x= 1 To 25: ResizeWindow(#main,WindowX(#main)+5,#PB_Ignore,WindowWidth(#main)-5,#PB_Ignore) : Mydelay(10) : Next : summe +x*5
  For x= 1 To 8 : ResizeWindow(#main,WindowX(#main)+4,#PB_Ignore,WindowWidth(#main)-4,#PB_Ignore) : Mydelay(10) : Next : summe +x*4
  For x= 1 To 6 : ResizeWindow(#main,WindowX(#main)+2,#PB_Ignore,WindowWidth(#main)-2,#PB_Ignore) : Mydelay(10) : Next : summe +x*2
  For x= 1 To 5 : ResizeWindow(#main,WindowX(#main)+1,#PB_Ignore,WindowWidth(#main)-1,#PB_Ignore) : Mydelay(10) : Next : summe +x*1
Return


Again: The astonishing thing is that this little "animation" works as desired on Win7, but on Win10 it just won't.

Author:  netmaestro [ Mon Jun 08, 2020 7:24 pm ]
Post subject:  Re: ResizeWindow() - a known issue with Windows 10?

Seems to work here on Windows 10:
Code:
Procedure MyDelay(val.i)
  While WindowEvent():Wend
  Delay(val)
EndProcedure

#main=0
OpenWindow(0,0,0,640,480,"",#PB_Window_ScreenCentered|#PB_Window_SystemMenu)

Gosub scrollrein

Repeat:Until WaitWindowEvent()=#PB_Event_CloseWindow

End

scrollREIN:  ;- scrollREIN
  summe=0
  For x= 1 To 5 : ResizeWindow(#main,WindowX(#main)-1,#PB_Ignore,WindowWidth(#main)+1,#PB_Ignore) : MyDelay(10) : Next : summe +x*1
  For x= 1 To 6 : ResizeWindow(#main,WindowX(#main)-2,#PB_Ignore,WindowWidth(#main)+2,#PB_Ignore) : MyDelay(10) : Next : summe +x*2
  For x= 1 To 8 : ResizeWindow(#main,WindowX(#main)-4,#PB_Ignore,WindowWidth(#main)+4,#PB_Ignore) : MyDelay(10) : Next : summe +x*4
  For x= 1 To 25: ResizeWindow(#main,WindowX(#main)-5,#PB_Ignore,WindowWidth(#main)+5,#PB_Ignore) : MyDelay(10) : Next : summe +x*5
  For x= 1 To 8 : ResizeWindow(#main,WindowX(#main)-4,#PB_Ignore,WindowWidth(#main)+4,#PB_Ignore) : MyDelay(10) : Next : summe +x*4
  For x= 1 To 6 : ResizeWindow(#main,WindowX(#main)-2,#PB_Ignore,WindowWidth(#main)+2,#PB_Ignore) : MyDelay(10) : Next : summe +x*2
  For x= 1 To 5 : ResizeWindow(#main,WindowX(#main)-1,#PB_Ignore,WindowWidth(#main)+1,#PB_Ignore) : MyDelay(10) : Next : summe +x*1
  Return

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/