aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS/coherencemode.vb
blob: 42352fbca2c388a29640478b93ee3b94b467c443 (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
Module coherencemode
    Private CoherenceModeProgramForm As New coherencemodeform
    Public AnyOtherProgram As Boolean = False

    Public Sub setupwindows(ByVal programname As String)
        If AnyOtherProgram = False Then
            Try
                Dim NewProgramName As String = programname.ToLower
                Dim win As Window = Window.Find(NewProgramName)
                Dim PreviouwWindowSize As System.Drawing.Size = win.Size
                CoherenceModeProgramForm.programnametokeep = win
                win.Style(Window.Styles.Border) = False
                win.Style(Window.Styles.Sizable) = False
                win.Invalidate()
                'win.Size = New Size(0, 0)
                'win.Size = PreviouwWindowSize

                CoherenceModeProgramForm.Show()
                win.Location = New Point(CoherenceModeProgramForm.Location.X, CoherenceModeProgramForm.Location.Y + ShiftOSDesktop.titlebarheight)
                win.TopMost = True
                CoherenceModeProgramForm.TopMost = True
                CoherenceModeProgramForm.Focus()
                CoherenceModeProgramForm.Size = PreviouwWindowSize
                win.Text = CoherenceModeProgramForm.lbtitletext.Text
                CoherenceModeProgramForm.resettitlebar()
                CoherenceModeProgramForm.setuptitlebar()
                CoherenceModeProgramForm.setupborders()
                CoherenceModeProgramForm.pgcontents.BackColor = Color.FromArgb(1, 0, 1)

                AnyOtherProgram = True
            Catch ex As Exception
                infobox.showinfo("Critical Error - Coherence Mode", "A Critical error occured whilst attempting to join the program")
            End Try
        Else
            infobox.showinfo("Information - Coherence Mode", "You can only have one program within coherence mode at any given time, this includes only one mod open for the moment, this is soon to change")
        End If
    End Sub

End Module