ShiftOS-TheRevival-Old/ShiftOS-TheRevival/MainForms/WindowManager/DualWindowManager/DuWM_WindowContainer.vb

45 lines
1.6 KiB
VB.net
Raw Normal View History

2022-11-20 14:53:17 +00:00
Public Class DuWM_WindowContainer
2022-11-21 22:42:55 +00:00
Public ChildForm As New Form
2022-11-20 14:53:17 +00:00
Public DuWM_PID As Integer
Private Sub DuWM_WindowContainer_Load(sender As Object, e As EventArgs) Handles MyBase.Load
2022-11-21 06:56:13 +00:00
DuWM_WMCheck.Start()
DuWM_ChildSize.Start()
2022-11-21 22:42:55 +00:00
DuWM_LayoutCheck.Start()
2022-11-20 14:53:17 +00:00
End Sub
Private Sub DuWM_WMCheck_Tick(sender As Object, e As EventArgs) Handles DuWM_WMCheck.Tick
2022-11-21 06:56:13 +00:00
If ChildForm.Visible = False Then
Strings.ProcessID(DuWM_PID) = 0
End If
2022-11-20 14:53:17 +00:00
If Strings.ProcessID(DuWM_PID) = 0 Then
2022-11-21 22:42:55 +00:00
DuWM_CurrentProcess = DuWM_CurrentProcess - 1
DuWM_ChangeLayout = True
DuWM_WMCheck.Stop()
2022-11-20 14:53:17 +00:00
Close()
End If
End Sub
2022-11-21 06:56:13 +00:00
Private Sub ChildSize_Tick(sender As Object, e As EventArgs) Handles DuWM_ChildSize.Tick
ChildForm.Size = DuWM_ContainerPanel.Size
End Sub
2022-11-21 22:42:55 +00:00
Private Sub DuWM_LayoutCheck_Tick(sender As Object, e As EventArgs) Handles DuWM_LayoutCheck.Tick
If DuWM_ChangeLayout = True Then
Select Case DuWM_CurrentProcess
Case 1
Height = Desktop.Height - 20
Width = Desktop.Width - 20
Location = New Point(10, 10)
Case 2
Select Case DuWM_PID
Case 0
Height = Desktop.Height - 20
Width = (Desktop.Width / 2) - 20
Location = New Point(10, 10)
End Select
End Select
DuWM_ChangeLayout = False
End If
End Sub
2022-11-20 14:53:17 +00:00
End Class