Treat windows or at least window identities as first class objects.

 Store window identities in variables, compare them for equality.
 Provide examples of performing some of the following:
 hide, 
 show, 
 close, 
 minimize, 
 maximize, 
 move,     and 
 resize a window. 


The window of interest may or may not have been created by your program.




sWindow As New String[4]
'________________________
Public Sub Form_Open()
 
Manipulate
 
End
'________________________
Public Sub Manipulate()
Dim siDelay As Short = 2
 
Me.Show
Print "Show"
Wait siDelay
 
sWindow[0] = Me.Width
sWindow[1] = Me.Height
sWindow[2] = Me.X
sWindow[3] = Me.y
 
Me.Hide
Print "Hidden"
CompareWindow
Wait siDelay
 
Me.Show
Print "Show"
CompareWindow
Wait siDelay
 
Me.Minimized = True
Print "Minimized"
CompareWindow
Wait siDelay
 
Me.Show
Print "Show"
CompareWindow
Wait siDelay
 
Me.Maximized = True
Print "Maximized"
CompareWindow
Wait siDelay
 
Me.Maximized = False
Print "Not Maximized"
CompareWindow
Wait siDelay
 
Me.Height = 200
Me.Width = 300
Print "Resized"
CompareWindow
Wait siDelay
 
Me.x = 10
Me.Y = 10
Print "Moved"
CompareWindow
Wait siDelay
 
Me.Close
 
End
'________________________
Public Sub CompareWindow()
Dim sNewWindow As New String[4]
Dim siCount As Short
Dim bMatch As Boolean = True
 
sNewWindow[0] = Me.Width
sNewWindow[1] = Me.Height
sNewWindow[2] = Me.X
sNewWindow[3] = Me.y
 
For siCount = 0 To 3
  If sWindow[siCount] <> sNewWindow[siCount] Then bMatch = False
Next
 
If bMatch Then 
  Print "Windows identities match the original window size"
Else
  Print "Windows identities DONOT match the original window size"
End If
 
End