Skip to main content
guest
Join | Help | Sign In
Liberty BASIC Community Wiki Home
guest| Join | Help | Sign In
Liberty BASIC Community Wiki
  • Wiki Home
  • Recent Changes
  • Pages and Files
  • Members
  • Home
    • Liberty BASIC FAQ
    • Contests
    • Tutorials
    • Science
    • Shared Code
    • Tips
    • DLLs
    • PublicDomainSprites
    • Member Pages
    • Links
    • Sandbox

ManagedCascade

Edit 0 7 …
  • 0 Tags
    • No tags
  • Notify
  • RSS
  • Backlinks
  • Source
  • Print
  • Export (PDF)
Older Version Newer Version

GrahameKing GrahameKing Apr 19, 2006

 '* Cascading windows and instance counting 
'* By Brent D. Thorn (http://www.b6sw.com/)
'* PUBLIC DOMAIN

Global g.WindowCount

Call CascadePosition
Open "1" For Window As #1
#1 TrapCloseCommon$()

Call CascadePosition
Open "2" For Window As #2
#2 TrapCloseCommon$()

Call CascadePosition
Open "3" For Window As #3
#3 TrapCloseCommon$()

Wait

Sub CommonClose handle$
Close #handle$
g.WindowCount = g.WindowCount - 1

Print "Closed ";handle$;". ";g.WindowCount;" window(s) open."

If g.WindowCount = 0 Then
Print "End of program."

End
End If
End Sub

Function TrapCloseCommon$()
TrapCloseCommon$ = "TrapClose CommonClose"
g.WindowCount = g.WindowCount + 1
End Function

Sub CascadePosition
offset = 0

CallDLL #user32, "GetSystemMetrics", _
_SM_CYCAPTION As ULong, _
cy As Long
offset = offset + cy

CallDLL #user32, "GetSystemMetrics", _
_SM_CYSIZEFRAME As ULong, _
cy As Long
offset = offset + cy

UpperLeftX = UpperLeftX + offset
UpperLeftY = UpperLeftY + offset

If UpperLeftX + WindowWidth > DisplayWidth _
Or UpperLeftY + WindowHeight > DisplayHeight Then
UpperLeftX = 1
UpperLeftY = 1
End If
End Sub
Help · About · Pricing · Privacy · Terms · Support · Upgrade
Contributions to https://basic.wikispaces.com/ are licensed under a Creative Commons Attribution Share-Alike 2.5 License. Creative Commons Attribution Share-Alike 2.5 License
Portions not contributed by visitors are Copyright 2018 Tangient LLC
TES: The largest network of teachers in the world
Turn off "Getting Started"
  1. Home
  2. ...
Loading...