Files
Lecteur-media/lecteur/lecteur média/Form152.vb
T
2026-06-18 14:15:48 +02:00

108 lines
3.8 KiB
VB.net

Imports System.ComponentModel
Imports System.IO
Public Class Form152
Dim util As Integer = 0
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
If util = 1 Then
Dim dw8 As New StreamWriter(lançer)
dw8.WriteLine(0)
dw8.Close()
Form1.NotifyIcon1.Visible = False
Process.Start(Application.StartupPath & "\utilitaires")
End
Else
Dim dw8 As New StreamWriter(lançer)
dw8.WriteLine(0)
dw8.Close()
Form1.NotifyIcon1.Visible = False
Try
Dim lines7() As String = File.ReadAllLines(dosparamètres & "\widgets\" & "lançer.txt")
If lines7(0) = 1 Then
killProcess("widgets.exe")
Dim dw18 As New StreamWriter(dosparamètres & "\widgets\" & "lançer.txt")
dw18.WriteLine(0)
dw18.Close()
Process.Start(Application.StartupPath & "\widget restart")
Else
End If
Catch ex As Exception
End Try
Process.Start(Application.StartupPath & "\rememarage")
End
End If
End Sub
Private Sub Form152_Closing(sender As Object, e As CancelEventArgs) Handles Me.Closing
If util = 1 Then
Dim dw8 As New StreamWriter(lançer)
dw8.WriteLine(0)
dw8.Close()
Form1.NotifyIcon1.Visible = False
Else
Dim dw8 As New StreamWriter(lançer)
dw8.WriteLine(0)
dw8.Close()
Form1.NotifyIcon1.Visible = False
Dim lines7() As String = File.ReadAllLines(dosparamètres & "\widgets\" & "lançer.txt")
If lines7(0) = 1 Then
killProcess("widgets.exe")
Dim dw18 As New StreamWriter(dosparamètres & "\widgets\" & "lançer.txt")
dw18.WriteLine(0)
dw18.Close()
Process.Start(Application.StartupPath & "\widget restart")
Else
End If
Process.Start(Application.StartupPath & "\rememarage")
End
End If
End Sub
Private Sub Form152_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Try
Dim lines1a() As String = File.ReadAllLines(théme)
If lines1a(0) = 2 Then
Me.BackColor = Color.FromArgb(64, 64, 64)
Label1.ForeColor = Color.White
Button1.BackColor = Color.FromArgb(64, 64, 64)
Button1.ForeColor = Color.White
ElseIf lines1a(0) = 3 Then
Me.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB)
Label1.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB)
Button1.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB)
Button1.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB)
Else
End If
Dim lines1b() As String = File.ReadAllLines(utilitairetemps)
If lines1b(0) = 1 Then
util = 1
Else
util = 0
End If
Catch ex As Exception
End Try
End Sub
Sub killProcess(ByVal ProcessName As String)
Dim svc As Object
Dim sQuery As String
Dim oproc
svc = GetObject("winmgmts:root\cimv2")
sQuery = "select * from win32_process where name='" & ProcessName & "'"
For Each oproc In svc.execquery(sQuery)
oproc.Terminate()
Next
svc = Nothing
End Sub
End Class