Page 1 of 3
[Done] Window moves by itself
Posted: Thu Mar 16, 2017 1:15 pm
by Dude
This is the weirdest bug I've ever seen. Three windows are opened at the same Y position, but if you click another window during the delay (such as Calculator), then the third window magically moves down a little bit lower than the others.
Code: Select all
OpenWindow(1,10,10,50,50,"")
OpenWindow(2,100,10,50,50,"")
OpenWindow(3,200,10,50,50,"")
Sleep_(2000) ; Click Calculator during this time!
GetForegroundWindow_()
Repeat : Sleep_(1) : ForEver
Re: Window moves by itself
Posted: Thu Mar 16, 2017 1:32 pm
by IdeasVacuum
Hi Dude
OS version? PB version?
From you description, the bug could equally be Microsoft's.
Re: Window moves by itself
Posted: Thu Mar 16, 2017 2:04 pm
by Thunder93
Not experiencing this under Windows 10 w/PureBasic 5.60 Stable.
Re: Window moves by itself
Posted: Thu Mar 16, 2017 2:07 pm
by MrMat
Edit: No bug, read onwards...
Re: Window moves by itself
Posted: Thu Mar 16, 2017 2:12 pm
by Thunder93
Tested with PureBasic 5.44 Stable under Windows 10. I'm not observing this, which suggests Windows 7 is buggy?

Re: Window moves by itself
Posted: Thu Mar 16, 2017 2:13 pm
by MrMat
It may be. I'll try it on my Windows 10 machine tonight. Or it could be something else installed that is having this effect. I'll do more testing later

Re: Window moves by itself
Posted: Thu Mar 16, 2017 2:15 pm
by Thunder93
That'll be nice MrMat.

Re: Window moves by itself
Posted: Thu Mar 16, 2017 2:42 pm
by DontTalkToMe
This is enough to make it happen on win7 with aero enabled, you can just click on the windows, you don't need calc.exe.
They all move down.
Code: Select all
OpenWindow(1,10,10,50,50,"")
OpenWindow(2,100,10,50,50,"")
OpenWindow(3,200,10,50,50,"")
Repeat : Delay(0) : ForEver
;Repeat : e = WindowEvent() : ForEver
But if you process the events as you should, it doesn't happen.
Re: Window moves by itself
Posted: Thu Mar 16, 2017 2:49 pm
by skywalk
Confirmed on Windows 10 Pro pb v56 x64.
But, I never create visible windows without an event loop so not sure what problem you are trying to solve?
Re: Window moves by itself
Posted: Thu Mar 16, 2017 3:11 pm
by Thunder93
Windows 10 x64 w/PB 5.60 Stable. It's weird indeed, all the Windows jumps to the right for me.

Re: Window moves by itself
Posted: Thu Mar 16, 2017 3:23 pm
by Josh
Dude wrote:This is the weirdest bug I've ever seen. Three windows are opened at the same Y position, but if you click another window during the delay (such as Calculator), then the third window magically moves down a little bit lower than the others.
Code: Select all
OpenWindow(1,10,10,50,50,"")
OpenWindow(2,100,10,50,50,"")
OpenWindow(3,200,10,50,50,"")
Sleep_(2000) ; Click Calculator during this time!
GetForegroundWindow_()
Repeat : Sleep_(1) : ForEver
Sorry dude, but this posting is nothing else then ridiculous. In six lines you use three Api's, don't mind the minimum rules for an event loop and and then you dare to post this here in the bug-forum?
Re: Window moves by itself
Posted: Thu Mar 16, 2017 3:34 pm
by nco2k
are you guys telling me that you never saw this in the past 10 years? this is normal behavior since windows vista, when a window is not responding anymore. you dont use an event loop, thats why this is happening. no bug, just a windows thing.
c ya,
nco2k
Re: Window moves by itself
Posted: Thu Mar 16, 2017 3:41 pm
by MrMat
Yeah I didn't read the code properly (quick copy and paste at the end of a lunch break!), it is just the lack of event loop... Adding that in is fine.
Re: Window moves by itself
Posted: Thu Mar 16, 2017 3:42 pm
by Thunder93
... I wouldn't know, I've always included event loop. Basic 101

Re: Window moves by itself
Posted: Thu Mar 16, 2017 3:45 pm
by Josh
@Dude
And another thing. What do you really want to do with the command 'GetForegroundWindow_()'?
Like the name of the command says, you
get something. But your code does .... ähhh .... yes .... what it does
