[Done] Window moves by itself

Just starting out? Need help? Post your questions and find answers here.
Dude
Addict
Addict
Posts: 1907
Joined: Mon Feb 16, 2015 2:49 pm

[Done] Window moves by itself

Post 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. :shock:

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
Last edited by Dude on Sat Mar 18, 2017 9:36 am, edited 1 time in total.
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: Window moves by itself

Post by IdeasVacuum »

Hi Dude

OS version? PB version?

From you description, the bug could equally be Microsoft's.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
Thunder93
Addict
Addict
Posts: 1788
Joined: Tue Mar 21, 2006 12:31 am
Location: Canada

Re: Window moves by itself

Post by Thunder93 »

Not experiencing this under Windows 10 w/PureBasic 5.60 Stable.
ʽʽSuccess is almost totally dependent upon drive and persistence. The extra energy required to make another effort or try another approach is the secret of winning.ʾʾ --Dennis Waitley
MrMat
Enthusiast
Enthusiast
Posts: 762
Joined: Sun Sep 05, 2004 6:27 am
Location: England

Re: Window moves by itself

Post by MrMat »

Edit: No bug, read onwards...
Last edited by MrMat on Sat Mar 18, 2017 12:12 pm, edited 1 time in total.
Mat
User avatar
Thunder93
Addict
Addict
Posts: 1788
Joined: Tue Mar 21, 2006 12:31 am
Location: Canada

Re: Window moves by itself

Post by Thunder93 »

Tested with PureBasic 5.44 Stable under Windows 10. I'm not observing this, which suggests Windows 7 is buggy? :lol:
ʽʽSuccess is almost totally dependent upon drive and persistence. The extra energy required to make another effort or try another approach is the secret of winning.ʾʾ --Dennis Waitley
MrMat
Enthusiast
Enthusiast
Posts: 762
Joined: Sun Sep 05, 2004 6:27 am
Location: England

Re: Window moves by itself

Post 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 :-)
Mat
User avatar
Thunder93
Addict
Addict
Posts: 1788
Joined: Tue Mar 21, 2006 12:31 am
Location: Canada

Re: Window moves by itself

Post by Thunder93 »

That'll be nice MrMat. :wink:
ʽʽSuccess is almost totally dependent upon drive and persistence. The extra energy required to make another effort or try another approach is the secret of winning.ʾʾ --Dennis Waitley
DontTalkToMe
Enthusiast
Enthusiast
Posts: 334
Joined: Mon Feb 04, 2013 5:28 pm

Re: Window moves by itself

Post 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.
User avatar
skywalk
Addict
Addict
Posts: 4219
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: Window moves by itself

Post 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?
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
User avatar
Thunder93
Addict
Addict
Posts: 1788
Joined: Tue Mar 21, 2006 12:31 am
Location: Canada

Re: Window moves by itself

Post by Thunder93 »

Windows 10 x64 w/PB 5.60 Stable. It's weird indeed, all the Windows jumps to the right for me. :shock:
ʽʽSuccess is almost totally dependent upon drive and persistence. The extra energy required to make another effort or try another approach is the secret of winning.ʾʾ --Dennis Waitley
User avatar
Josh
Addict
Addict
Posts: 1183
Joined: Sat Feb 13, 2010 3:45 pm

Re: Window moves by itself

Post 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. :shock:

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?
sorry for my bad english
User avatar
nco2k
Addict
Addict
Posts: 1344
Joined: Mon Sep 15, 2003 5:55 am

Re: Window moves by itself

Post 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
If OSVersion() = #PB_OS_Windows_ME : End : EndIf
MrMat
Enthusiast
Enthusiast
Posts: 762
Joined: Sun Sep 05, 2004 6:27 am
Location: England

Re: Window moves by itself

Post 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.
Mat
User avatar
Thunder93
Addict
Addict
Posts: 1788
Joined: Tue Mar 21, 2006 12:31 am
Location: Canada

Re: Window moves by itself

Post by Thunder93 »

... I wouldn't know, I've always included event loop. Basic 101 :lol:
ʽʽSuccess is almost totally dependent upon drive and persistence. The extra energy required to make another effort or try another approach is the secret of winning.ʾʾ --Dennis Waitley
User avatar
Josh
Addict
Addict
Posts: 1183
Joined: Sat Feb 13, 2010 3:45 pm

Re: Window moves by itself

Post 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 :?: :?: :?: :?:
Last edited by Josh on Thu Mar 16, 2017 3:50 pm, edited 1 time in total.
sorry for my bad english
Post Reply