
This is highly annoying, so i wrote some code to reset all windows.

Code & Example (should also work on x86):
Code: Select all
EnableExplicit
Procedure.i RestoreWindows(Handle.i,Store.i)
Static NewList *wp.WINDOWPLACEMENT()
Select Store
Case #True
ForEach *wp()
FreeMemory(*wp())
Next
ClearList(*wp())
EnumWindows_(@RestoreWindows(),-1)
ProcedureReturn #Null
Case #False
ForEach *wp()
Store = PeekI(*wp() + SizeOf(WINDOWPLACEMENT))
SetWindowPlacement_(Store,*wp())
If *wp()\showCmd = #SW_MAXIMIZE;<- quick hack to deal with maximized windows ^_^
ShowWindow_(Store,#SW_RESTORE)
ShowWindow_(Store,*wp()\showCmd)
EndIf
FreeMemory(*wp())
Next
ClearList(*wp())
ProcedureReturn #Null
Default
If IsWindowVisible_(Handle)
Store = AllocateMemory(SizeOf(WINDOWPLACEMENT) + SizeOf(Integer))
If Store
If AddElement(*wp())
*wp() = Store
*wp()\Length = SizeOf(WINDOWPLACEMENT)
GetWindowPlacement_(Handle,*wp())
PokeI(*wp() + SizeOf(WINDOWPLACEMENT),Handle)
Else
FreeMemory(Store)
EndIf
EndIf
EndIf
ProcedureReturn #True
EndSelect
EndProcedure
RestoreWindows(#Null,#True);<- store all window positions
InitSprite()
If OpenScreen(800,600,32,#Null$,#PB_Screen_WaitSynchronization,60)
Repeat
FlipBuffers()
Until GetAsyncKeyState_(#VK_ESCAPE) & 1
CloseScreen()
EndIf
RestoreWindows(#Null,#False);<- restore all window positions
End