-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathInitForm.vb
81 lines (57 loc) · 2.31 KB
/
InitForm.vb
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
Imports System.IO
Public Class InitForm
Shared Sub Main()
Dim res1 As Point
Dim res2 As Point
Try
Application.EnableVisualStyles()
Application.SetCompatibleTextRenderingDefault(False)
' LogIt("Starting...")
' First install
If File.Exists("VanillaLauncher.db") Then
' LogIt("Database VanillaLauncher.db found.")
Else
'LogIt("Database not found, creating it.")
CreateDatabase()
End If
' Retrieve application parameters
Get_Params()
' Change this if we deploy a new version !
' If DB_VERSION < 1 Then
' LogIt("Database version changed, upgrading it.")
' UpgradeDatabase()
'End If
TOTAL_RAM = My.Computer.Info.TotalPhysicalMemory
'LogIt("Computer RAM : " & TOTAL_RAM)
NBR_MONITORS = Screen.AllScreens.Length
' LogIt("Monitors detected : " & NBR_MONITORS)
If NBR_MONITORS = 1 Then
res1 = GetAllScreensResolution()
SCREEN1_RATIO = res1.X / res1.Y
'LogIt("Monitor Ratio : " & res1.X & " / " & res1.Y)
ElseIf NBR_MONITORS = 2 Then
res1 = GetPrimaryScreenResolution()
res2 = GetSecondaryScreenResolution()
SCREEN1_RATIO = res1.X / res1.Y
SCREEN2_RATIO = res2.X / res2.Y
' LogIt("Monitor 1 Ratio : " & res1.X & " / " & res1.Y)
' LogIt("Monitor 2 Ratio : " & res2.X & " / " & res2.Y)
Else ' more than 2 screens : unmanaged yet
' LogIt("You have more than 2 monitors on this computer, this is not managed by the application")
res1 = GetAllScreensResolution()
SCREEN1_RATIO = res1.X / res1.Y
End If
Application.Run(New MainForm) 'Specify the startup form
InitForm.Dispose()
Catch ex As Exception
End Try
End Sub
Private Sub Init_form()
End Sub
Private Sub LogIt(strText As String)
Try
TextBoxLog.Text = TextBoxLog.Text & Format(Now, "hh:nn:ss") & " " & strText & vbCrLf
Catch ex As Exception
End Try
End Sub
End Class