├── .vs
└── MelodysLowLatencyUI
│ ├── FileContentIndex
│ ├── read.lock
│ └── 8e106aac-5c89-4f68-a791-61548f8d8932.vsidx
│ ├── v16
│ ├── Server
│ │ └── sqlite3
│ │ │ ├── db.lock
│ │ │ └── storage.ide
│ └── .suo
│ └── v17
│ └── .suo
├── MelodysLowLatencyUI
├── Form2.vb
├── Resources
│ ├── Form3.vb
│ ├── LL_off.png
│ ├── LL_on.png
│ ├── mouse2.png
│ ├── LL_off_PS.png
│ ├── MeUILicense.txt
│ ├── Form3.Designer.vb
│ └── Form3.resx
├── ll_software.ico
├── App.config
├── My Project
│ ├── Settings.settings
│ ├── Application.myapp
│ ├── AssemblyInfo.vb
│ ├── Application.Designer.vb
│ ├── Settings.Designer.vb
│ ├── Resources.Designer.vb
│ └── Resources.resx
├── ApplicationEvents.vb
├── Form2.Designer.vb
├── app.manifest
├── Form2.resx
├── MelodysLowLatencyUI.vbproj
├── Form1.Designer.vb
└── Form1.vb
├── .gitattributes
├── MelodysLowLatencyUI.sln
└── README.md
/.vs/MelodysLowLatencyUI/FileContentIndex/read.lock:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.vs/MelodysLowLatencyUI/v16/Server/sqlite3/db.lock:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/MelodysLowLatencyUI/Form2.vb:
--------------------------------------------------------------------------------
1 | Public Class Form2
2 |
3 | End Class
--------------------------------------------------------------------------------
/MelodysLowLatencyUI/Resources/Form3.vb:
--------------------------------------------------------------------------------
1 | Public Class Form3
2 |
3 | End Class
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
--------------------------------------------------------------------------------
/.vs/MelodysLowLatencyUI/v16/.suo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SheMelody/low-latency-software/HEAD/.vs/MelodysLowLatencyUI/v16/.suo
--------------------------------------------------------------------------------
/.vs/MelodysLowLatencyUI/v17/.suo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SheMelody/low-latency-software/HEAD/.vs/MelodysLowLatencyUI/v17/.suo
--------------------------------------------------------------------------------
/MelodysLowLatencyUI/ll_software.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SheMelody/low-latency-software/HEAD/MelodysLowLatencyUI/ll_software.ico
--------------------------------------------------------------------------------
/MelodysLowLatencyUI/Resources/LL_off.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SheMelody/low-latency-software/HEAD/MelodysLowLatencyUI/Resources/LL_off.png
--------------------------------------------------------------------------------
/MelodysLowLatencyUI/Resources/LL_on.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SheMelody/low-latency-software/HEAD/MelodysLowLatencyUI/Resources/LL_on.png
--------------------------------------------------------------------------------
/MelodysLowLatencyUI/Resources/mouse2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SheMelody/low-latency-software/HEAD/MelodysLowLatencyUI/Resources/mouse2.png
--------------------------------------------------------------------------------
/MelodysLowLatencyUI/Resources/LL_off_PS.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SheMelody/low-latency-software/HEAD/MelodysLowLatencyUI/Resources/LL_off_PS.png
--------------------------------------------------------------------------------
/.vs/MelodysLowLatencyUI/v16/Server/sqlite3/storage.ide:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SheMelody/low-latency-software/HEAD/.vs/MelodysLowLatencyUI/v16/Server/sqlite3/storage.ide
--------------------------------------------------------------------------------
/.vs/MelodysLowLatencyUI/FileContentIndex/8e106aac-5c89-4f68-a791-61548f8d8932.vsidx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SheMelody/low-latency-software/HEAD/.vs/MelodysLowLatencyUI/FileContentIndex/8e106aac-5c89-4f68-a791-61548f8d8932.vsidx
--------------------------------------------------------------------------------
/MelodysLowLatencyUI/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/MelodysLowLatencyUI/My Project/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/MelodysLowLatencyUI/Resources/MeUILicense.txt:
--------------------------------------------------------------------------------
1 | This software is distributed without any warranty and I'm not responsible for ANY damage caused to your computer, especially in case of running it in any older Windows version than 10 1803.
2 |
3 | I'm not responsible for any damage caused to your computer in case of wrong use of this software, as well as in case of use with modified and stripped Operating Systems.
4 |
5 | Do you agree with this?
--------------------------------------------------------------------------------
/MelodysLowLatencyUI/My Project/Application.myapp:
--------------------------------------------------------------------------------
1 |
2 |
3 | true
4 | Form1
5 | true
6 | 0
7 | true
8 | 0
9 | false
10 |
--------------------------------------------------------------------------------
/MelodysLowLatencyUI/ApplicationEvents.vb:
--------------------------------------------------------------------------------
1 | Namespace My
2 | ' Per MyApplication sono disponibili gli eventi seguenti:
3 | ' Startup: generato all'avvio dell'applicazione, prima della creazione del form di avvio.
4 | ' Shutdown: generato dopo la chiusura di tutti i form dell'applicazione. Questo evento non viene generato se l'applicazione termina in modo anomalo.
5 | ' UnhandledException: generato se nell'applicazione si verifica un'eccezione non gestita.
6 | ' StartupNextInstance: generato all'avvio di un'applicazione a istanza singola se l'applicazione è già attiva.
7 | ' NetworkAvailabilityChanged: generato quando la connessione di rete viene connessa o disconnessa.
8 | Partial Friend Class MyApplication
9 | Private Sub crash(ByVal sender As Object, ByVal e As ApplicationServices.UnhandledExceptionEventArgs) Handles Me.UnhandledException
10 | Try
11 | Form1.DisableAll()
12 | Catch ex As Exception
13 | End Try
14 | MsgBox("A fatal error has occurred and the program can't continue: " & e.Exception.Message, MsgBoxStyle.Critical, "Fatal Error")
15 | End Sub
16 | End Class
17 | End Namespace
18 |
--------------------------------------------------------------------------------
/MelodysLowLatencyUI/My Project/AssemblyInfo.vb:
--------------------------------------------------------------------------------
1 | Imports System
2 | Imports System.Reflection
3 | Imports System.Runtime.InteropServices
4 |
5 | ' Le informazioni generali relative a un assembly sono controllate dal seguente
6 | ' set di attributi. Modificare i valori di questi attributi per modificare le informazioni
7 | ' associate a un assembly.
8 |
9 | ' Controllare i valori degli attributi degli assembly
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 | 'Se il progetto viene esposto a COM, il GUID seguente verrà usato come ID del typelib
21 |
22 |
23 | ' Le informazioni sulla versione di un assembly sono costituite dai seguenti quattro valori:
24 | '
25 | ' Versione principale
26 | ' Versione secondaria
27 | ' Numero di build
28 | ' Revisione
29 | '
30 | ' È possibile specificare tutti i valori oppure impostare valori predefiniti per i numeri relativi alla revisione e alla build
31 | ' usando l'asterisco '*' come illustrato di seguito:
32 | '
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/MelodysLowLatencyUI.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 16
4 | VisualStudioVersion = 16.0.29424.173
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "MelodysLowLatencyUI", "MelodysLowLatencyUI\MelodysLowLatencyUI.vbproj", "{DBAF9D3D-E86E-44FC-95E6-22C6BE793FC8}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Debug|x64 = Debug|x64
12 | Release|Any CPU = Release|Any CPU
13 | Release|x64 = Release|x64
14 | EndGlobalSection
15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
16 | {DBAF9D3D-E86E-44FC-95E6-22C6BE793FC8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17 | {DBAF9D3D-E86E-44FC-95E6-22C6BE793FC8}.Debug|Any CPU.Build.0 = Debug|Any CPU
18 | {DBAF9D3D-E86E-44FC-95E6-22C6BE793FC8}.Debug|x64.ActiveCfg = Debug|x64
19 | {DBAF9D3D-E86E-44FC-95E6-22C6BE793FC8}.Debug|x64.Build.0 = Debug|x64
20 | {DBAF9D3D-E86E-44FC-95E6-22C6BE793FC8}.Release|Any CPU.ActiveCfg = Release|Any CPU
21 | {DBAF9D3D-E86E-44FC-95E6-22C6BE793FC8}.Release|Any CPU.Build.0 = Release|Any CPU
22 | {DBAF9D3D-E86E-44FC-95E6-22C6BE793FC8}.Release|x64.ActiveCfg = Release|x64
23 | {DBAF9D3D-E86E-44FC-95E6-22C6BE793FC8}.Release|x64.Build.0 = Release|x64
24 | EndGlobalSection
25 | GlobalSection(SolutionProperties) = preSolution
26 | HideSolutionNode = FALSE
27 | EndGlobalSection
28 | GlobalSection(ExtensibilityGlobals) = postSolution
29 | SolutionGuid = {BB2F98B7-ECE5-497B-8646-4B5767BD5C17}
30 | EndGlobalSection
31 | EndGlobal
32 |
--------------------------------------------------------------------------------
/MelodysLowLatencyUI/My Project/Application.Designer.vb:
--------------------------------------------------------------------------------
1 | '------------------------------------------------------------------------------
2 | '
3 | ' Il codice è stato generato da uno strumento.
4 | ' Versione runtime:4.0.30319.42000
5 | '
6 | ' Le modifiche apportate a questo file possono provocare un comportamento non corretto e andranno perse se
7 | ' il codice viene rigenerato.
8 | '
9 | '------------------------------------------------------------------------------
10 |
11 | Option Strict On
12 | Option Explicit On
13 |
14 |
15 | Namespace My
16 |
17 | 'NOTA: questo file è generato automaticamente e non può essere modificato direttamente. Per apportare modifiche
18 | ' o se vengono rilevati errori di compilazione nel file, passare a Creazione progetti
19 | ' (aprire le proprietà del progetto o fare doppio clic sul nodo Progetti personali in
20 | ' Esplora soluzioni) e apportare le modifiche nella scheda Applicazione.
21 | '
22 | Partial Friend Class MyApplication
23 |
24 | _
25 | Public Sub New()
26 | MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows)
27 | Me.IsSingleInstance = true
28 | Me.EnableVisualStyles = true
29 | Me.SaveMySettingsOnExit = false
30 | Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses
31 | End Sub
32 |
33 | _
34 | Protected Overrides Sub OnCreateMainForm()
35 | Me.MainForm = Global.MelodysLowLatencyUI.Form1
36 | End Sub
37 | End Class
38 | End Namespace
39 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Melody's Low Latency Software
2 |
3 | 
4 |
5 | [Official Download Page](https://sites.google.com/view/melodystweaks/lowlatencysw)
6 |
7 | # If you get "100% CPU usage" after enabling Low Latency, that's a visual bug indicating that idle cycles have been disabled to provide the lowest latency. Please don't ask the reason of "100% CPU usage"!
8 |
9 | - What this program does is setting a temporary power plan and set the timer resolution to the lowest value supported.
10 |
11 |
12 | Designed for Windows 10 1803 and newer, Windows 11 and newer.
13 |
14 | Only for 64-bit systems.
15 |
16 |
17 | - This program requires the Power Service to be running. The program might ask the user to enable it.
18 |
19 | - It is not adviced to run this program in stripped / modified systems. Do it at your own risk.
20 |
21 | - For debug information hold SHIFT, CTRL or ALT in the main window.
22 |
23 | - Use the mouse icon in my program to set queue sizes and platform tick.
24 |
25 | - When using my program, it is adviced to use platform tick because of the way it works.
26 |
27 | - It is not adviced to run the program on unsupported Windows versions and I don't plan to support them anytime soon in this program.
28 |
29 |
30 | Command-line Parameters (V3.0 and newer)
31 |
32 | You can supply 3 parameters on startup:
33 |
34 | \[mode\] \[minimize\] \[steer\]
35 |
36 | - mode can be 1, 2, 3 and it specifies Low Latency Mode status on startup, 1 = only enable Timer Resolution, 2 = enable Low Latency Mode without Timer Resolution, 3 = Enable Low Latency Mode.
37 |
38 | - minimize can be set to minimize to minimize the program on startup.
39 |
40 | - steer can be set to steer to enable interrupt steering.
41 |
42 | You can set any parameter to an empty string ("") or just supply an invalid value to make the program ignore it.
43 |
44 | Example: MelodysLowLatencyUI_v3.exe 3 nominimize nosteer
45 |
46 |
47 | When having problems, please post a full screen of the debug screen.
48 |
49 | Join our Discord here: http://discord.gg/6TMHU63
50 |
--------------------------------------------------------------------------------
/MelodysLowLatencyUI/Form2.Designer.vb:
--------------------------------------------------------------------------------
1 | _
2 | Partial Class Form2
3 | Inherits System.Windows.Forms.Form
4 |
5 | 'Form esegue l'override del metodo Dispose per pulire l'elenco dei componenti.
6 | _
7 | Protected Overrides Sub Dispose(ByVal disposing As Boolean)
8 | Try
9 | If disposing AndAlso components IsNot Nothing Then
10 | components.Dispose()
11 | End If
12 | Finally
13 | MyBase.Dispose(disposing)
14 | End Try
15 | End Sub
16 |
17 | 'Richiesto da Progettazione Windows Form
18 | Private components As System.ComponentModel.IContainer
19 |
20 | 'NOTA: la procedura che segue è richiesta da Progettazione Windows Form
21 | 'Può essere modificata in Progettazione Windows Form.
22 | 'Non modificarla mediante l'editor del codice.
23 | _
24 | Private Sub InitializeComponent()
25 | Me.Label1 = New System.Windows.Forms.Label()
26 | Me.SuspendLayout()
27 | '
28 | 'Label1
29 | '
30 | Me.Label1.Dock = System.Windows.Forms.DockStyle.Fill
31 | Me.Label1.Location = New System.Drawing.Point(0, 0)
32 | Me.Label1.Name = "Label1"
33 | Me.Label1.Size = New System.Drawing.Size(156, 72)
34 | Me.Label1.TabIndex = 0
35 | Me.Label1.Text = "Starting up..."
36 | Me.Label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
37 | '
38 | 'Form2
39 | '
40 | Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
41 | Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
42 | Me.ClientSize = New System.Drawing.Size(156, 72)
43 | Me.Controls.Add(Me.Label1)
44 | Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None
45 | Me.Name = "Form2"
46 | Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
47 | Me.Text = "Form2"
48 | Me.TopMost = True
49 | Me.ResumeLayout(False)
50 |
51 | End Sub
52 |
53 | Friend WithEvents Label1 As Label
54 | End Class
55 |
--------------------------------------------------------------------------------
/MelodysLowLatencyUI/Resources/Form3.Designer.vb:
--------------------------------------------------------------------------------
1 | _
2 | Partial Class Form3
3 | Inherits System.Windows.Forms.Form
4 |
5 | 'Form esegue l'override del metodo Dispose per pulire l'elenco dei componenti.
6 | _
7 | Protected Overrides Sub Dispose(ByVal disposing As Boolean)
8 | Try
9 | If disposing AndAlso components IsNot Nothing Then
10 | components.Dispose()
11 | End If
12 | Finally
13 | MyBase.Dispose(disposing)
14 | End Try
15 | End Sub
16 |
17 | 'Richiesto da Progettazione Windows Form
18 | Private components As System.ComponentModel.IContainer
19 |
20 | 'NOTA: la procedura che segue è richiesta da Progettazione Windows Form
21 | 'Può essere modificata in Progettazione Windows Form.
22 | 'Non modificarla mediante l'editor del codice.
23 | _
24 | Private Sub InitializeComponent()
25 | Me.Label1 = New System.Windows.Forms.Label()
26 | Me.SuspendLayout()
27 | '
28 | 'Label1
29 | '
30 | Me.Label1.Dock = System.Windows.Forms.DockStyle.Fill
31 | Me.Label1.Location = New System.Drawing.Point(0, 0)
32 | Me.Label1.Name = "Label1"
33 | Me.Label1.Size = New System.Drawing.Size(105, 55)
34 | Me.Label1.TabIndex = 0
35 | Me.Label1.Text = "Setting..."
36 | Me.Label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
37 | '
38 | 'Form3
39 | '
40 | Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
41 | Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
42 | Me.ClientSize = New System.Drawing.Size(105, 55)
43 | Me.Controls.Add(Me.Label1)
44 | Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None
45 | Me.Name = "Form3"
46 | Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
47 | Me.Text = "Form3"
48 | Me.TopMost = True
49 | Me.ResumeLayout(False)
50 |
51 | End Sub
52 |
53 | Friend WithEvents Label1 As Label
54 | End Class
55 |
--------------------------------------------------------------------------------
/MelodysLowLatencyUI/My Project/Settings.Designer.vb:
--------------------------------------------------------------------------------
1 | '------------------------------------------------------------------------------
2 | '
3 | ' This code was generated by a tool.
4 | ' Runtime Version:4.0.30319.42000
5 | '
6 | ' Changes to this file may cause incorrect behavior and will be lost if
7 | ' the code is regenerated.
8 | '
9 | '------------------------------------------------------------------------------
10 |
11 | Option Strict On
12 | Option Explicit On
13 |
14 |
15 | Namespace My
16 |
17 | _
20 | Partial Friend NotInheritable Class MySettings
21 | Inherits Global.System.Configuration.ApplicationSettingsBase
22 |
23 | Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings)
24 |
25 | #Region "My.Settings Auto-Save Functionality"
26 | #If _MyType = "WindowsForms" Then
27 | Private Shared addedHandler As Boolean
28 |
29 | Private Shared addedHandlerLockObject As New Object
30 |
31 | _
32 | Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs)
33 | If My.Application.SaveMySettingsOnExit Then
34 | My.Settings.Save()
35 | End If
36 | End Sub
37 | #End If
38 | #End Region
39 |
40 | Public Shared ReadOnly Property [Default]() As MySettings
41 | Get
42 |
43 | #If _MyType = "WindowsForms" Then
44 | If Not addedHandler Then
45 | SyncLock addedHandlerLockObject
46 | If Not addedHandler Then
47 | AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
48 | addedHandler = True
49 | End If
50 | End SyncLock
51 | End If
52 | #End If
53 | Return defaultInstance
54 | End Get
55 | End Property
56 | End Class
57 | End Namespace
58 |
59 | Namespace My
60 |
61 | _
64 | Friend Module MySettingsProperty
65 |
66 | _
67 | Friend ReadOnly Property Settings() As Global.MelodysLowLatencyUI.My.MySettings
68 | Get
69 | Return Global.MelodysLowLatencyUI.My.MySettings.Default
70 | End Get
71 | End Property
72 | End Module
73 | End Namespace
74 |
--------------------------------------------------------------------------------
/MelodysLowLatencyUI/app.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
52 |
53 |
54 |
55 | true
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
72 |
73 |
74 |
75 |
76 |
77 |
--------------------------------------------------------------------------------
/MelodysLowLatencyUI/My Project/Resources.Designer.vb:
--------------------------------------------------------------------------------
1 | '------------------------------------------------------------------------------
2 | '
3 | ' Il codice è stato generato da uno strumento.
4 | ' Versione runtime:4.0.30319.42000
5 | '
6 | ' Le modifiche apportate a questo file possono provocare un comportamento non corretto e andranno perse se
7 | ' il codice viene rigenerato.
8 | '
9 | '------------------------------------------------------------------------------
10 |
11 | Option Strict On
12 | Option Explicit On
13 |
14 | Imports System
15 |
16 | Namespace My.Resources
17 |
18 | 'Questa classe è stata generata automaticamente dalla classe StronglyTypedResourceBuilder.
19 | 'tramite uno strumento quale ResGen o Visual Studio.
20 | 'Per aggiungere o rimuovere un membro, modificare il file con estensione ResX ed eseguire nuovamente ResGen
21 | 'con l'opzione /str oppure ricompilare il progetto VS.
22 | '''
23 | ''' Classe di risorse fortemente tipizzata per la ricerca di stringhe localizzate e così via.
24 | '''
25 | _
29 | Friend Module Resources
30 |
31 | Private resourceMan As Global.System.Resources.ResourceManager
32 |
33 | Private resourceCulture As Global.System.Globalization.CultureInfo
34 |
35 | '''
36 | ''' Restituisce l'istanza di ResourceManager nella cache utilizzata da questa classe.
37 | '''
38 | _
39 | Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
40 | Get
41 | If Object.ReferenceEquals(resourceMan, Nothing) Then
42 | Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("MelodysLowLatencyUI.Resources", GetType(Resources).Assembly)
43 | resourceMan = temp
44 | End If
45 | Return resourceMan
46 | End Get
47 | End Property
48 |
49 | '''
50 | ''' Esegue l'override della proprietà CurrentUICulture del thread corrente per tutte le
51 | ''' ricerche di risorse eseguite utilizzando questa classe di risorse fortemente tipizzata.
52 | '''
53 | _
54 | Friend Property Culture() As Global.System.Globalization.CultureInfo
55 | Get
56 | Return resourceCulture
57 | End Get
58 | Set
59 | resourceCulture = value
60 | End Set
61 | End Property
62 |
63 | '''
64 | ''' Cerca una risorsa localizzata di tipo System.Drawing.Bitmap.
65 | '''
66 | Friend ReadOnly Property LL_off() As System.Drawing.Bitmap
67 | Get
68 | Dim obj As Object = ResourceManager.GetObject("LL_off", resourceCulture)
69 | Return CType(obj,System.Drawing.Bitmap)
70 | End Get
71 | End Property
72 |
73 | '''
74 | ''' Cerca una risorsa localizzata di tipo System.Drawing.Bitmap.
75 | '''
76 | Friend ReadOnly Property LL_on() As System.Drawing.Bitmap
77 | Get
78 | Dim obj As Object = ResourceManager.GetObject("LL_on", resourceCulture)
79 | Return CType(obj,System.Drawing.Bitmap)
80 | End Get
81 | End Property
82 |
83 | '''
84 | ''' Cerca una stringa localizzata simile a This software is distributed without any warranty and I'm not responsible for ANY damage caused to your computer, especially in case of running it in any older Windows version than 10 1803.
85 | '''
86 | '''I'm not responsible for any damage caused to your computer in case of wrong use of this software, as well as in case of use with modified and stripped Operating Systems.
87 | '''
88 | '''If you agree with this, proceed otherwise please exit..
89 | '''
90 | Friend ReadOnly Property MeUILicense() As String
91 | Get
92 | Return ResourceManager.GetString("MeUILicense", resourceCulture)
93 | End Get
94 | End Property
95 |
96 | '''
97 | ''' Cerca una risorsa localizzata di tipo System.Drawing.Bitmap.
98 | '''
99 | Friend ReadOnly Property mouse2() As System.Drawing.Bitmap
100 | Get
101 | Dim obj As Object = ResourceManager.GetObject("mouse2", resourceCulture)
102 | Return CType(obj,System.Drawing.Bitmap)
103 | End Get
104 | End Property
105 | End Module
106 | End Namespace
107 |
--------------------------------------------------------------------------------
/MelodysLowLatencyUI/Form2.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/MelodysLowLatencyUI/Resources/Form3.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/MelodysLowLatencyUI/My Project/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 |
122 | ..\Resources\LL_on.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
123 |
124 |
125 | ..\Resources\LL_off.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
126 |
127 |
128 | ..\Resources\mouse2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
129 |
130 |
131 | ..\Resources\MeUILicense.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252
132 |
133 |
--------------------------------------------------------------------------------
/MelodysLowLatencyUI/MelodysLowLatencyUI.vbproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {DBAF9D3D-E86E-44FC-95E6-22C6BE793FC8}
8 | WinExe
9 | MelodysLowLatencyUI.My.MyApplication
10 | MelodysLowLatencyUI
11 | MelodysLowLatencyUI_v3
12 | 512
13 | WindowsForms
14 | v4.7.2
15 | true
16 | true
17 |
18 |
19 | AnyCPU
20 | true
21 | full
22 | true
23 | true
24 | bin\Debug\
25 | MelodysLowLatencyUI_v3.xml
26 | 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022
27 |
28 |
29 | AnyCPU
30 | pdbonly
31 | false
32 | true
33 | true
34 | bin\Release\
35 | MelodysLowLatencyUI_v3.xml
36 | 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022
37 |
38 |
39 | On
40 |
41 |
42 | Binary
43 |
44 |
45 | Off
46 |
47 |
48 | On
49 |
50 |
51 | app.manifest
52 |
53 |
54 | true
55 | true
56 | true
57 | bin\x64\Debug\
58 | MelodysLowLatencyUI_v3.xml
59 | 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022
60 | full
61 | x64
62 | MinimumRecommendedRules.ruleset
63 | true
64 |
65 |
66 | true
67 | bin\x64\Release\
68 | MelodysLowLatencyUI_v3.xml
69 | true
70 | 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022
71 | pdbonly
72 | x64
73 | MinimumRecommendedRules.ruleset
74 | true
75 |
76 |
77 | ll_software.ico
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 | Form
109 |
110 |
111 | Form1.vb
112 | Form
113 |
114 |
115 | Form2.vb
116 |
117 |
118 | Form
119 |
120 |
121 |
122 | True
123 | Application.myapp
124 |
125 |
126 | True
127 | True
128 | Resources.resx
129 |
130 |
131 | True
132 | Settings.settings
133 | True
134 |
135 |
136 | Form3.vb
137 |
138 |
139 | Form
140 |
141 |
142 |
143 |
144 | Form1.vb
145 |
146 |
147 | Form2.vb
148 |
149 |
150 | VbMyResourcesResXFileCodeGenerator
151 | Resources.Designer.vb
152 | My.Resources
153 | Designer
154 |
155 |
156 | Form3.vb
157 |
158 |
159 |
160 |
161 |
162 | MyApplicationCodeGenerator
163 | Application.Designer.vb
164 |
165 |
166 | SettingsSingleFileGenerator
167 | My
168 | Settings.Designer.vb
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
--------------------------------------------------------------------------------
/MelodysLowLatencyUI/Form1.Designer.vb:
--------------------------------------------------------------------------------
1 |
2 | Partial Class Form1
3 | Inherits System.Windows.Forms.Form
4 |
5 | 'Form esegue l'override del metodo Dispose per pulire l'elenco dei componenti.
6 |
7 | Protected Overrides Sub Dispose(ByVal disposing As Boolean)
8 | Try
9 | If disposing AndAlso components IsNot Nothing Then
10 | components.Dispose()
11 | End If
12 | Finally
13 | MyBase.Dispose(disposing)
14 | End Try
15 | End Sub
16 |
17 | 'Richiesto da Progettazione Windows Form
18 | Private components As System.ComponentModel.IContainer
19 |
20 | 'NOTA: la procedura che segue è richiesta da Progettazione Windows Form
21 | 'Può essere modificata in Progettazione Windows Form.
22 | 'Non modificarla mediante l'editor del codice.
23 |
24 | Private Sub InitializeComponent()
25 | Me.components = New System.ComponentModel.Container()
26 | Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(Form1))
27 | Me.Label1 = New System.Windows.Forms.Label()
28 | Me.Label2 = New System.Windows.Forms.Label()
29 | Me.Label3 = New System.Windows.Forms.Label()
30 | Me.ToolTip1 = New System.Windows.Forms.ToolTip(Me.components)
31 | Me.Timer1 = New System.Windows.Forms.Timer(Me.components)
32 | Me.PictureBox1 = New System.Windows.Forms.PictureBox()
33 | Me.ToolTip2 = New System.Windows.Forms.ToolTip(Me.components)
34 | Me.PictureBox2 = New System.Windows.Forms.PictureBox()
35 | Me.Label4 = New System.Windows.Forms.Label()
36 | Me.NotifyIcon1 = New System.Windows.Forms.NotifyIcon(Me.components)
37 | Me.ContextMenuStrip1 = New System.Windows.Forms.ContextMenuStrip(Me.components)
38 | Me.OpenToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
39 | Me.EnableLowLatencyModeToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
40 | Me.EnableTimerResolutionToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
41 | Me.QuitToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
42 | CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit()
43 | CType(Me.PictureBox2, System.ComponentModel.ISupportInitialize).BeginInit()
44 | Me.ContextMenuStrip1.SuspendLayout()
45 | Me.SuspendLayout()
46 | '
47 | 'Label1
48 | '
49 | Me.Label1.AutoSize = True
50 | Me.Label1.Location = New System.Drawing.Point(82, 24)
51 | Me.Label1.Name = "Label1"
52 | Me.Label1.Size = New System.Drawing.Size(180, 13)
53 | Me.Label1.TabIndex = 1
54 | Me.Label1.Text = "Enable / Disable Low Latency Mode"
55 | '
56 | 'Label2
57 | '
58 | Me.Label2.Location = New System.Drawing.Point(9, 77)
59 | Me.Label2.Name = "Label2"
60 | Me.Label2.Size = New System.Drawing.Size(235, 26)
61 | Me.Label2.TabIndex = 2
62 | Me.Label2.Text = "Note: the program must be kept open"
63 | Me.Label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
64 | '
65 | 'Label3
66 | '
67 | Me.Label3.Location = New System.Drawing.Point(280, 77)
68 | Me.Label3.Name = "Label3"
69 | Me.Label3.Size = New System.Drawing.Size(77, 26)
70 | Me.Label3.TabIndex = 3
71 | Me.Label3.Text = "(version)"
72 | Me.Label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight
73 | '
74 | 'ToolTip1
75 | '
76 | Me.ToolTip1.AutomaticDelay = 0
77 | Me.ToolTip1.BackColor = System.Drawing.Color.Black
78 | Me.ToolTip1.ForeColor = System.Drawing.Color.White
79 | Me.ToolTip1.ToolTipIcon = System.Windows.Forms.ToolTipIcon.Info
80 | Me.ToolTip1.ToolTipTitle = "Debug"
81 | Me.ToolTip1.UseAnimation = False
82 | Me.ToolTip1.UseFading = False
83 | '
84 | 'Timer1
85 | '
86 | Me.Timer1.Enabled = True
87 | Me.Timer1.Interval = 1000
88 | '
89 | 'PictureBox1
90 | '
91 | Me.PictureBox1.Image = Global.MelodysLowLatencyUI.My.Resources.Resources.LL_off
92 | Me.PictureBox1.Location = New System.Drawing.Point(12, 18)
93 | Me.PictureBox1.Name = "PictureBox1"
94 | Me.PictureBox1.Size = New System.Drawing.Size(64, 25)
95 | Me.PictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage
96 | Me.PictureBox1.TabIndex = 0
97 | Me.PictureBox1.TabStop = False
98 | '
99 | 'ToolTip2
100 | '
101 | Me.ToolTip2.IsBalloon = True
102 | Me.ToolTip2.ToolTipIcon = System.Windows.Forms.ToolTipIcon.Info
103 | Me.ToolTip2.ToolTipTitle = "Set Latency Parameters"
104 | '
105 | 'PictureBox2
106 | '
107 | Me.PictureBox2.Image = Global.MelodysLowLatencyUI.My.Resources.Resources.LL_off
108 | Me.PictureBox2.Location = New System.Drawing.Point(12, 49)
109 | Me.PictureBox2.Name = "PictureBox2"
110 | Me.PictureBox2.Size = New System.Drawing.Size(64, 25)
111 | Me.PictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage
112 | Me.PictureBox2.TabIndex = 5
113 | Me.PictureBox2.TabStop = False
114 | '
115 | 'Label4
116 | '
117 | Me.Label4.AutoSize = True
118 | Me.Label4.Location = New System.Drawing.Point(82, 54)
119 | Me.Label4.Name = "Label4"
120 | Me.Label4.Size = New System.Drawing.Size(137, 13)
121 | Me.Label4.TabIndex = 6
122 | Me.Label4.Text = "Enable / Disable Timer Res"
123 | '
124 | 'NotifyIcon1
125 | '
126 | Me.NotifyIcon1.BalloonTipIcon = System.Windows.Forms.ToolTipIcon.Info
127 | Me.NotifyIcon1.BalloonTipText = "Melody's Low Latency Software"
128 | Me.NotifyIcon1.ContextMenuStrip = Me.ContextMenuStrip1
129 | Me.NotifyIcon1.Icon = CType(resources.GetObject("NotifyIcon1.Icon"), System.Drawing.Icon)
130 | Me.NotifyIcon1.Text = "Low Latency Software"
131 | Me.NotifyIcon1.Visible = True
132 | '
133 | 'ContextMenuStrip1
134 | '
135 | Me.ContextMenuStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.OpenToolStripMenuItem, Me.EnableLowLatencyModeToolStripMenuItem, Me.EnableTimerResolutionToolStripMenuItem, Me.QuitToolStripMenuItem})
136 | Me.ContextMenuStrip1.Name = "ContextMenuStrip1"
137 | Me.ContextMenuStrip1.Size = New System.Drawing.Size(213, 92)
138 | '
139 | 'OpenToolStripMenuItem
140 | '
141 | Me.OpenToolStripMenuItem.Name = "OpenToolStripMenuItem"
142 | Me.OpenToolStripMenuItem.Size = New System.Drawing.Size(212, 22)
143 | Me.OpenToolStripMenuItem.Text = "Open"
144 | '
145 | 'EnableLowLatencyModeToolStripMenuItem
146 | '
147 | Me.EnableLowLatencyModeToolStripMenuItem.Name = "EnableLowLatencyModeToolStripMenuItem"
148 | Me.EnableLowLatencyModeToolStripMenuItem.Size = New System.Drawing.Size(212, 22)
149 | Me.EnableLowLatencyModeToolStripMenuItem.Text = "Enable Low Latency Mode"
150 | '
151 | 'EnableTimerResolutionToolStripMenuItem
152 | '
153 | Me.EnableTimerResolutionToolStripMenuItem.Name = "EnableTimerResolutionToolStripMenuItem"
154 | Me.EnableTimerResolutionToolStripMenuItem.Size = New System.Drawing.Size(212, 22)
155 | Me.EnableTimerResolutionToolStripMenuItem.Text = "Enable Timer Resolution"
156 | '
157 | 'QuitToolStripMenuItem
158 | '
159 | Me.QuitToolStripMenuItem.Name = "QuitToolStripMenuItem"
160 | Me.QuitToolStripMenuItem.Size = New System.Drawing.Size(212, 22)
161 | Me.QuitToolStripMenuItem.Text = "Quit"
162 | '
163 | 'Form1
164 | '
165 | Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
166 | Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
167 | Me.BackColor = System.Drawing.Color.Black
168 | Me.ClientSize = New System.Drawing.Size(369, 111)
169 | Me.Controls.Add(Me.Label4)
170 | Me.Controls.Add(Me.PictureBox2)
171 | Me.Controls.Add(Me.Label3)
172 | Me.Controls.Add(Me.Label2)
173 | Me.Controls.Add(Me.Label1)
174 | Me.Controls.Add(Me.PictureBox1)
175 | Me.ForeColor = System.Drawing.Color.White
176 | Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
177 | Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
178 | Me.MaximizeBox = False
179 | Me.MaximumSize = New System.Drawing.Size(385, 150)
180 | Me.MinimumSize = New System.Drawing.Size(385, 150)
181 | Me.Name = "Form1"
182 | Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
183 | Me.Text = "Melody's Low Latency Software"
184 | CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).EndInit()
185 | CType(Me.PictureBox2, System.ComponentModel.ISupportInitialize).EndInit()
186 | Me.ContextMenuStrip1.ResumeLayout(False)
187 | Me.ResumeLayout(False)
188 | Me.PerformLayout()
189 |
190 | End Sub
191 |
192 | Friend WithEvents PictureBox1 As PictureBox
193 | Friend WithEvents Label1 As Label
194 | Friend WithEvents Label2 As Label
195 | Friend WithEvents Label3 As Label
196 | Friend WithEvents ToolTip1 As ToolTip
197 | Friend WithEvents Timer1 As Timer
198 | Friend WithEvents ToolTip2 As ToolTip
199 | Friend WithEvents PictureBox2 As PictureBox
200 | Friend WithEvents Label4 As Label
201 | Friend WithEvents NotifyIcon1 As NotifyIcon
202 | Friend WithEvents ContextMenuStrip1 As ContextMenuStrip
203 | Friend WithEvents OpenToolStripMenuItem As ToolStripMenuItem
204 | Friend WithEvents EnableLowLatencyModeToolStripMenuItem As ToolStripMenuItem
205 | Friend WithEvents EnableTimerResolutionToolStripMenuItem As ToolStripMenuItem
206 | Friend WithEvents QuitToolStripMenuItem As ToolStripMenuItem
207 | End Class
208 |
--------------------------------------------------------------------------------
/MelodysLowLatencyUI/Form1.vb:
--------------------------------------------------------------------------------
1 | Public Class Form1
2 | Public InitializedFine As Boolean = False
3 | Public UltimatePerformanceExists As Boolean = True
4 |
5 | Public CurrentState As Boolean = False
6 |
7 | Public LastClickTick = Environment.TickCount
8 |
9 | Public Ver As String = "V" & My.Application.Info.Version.Major & "." & My.Application.Info.Version.Minor
10 |
11 | Public CurrentPowerPlan As String = "381b4222-f694-41f0-9685-ff5bb260df2e"
12 |
13 | Public MaximumTimerResolution As UInteger = 5000
14 |
15 | Public MinimumTimerResolution As UInteger = 156250
16 |
17 | Public LastRegisteredTimerResolution As UInteger = 156250
18 |
19 | Public SupportedWinVersion As Boolean = True
20 |
21 | Public OS_Name As String = "Windows"
22 |
23 | Public Timer_Res_Enabled As Boolean = False
24 |
25 | Public EnableSteering = False
26 |
27 | Public MinimizeOnShowup = False
28 |
29 | Public Shared Function NtQueryTimerResolution(ByRef outmin As UInteger, ByRef outmax As UInteger, ByRef outcurrent As UInteger) As Integer
30 | End Function
31 | Public Shared Function NtSetTimerResolution(ByVal desired As UInteger, ByVal setres As Boolean, ByRef outcurrent As UInteger) As Integer
32 | End Function
33 |
34 | Sub CheckWin10()
35 | Dim _cv As Microsoft.Win32.RegistryKey
36 | Try
37 | _cv = My.Computer.Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\Windows NT\CurrentVersion", False)
38 | Dim windows_name As String = _cv.GetValue("ProductName")
39 | OS_Name = windows_name
40 | If Not windows_name.Contains("Windows 10") Then
41 | Throw New Exception
42 | End If
43 | Dim win10release_string As String = _cv.GetValue("ReleaseId")
44 | OS_Name &= " build " & win10release_string
45 | Dim win10release_uint As UInteger = UInteger.Parse(win10release_string)
46 | If win10release_uint < 1803 Then
47 | Throw New Exception
48 | End If
49 | ' Windows 11 additional check
50 | Try
51 | Dim win11_build As UInteger = UInteger.Parse(_cv.GetValue("CurrentBuildNumber"))
52 | If win11_build < 22000 Then
53 | Throw New Exception()
54 | End If
55 | windows_name = windows_name.Replace("Windows 10", "Windows 11")
56 | OS_Name = windows_name & " build " & win11_build
57 | Catch ex2 As Exception
58 | End Try
59 | _cv.Dispose()
60 | Catch ex As Exception
61 | SupportedWinVersion = False
62 | Try
63 | _cv.Dispose()
64 | Catch ex2 As Exception
65 | End Try
66 | Dim res = MsgBox("This program has been made to run fine in Windows 10 1803 and newer versions. I'm not responsible for any damage or issues when running this on old Windows versions/builds." & Environment.NewLine & Environment.NewLine & "This version of Windows is not supported. Do you wish to continue anyway?", MsgBoxStyle.Exclamation Or MsgBoxStyle.YesNo, "Warning")
67 | If res = MsgBoxResult.No Then
68 | Environment.Exit(0)
69 | End If
70 | End Try
71 | End Sub
72 |
73 | Sub ShowLicense()
74 | If Not My.Computer.FileSystem.FileExists("eula.txt") OrElse Not My.Computer.FileSystem.ReadAllText("eula.txt").ToLower().Contains("accept=true") Then
75 | Dim res = MsgBox(My.Resources.MeUILicense, MsgBoxStyle.YesNo, "Warning")
76 | If res = MsgBoxResult.No Then
77 | Environment.Exit(0)
78 | Else
79 | Try
80 | My.Computer.FileSystem.WriteAllText("eula.txt", "accept=true", False)
81 | Catch ex As Exception
82 | End Try
83 | End If
84 | End If
85 | Dim ProcessorIdentifier = Environment.GetEnvironmentVariable("PROCESSOR_IDENTIFIER", EnvironmentVariableTarget.Machine)
86 | If Not ProcessorIdentifier.Contains("GenuineIntel") Then
87 | Try
88 | If Not My.Computer.FileSystem.ReadAllText("eula.txt").ToLower().Contains("amdaccept=true") Then
89 | Throw New Exception()
90 | End If
91 | Catch ex As Exception
92 | Dim res = MsgBox("The program has detected that you're not using an Intel Processor." & Environment.NewLine & Environment.NewLine & "There have been mixed reports of the program not being able to work properly on AMD processors. Do you still want to continue? If you still want to continue, please click Yes.", MsgBoxStyle.Exclamation Or MsgBoxStyle.YesNo, "AMD CPU?")
93 | If res = MsgBoxResult.No Then
94 | Environment.Exit(0)
95 | End If
96 | Try
97 | My.Computer.FileSystem.WriteAllText("eula.txt", Environment.NewLine & "amdaccept=true", True)
98 | Catch ex2 As Exception
99 | End Try
100 | End Try
101 | End If
102 |
103 | End Sub
104 | Sub CheckSvcUI()
105 | Dim power_key = My.Computer.Registry.LocalMachine.OpenSubKey("SYSTEM\CurrentControlSet\Services\Power", True)
106 | Dim start_val As UInteger = power_key.GetValue("Start")
107 | If start_val > 3 Or start_val < 0 Then
108 | Dim res = MsgBox("Power Service is disabled. The software needs the Power Service to work. Do you wish my software to enable it and reboot your PC?", MsgBoxStyle.YesNo Or MsgBoxStyle.Exclamation, "Warning")
109 | If res = MsgBoxResult.Yes Then
110 | power_key.SetValue("Start", 2, Microsoft.Win32.RegistryValueKind.DWord)
111 | Process.Start("shutdown", "-r -t 0 -f")
112 | End If
113 | Environment.Exit(0)
114 | End If
115 | power_key.Dispose()
116 | power_key = Nothing
117 | End Sub
118 |
119 | Sub RunProcessWait(ByVal proc As String, Optional ByVal args As String = "", Optional ByVal ThrowOnError As Boolean = False, Optional ByVal ExceptionDescription As String = "powercfg failed")
120 | Dim p As New Process()
121 | p.StartInfo.FileName = proc
122 | p.StartInfo.UseShellExecute = False
123 | p.StartInfo.CreateNoWindow = True
124 | p.StartInfo.Arguments = args
125 | p.Start()
126 | While Not p.HasExited
127 | Threading.Thread.Sleep(1)
128 | End While
129 | If ThrowOnError AndAlso p.ExitCode <> 0 Then
130 | Throw New Exception(ExceptionDescription)
131 | End If
132 | End Sub
133 |
134 | Sub CheckPowerPlanExists()
135 | Dim pwr = My.Computer.Registry.LocalMachine.OpenSubKey("SYSTEM\CurrentControlSet\Control\Power\User\PowerSchemes", False)
136 | If Not pwr.GetSubKeyNames().Contains("23dc3dc2-9e1b-4954-a427-ca33c8333f77") Then
137 | pwr.Dispose()
138 | pwr = Nothing
139 | Throw New Exception("Failed to create system settings. This usually happens because of missing default power plans. If you wish to restore the default powerplans, please run powercfg -restoredefaultschemes on an Administrator Command Prompt and then try running the application again.")
140 | End If
141 | pwr.Dispose()
142 | pwr = Nothing
143 | End Sub
144 |
145 | Sub DisableLowLatency(Optional ByVal ThrowExceptions As Boolean = True)
146 | RunProcessWait("powercfg", "/setactive " & CurrentPowerPlan, ThrowExceptions, "Failed to disable Low Latency")
147 | DisableTimerRes()
148 | End Sub
149 |
150 | Sub EnableLowLatency(Optional ByVal TimerRes As Boolean = True)
151 | RunProcessWait("powercfg", "/setactive 23dc3dc2-9e1b-4954-a427-ca33c8333f77", True, "Failed to enable Low Latency")
152 | If TimerRes Then
153 | EnableTimerRes()
154 | End If
155 | End Sub
156 |
157 | Sub DisableAll(Optional ByVal ThrowExceptions As Boolean = False)
158 | If Not InitializedFine Then
159 | Exit Sub
160 | End If
161 | DisableLowLatency(ThrowExceptions)
162 | RunProcessWait("powercfg", "/delete 23dc3dc2-9e1b-4954-a427-ca33c8333f77", ThrowExceptions)
163 | End Sub
164 |
165 | Private Sub Form1_Closing(sender As Object, e As EventArgs) Handles MyBase.Closing
166 | DisableAll()
167 | End Sub
168 |
169 | Sub GetCurrentPowerPlan()
170 | Dim pp = My.Computer.Registry.LocalMachine.OpenSubKey("SYSTEM\CurrentControlSet\Control\Power\User\PowerSchemes", False)
171 | CurrentPowerPlan = pp.GetValue("ActivePowerScheme")
172 | pp.Dispose()
173 | pp = Nothing
174 | End Sub
175 |
176 | Sub Form1_Minimize(sender As Object, e As EventArgs) Handles MyBase.Resize
177 | HideWindow()
178 | End Sub
179 | Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
180 | Try
181 | Dim nochecks = Environment.GetCommandLineArgs()(4)
182 | If nochecks <> "nochecks" Then
183 | Throw New Exception
184 | End If
185 | Catch ex As Exception
186 | ShowLicense()
187 | CheckWin10()
188 | End Try
189 | CheckSvcUI()
190 | Form2.Show()
191 | GetCurrentPowerPlan()
192 | RunProcessWait("net", "start power")
193 | If CurrentPowerPlan = "23dc3dc2-9e1b-4954-a427-ca33c8333f77" Then
194 | CurrentPowerPlan = "381b4222-f694-41f0-9685-ff5bb260df2e"
195 | RunProcessWait("powercfg", "/setactive 381b4222-f694-41f0-9685-ff5bb260df2e")
196 | End If
197 | RunProcessWait("powercfg", "/delete 23dc3dc2-9e1b-4954-a427-ca33c8333f77")
198 | RunProcessWait("powercfg", "/duplicatescheme e9a42b02-d5df-448d-aa00-03f14749eb61 23dc3dc2-9e1b-4954-a427-ca33c8333f77")
199 | Try
200 | CheckPowerPlanExists()
201 | Catch ex As Exception
202 | RunProcessWait("powercfg", "/duplicatescheme 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c 23dc3dc2-9e1b-4954-a427-ca33c8333f77")
203 | UltimatePerformanceExists = False
204 | End Try
205 | CheckPowerPlanExists()
206 |
207 | RunProcessWait("powercfg", "/changename 23dc3dc2-9e1b-4954-a427-ca33c8333f77 ""Melody Low Latency Power Plan"" ""Melody Low Latency Power Plan""")
208 |
209 | RunProcessWait("powercfg", "/setacvalueindex 23dc3dc2-9e1b-4954-a427-ca33c8333f77 54533251-82be-4824-96c1-47b60b740d00 5d76a2ca-e8c0-402f-a133-2158492d58ad 1")
210 | RunProcessWait("powercfg", "/setacvalueindex 23dc3dc2-9e1b-4954-a427-ca33c8333f77 2a737441-1930-4402-8d77-b2bebba308a3 d4e98f31-5ffe-4ce1-be31-1b38b384c009 0")
211 | RunProcessWait("powercfg", "/setacvalueindex 23dc3dc2-9e1b-4954-a427-ca33c8333f77 2a737441-1930-4402-8d77-b2bebba308a3 48e6b7a6-50f5-4782-a5d4-53bb8f07e226 0")
212 | RunProcessWait("powercfg", "/setacvalueindex 23dc3dc2-9e1b-4954-a427-ca33c8333f77 501a4d13-42af-4429-9fd1-a8218c268e20 ee12f906-d277-404b-b6da-e5fa1a576df5 0")
213 | RunProcessWait("powercfg", "/setacvalueindex 23dc3dc2-9e1b-4954-a427-ca33c8333f77 0012ee47-9041-4b5d-9b77-535fba8b1442 0b2d69d7-a2a1-449c-9680-f91c70521c60 0")
214 |
215 | RunProcessWait("powercfg", "/setacvalueindex 23dc3dc2-9e1b-4954-a427-ca33c8333f77 0012ee47-9041-4b5d-9b77-535fba8b1442 dbc9e238-6de9-49e3-92cd-8c2b4946b472 1")
216 | RunProcessWait("powercfg", "/setacvalueindex 23dc3dc2-9e1b-4954-a427-ca33c8333f77 0012ee47-9041-4b5d-9b77-535fba8b1442 fc95af4d-40e7-4b6d-835a-56d131dbc80e 1")
217 |
218 | ' === Core Unpark removed from the program - makes trouble on Ryzen
219 |
220 | 'RunProcessWait("powercfg", "/setacvalueindex 23dc3dc2-9e1b-4954-a427-ca33c8333f77 48672F38-7A9A-4bb2-8BF8-3D85BE19DE4E 2BFC24F9-5EA2-4801-8213-3DBAE01AA39D 6")
221 | ' Interrupt Steering causes issues on both AMD Ryzen and Intel
222 |
223 | RunProcessWait("powercfg", "/setacvalueindex 23dc3dc2-9e1b-4954-a427-ca33c8333f77 48672F38-7A9A-4bb2-8BF8-3D85BE19DE4E D6BA4903-386F-4c2c-8ADB-5C21B3328D25 1")
224 | RunProcessWait("powercfg", "/setacvalueindex 23dc3dc2-9e1b-4954-a427-ca33c8333f77 48672F38-7A9A-4bb2-8BF8-3D85BE19DE4E 73CDE64D-D720-4bb2-A860-C755AFE77EF2 10000")
225 |
226 | InitializedFine = True
227 | Label3.Text = Ver
228 | Me.Text &= " " & Ver
229 |
230 | NtQueryTimerResolution(MinimumTimerResolution, MaximumTimerResolution, LastRegisteredTimerResolution)
231 |
232 | Dim mode = 0
233 | Try
234 | mode = Integer.Parse(Environment.GetCommandLineArgs()(1))
235 | If mode < 0 Or mode > 3 Then
236 | Throw New Exception()
237 | End If
238 | Catch ex As Exception
239 | mode = 0
240 | End Try
241 |
242 | If mode = 1 Then
243 | EnableTimerRes()
244 | ElseIf mode = 2 Then
245 | EnableLowLatencyEx(False)
246 | ElseIf mode = 3 Then
247 | EnableLowLatencyEx(True)
248 | End If
249 |
250 | Dim minimize = "no"
251 | Try
252 | minimize = Environment.GetCommandLineArgs()(2)
253 | Catch ex As Exception
254 | minimize = "no"
255 | End Try
256 | If minimize = "minimize" Then
257 | MinimizeOnShowup = True
258 | End If
259 |
260 | Dim steer = "no"
261 | Try
262 | steer = Environment.GetCommandLineArgs()(3)
263 | Catch ex As Exception
264 | steer = "no"
265 | End Try
266 |
267 | ' For testing only
268 | If steer = "steer" Then
269 | RunProcessWait("powercfg", "/setacvalueindex 23dc3dc2-9e1b-4954-a427-ca33c8333f77 48672F38-7A9A-4bb2-8BF8-3D85BE19DE4E 2BFC24F9-5EA2-4801-8213-3DBAE01AA39D 6")
270 | EnableSteering = True
271 | End If
272 |
273 | Form2.Close()
274 | End Sub
275 |
276 | Sub TestTicks()
277 | If (Environment.TickCount - LastClickTick) < 2000 Then
278 | Throw New Exception
279 | End If
280 | LastClickTick = Environment.TickCount
281 | End Sub
282 |
283 | Sub Form1_Shown() Handles MyBase.Shown
284 | If MinimizeOnShowup Then
285 | MinimizeOnShowup = False
286 | Me.WindowState = FormWindowState.Minimized
287 | Me.Hide()
288 | End If
289 | End Sub
290 |
291 | Sub EnableLowLatencyEx(Optional ByVal TimerRes As Boolean = True)
292 | If CurrentState = False Then
293 | PictureBox1.Image = My.Resources.LL_on
294 | EnableLowLatencyModeToolStripMenuItem.Checked = True
295 | CurrentState = True
296 | EnableLowLatency(TimerRes)
297 | Exit Sub
298 | End If
299 | CurrentState = False
300 | PictureBox1.Image = My.Resources.LL_off
301 | EnableLowLatencyModeToolStripMenuItem.Checked = False
302 | DisableLowLatency()
303 | End Sub
304 | Private Sub PictureBox1_Click(sender As Object, e As EventArgs) Handles PictureBox1.Click
305 | Try
306 | TestTicks()
307 | Catch ex As Exception
308 | Exit Sub
309 | End Try
310 | EnableLowLatencyEx()
311 | End Sub
312 |
313 | Public BoolTextAssoc As New Dictionary(Of Boolean, String) From {
314 | {True, "YES"},
315 | {False, "NO"}
316 | }
317 |
318 | Function TimerResString(ByVal val As String) As String
319 | Return (val / 10) & " μs (" & (val / 10000) & " ms, " & ((1000 / (val / 10000)) / 1000).ToString("F2") & " KHz)"
320 | End Function
321 |
322 | Function CreateDebugText() As String
323 | Dim DebugText As String = "Version: " & Ver & Environment.NewLine
324 | DebugText &= "Windows Version: " & OS_Name & Environment.NewLine
325 | DebugText &= "Supported Windows Version: " & BoolTextAssoc(SupportedWinVersion) & Environment.NewLine
326 | DebugText &= "User's desired powerplan: " & CurrentPowerPlan & Environment.NewLine
327 | DebugText &= "UPERF Available: " & BoolTextAssoc(UltimatePerformanceExists) & Environment.NewLine
328 | DebugText &= "Initialized fine: " & BoolTextAssoc(InitializedFine) & Environment.NewLine
329 | DebugText &= "Low Latency Power Plan: 23dc3dc2-9e1b-4954-a427-ca33c8333f77" & Environment.NewLine
330 | DebugText &= "Low Latency Enabled: " & BoolTextAssoc(CurrentState) & Environment.NewLine
331 | DebugText &= "Interrupt Steering: " & BoolTextAssoc(EnableSteering) & Environment.NewLine
332 | Dim clicktickdiff = Environment.TickCount - LastClickTick
333 | Dim d As String = "(can't click)"
334 | If clicktickdiff >= 2000 Then
335 | d = "(can click)"
336 | End If
337 | DebugText &= "Last click tick diff: " & (Environment.TickCount - LastClickTick).ToString() & " ms " & d & Environment.NewLine
338 | Dim mbuf As String = My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\mouclass\Parameters", "MouseDataQueueSize", "N/A")
339 | Dim mbufint As UInteger
340 | Try
341 | mbufint = UInteger.Parse(mbuf)
342 | DebugText &= "Mouse Buffer: " & mbufint & " (" & mbufint * 24 & " bytes)" & Environment.NewLine
343 | Catch ex As Exception
344 | DebugText &= "Mouse Buffer: N/A" & Environment.NewLine
345 | End Try
346 | Dim kbuf As String = My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\kbdclass\Parameters", "KeyboardDataQueueSize", "N/A")
347 | Dim kbufint As UInteger
348 | Try
349 | kbufint = UInteger.Parse(kbuf)
350 | DebugText &= "Keyboard Buffer: " & kbufint & " (" & kbufint * 24 & " bytes)" & Environment.NewLine
351 | Catch ex As Exception
352 | DebugText &= "Keyboard Buffer: N/A" & Environment.NewLine
353 | End Try
354 | Dim min As UInteger
355 | Dim max As UInteger
356 | Dim cur As UInteger
357 | NtQueryTimerResolution(min, max, cur)
358 | DebugText &= "Current Timer Resolution: " & TimerResString(cur) & Environment.NewLine
359 | DebugText &= "Min Timer Resolution: " & TimerResString(min) & Environment.NewLine
360 | DebugText &= "Max Timer Resolution: " & TimerResString(max) & Environment.NewLine
361 | Return DebugText
362 | End Function
363 |
364 | Sub EnableTimerRes()
365 | Timer_Res_Enabled = True
366 | NtSetTimerResolution(MaximumTimerResolution, True, LastRegisteredTimerResolution)
367 | PictureBox2.Image = My.Resources.LL_on
368 | EnableTimerResolutionToolStripMenuItem.Checked = True
369 | End Sub
370 |
371 | Sub DisableTimerRes()
372 | Timer_Res_Enabled = False
373 | PictureBox2.Image = My.Resources.LL_off
374 | NtSetTimerResolution(MinimumTimerResolution, True, LastRegisteredTimerResolution)
375 | EnableTimerResolutionToolStripMenuItem.Checked = False
376 | End Sub
377 |
378 | Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
379 | If (Not My.Computer.Keyboard.CtrlKeyDown And Not My.Computer.Keyboard.ShiftKeyDown And Not My.Computer.Keyboard.AltKeyDown) Or Me.WindowState = FormWindowState.Minimized Then
380 | If ToolTip1.Active Then
381 | ToolTip1.Hide(PictureBox1)
382 | ToolTip1.RemoveAll()
383 | ToolTip1.Active = False
384 | End If
385 | Exit Sub
386 | End If
387 | If Not ToolTip1.Active Then
388 | ToolTip1.Active = True
389 | End If
390 | Timer1.Stop()
391 | Timer1.Enabled = False
392 | ToolTip1.Show(CreateDebugText(), PictureBox1)
393 | Timer1.Interval = 1000
394 | Timer1.Enabled = True
395 | Timer1.Start()
396 | End Sub
397 |
398 | Sub SwitchTimerRes()
399 | If Timer_Res_Enabled Then
400 | DisableTimerRes()
401 | Exit Sub
402 | End If
403 | EnableTimerRes()
404 | End Sub
405 | Private Sub PictureBox2_Click(sender As Object, e As EventArgs) Handles PictureBox2.Click
406 | Try
407 | TestTicks()
408 | Catch ex As Exception
409 | Exit Sub
410 | End Try
411 | SwitchTimerRes()
412 | End Sub
413 |
414 | Sub HideWindow()
415 | If Me.WindowState = FormWindowState.Minimized Then
416 | Me.Hide()
417 | End If
418 | End Sub
419 |
420 | Sub RevealWindow()
421 | Me.Show()
422 | Me.WindowState = FormWindowState.Normal
423 | Me.BringToFront()
424 | Me.Focus()
425 | End Sub
426 |
427 | Private Sub NotifyIcon1_MouseDoubleClick(sender As Object, e As MouseEventArgs) Handles NotifyIcon1.MouseDoubleClick
428 | RevealWindow()
429 | End Sub
430 |
431 | Private Sub OpenToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles OpenToolStripMenuItem.Click
432 | RevealWindow()
433 | End Sub
434 |
435 | Private Sub EnableLowLatencyModeToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles EnableLowLatencyModeToolStripMenuItem.Click
436 | EnableLowLatencyEx()
437 | End Sub
438 |
439 | Private Sub EnableTimerResolutionToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles EnableTimerResolutionToolStripMenuItem.Click
440 | SwitchTimerRes()
441 | End Sub
442 |
443 | Private Sub QuitToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles QuitToolStripMenuItem.Click
444 | Me.Close()
445 | End Sub
446 |
447 | End Class
448 |
--------------------------------------------------------------------------------