aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS-TheRevival/MainForms/WindowManager/DualWindowManager/DuWM_WindowContainer.vb
blob: 26b9d04646db7ad32e19a7f3198d83fcd806a5bf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
Public Class DuWM_WindowContainer
    Public ChildForm As New Form
    Public DuWM_PID As Integer

    Private Sub DuWM_WindowContainer_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        DuWM_WMCheck.Start()
        DuWM_ChildSize.Start()
        DuWM_LayoutCheck.Start()
    End Sub

    Private Sub DuWM_WMCheck_Tick(sender As Object, e As EventArgs) Handles DuWM_WMCheck.Tick
        If ChildForm.Visible = False Then
            Strings.ProcessID(DuWM_PID) = 0
        End If
        If Strings.ProcessID(DuWM_PID) = 0 Then
            'MsgBox(Convert.ToString(ChildForm))
            DuWM_CurrentProcess = DuWM_CurrentProcess - 1
            DuWM_ChangeLayout = True
            DuWM_WMCheck.Stop()
            Close()
        End If
    End Sub

    Private Sub ChildSize_Tick(sender As Object, e As EventArgs) Handles DuWM_ChildSize.Tick
        ChildForm.Size = DuWM_ContainerPanel.Size
    End Sub

    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
End Class