aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS-TheRevival/MainForms/DesktopEnvironment/master/DesktopManager.vb
blob: ed3ebce089ddc04925e579ba2e24d52fbc0e39d7 (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
47
48
49
50
51
52
53
Imports System.Threading

Module DesktopManager
    Public IsStartG As Boolean

    Public Sub StartG()
        IsStartG = True
        Desktop.Show()
        Desktop.FormBorderStyle = FormBorderStyle.None
        Desktop.WindowState = FormWindowState.Maximized
        Desktop.TopMost = False
        IsConsoleParent = False
        Console.Dispose()
        WindowManagerChoose()
        Cursor.Show()
    End Sub

    Public Sub StopG()
        IsStartG = False
        IsConsoleParent = True
        TerminateWindowApps()
        Cursor.Hide()
        If Strings.OnceInfo(6) = "story" Then
            SaveGame()
        End If
        If Strings.ComputerInfo(7) = 1 Then
            MsgBox("this is not a bug, this is a feature") 'Use this messagebox to hold Console to stay open, because removing this line closes Console all together for some reason
        End If
        Console.Show()
        Desktop.Hide()
    End Sub

    Public Sub TerminateWindowApps()
        Dim MaxPID As Integer = 0
        Do
            If MaxPID = 2 Then
                Exit Do
            Else
                Strings.ProcessID(MaxPID) = 0
                MaxPID = MaxPID + 1
            End If
        Loop
    End Sub

    Public Sub WindowManagerChoose()
        Select Case Strings.ComputerInfo(7)
            Case 1
                DuWM_Initiate()
            Case 2
                AnusWM_Initiate()
        End Select
    End Sub
End Module