Advertisement
Onix86

Untitled

Dec 3rd, 2018
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Imports System.ComponentModel
  2. Imports System.IO
  3. Public Class Bureau
  4.     Dim p As String = Application.StartupPath & "\Onix's OS\"
  5.     Dim ps As String = p & "Session\"
  6.     Dim pb As String = ps & "Bureau\"
  7.     Dim pid As String = p & "IconData\"
  8.  
  9.  
  10.  
  11.     Dim menuOpen As Boolean = False
  12.     Dim calandarOpen As Boolean = False
  13.  
  14.     Dim sx As Integer = Screen.PrimaryScreen.Bounds.Width
  15.     Dim sy As Integer = Screen.PrimaryScreen.Bounds.Height
  16.  
  17.  
  18.     Dim Process1M As Boolean
  19.     Dim Process2M As Boolean
  20.  
  21.     Dim Icon1InMoov As Boolean = False
  22.  
  23.     Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
  24.         Label1.Text = TimeOfDay.ToString("hh : mm : ss")
  25.         Label2.Text = Date.Today
  26.     End Sub
  27.  
  28.     Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
  29.  
  30.         Me.Close()
  31.         System.Threading.Thread.Sleep(750)
  32.  
  33.         Form1.Close()
  34.     End Sub
  35.  
  36.     Private Sub PictureBox1_Click(sender As Object, e As EventArgs) Handles PictureBox1.Click
  37.         If menuOpen = True Then
  38.             Panel2.Visible = False
  39.             menuOpen = False
  40.         ElseIf menuOpen = False Then
  41.             Panel2.Visible = True
  42.             menuOpen = True
  43.         End If
  44.     End Sub
  45.  
  46.     Private Sub Label1_Click(sender As Object, e As EventArgs) Handles Label1.Click
  47.         If ContextMenuStrip1.Visible = False Then
  48.             If calandarOpen = True Then
  49.                 calandarOpen = False
  50.                 MonthCalendar1.Visible = False
  51.             ElseIf calandarOpen = False Then
  52.                 MonthCalendar1.Visible = True
  53.                 calandarOpen = True
  54.             End If
  55.         End If
  56.  
  57.     End Sub
  58.  
  59.     Private Sub Label2_Click(sender As Object, e As EventArgs) Handles Label2.Click
  60.         If ContextMenuStrip1.Visible = False Then
  61.             If calandarOpen = True Then
  62.                 calandarOpen = False
  63.                 MonthCalendar1.Visible = False
  64.             ElseIf calandarOpen = False Then
  65.                 MonthCalendar1.Visible = True
  66.                 calandarOpen = True
  67.             End If
  68.         Else
  69.         End If
  70.     End Sub
  71.  
  72.     Private Sub Bureau_Load(sender As Object, e As EventArgs) Handles MyBase.Click
  73.         MonthCalendar1.Visible = False
  74.         Panel2.Visible = False
  75.     End Sub
  76.  
  77.     Private Sub FermerWindowsToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles FermerWindowsToolStripMenuItem.Click
  78.         Form1.Close()
  79.     End Sub
  80.  
  81.     Private Sub Bureau_Load_1(sender As Object, e As EventArgs) Handles MyBase.Load
  82.         System.Threading.Thread.Sleep(1500)
  83.         If IO.Directory.Exists(ps & "Bureau") = False Then
  84.  
  85.             IO.Directory.CreateDirectory(ps & "Bureau")
  86.         Else
  87.  
  88.             ListBox1.Items.Clear()
  89.  
  90.             For Each FileName As String In Directory.GetFiles(ps & "Bureau")
  91.                 Dim FileExt As String = Path.GetExtension(FileName)
  92.                 Me.ListBox1.Items.Add(Path.GetFileNameWithoutExtension(FileName & FileExt))
  93.             Next FileName
  94.         End If
  95.  
  96.         If IO.Directory.Exists(pid) = False Then
  97.             IO.Directory.CreateDirectory(pid)
  98.             IO.Directory.CreateDirectory(pid & "icon1")
  99.             IO.File.WriteAllText(pid & "icon1\X", Icon1.Location.X)
  100.             IO.File.WriteAllText(pid & "icon1\Y", Icon1.Location.Y)
  101.         Else
  102.             If IO.Directory.Exists(pid & "icon1") = False Then
  103.                 IO.Directory.CreateDirectory(pid & "icon1")
  104.             Else
  105.                 'icon name
  106.                If IO.File.Exists(pid & "icon1\name") = False Then
  107.                     IO.File.WriteAllText(pid & "icon1\name", "Programme 1")
  108.                 Else
  109.                     Icon1name.Text = IO.File.ReadAllText(pid & "icon1\name")
  110.  
  111.                 End If
  112.                 'icon Location
  113.                If IO.File.Exists(pid & "icon1\X") And IO.File.Exists(pid & "icon1\Y") Then
  114.                     Icon1.Location = New Point(IO.File.ReadAllText(pid & "icon1\X"), IO.File.ReadAllText(pid & "icon1\Y")) 'load location
  115.  
  116.                 End If
  117.                 'Icon imagge
  118.                If IO.File.Exists(pid & "icon1\iconimgloc") = True Then
  119.                     If IO.File.Exists(IO.File.ReadAllText(pid & "icon1\iconimgloc")) Then
  120.                         Icon1Icon.BackgroundImage = Image.FromFile(IO.File.ReadAllText(pid & "icon1\iconimgloc"))
  121.  
  122.                     Else
  123.                         MessageBox.Show("L'image servant d'icône pour l'icône 1 a été supprimé !")
  124.                         IO.File.Delete(pid & "icon1\iconimgloc")
  125.                         Icon1Icon.BackgroundImage = Nothing
  126.                     End If
  127.  
  128.                     'icon programe location
  129.                    If IO.File.Exists(pid & "icon1\prloc") = True Then
  130.  
  131.                     End If
  132.  
  133.  
  134.                 End If
  135.  
  136.             End If
  137.  
  138.         End If
  139.     End Sub
  140.  
  141.     Private Sub AfficherLesÉlémentDuBureauToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles AfficherLesÉlémentDuBureauToolStripMenuItem.Click
  142.         ListBox1.Visible = True
  143.     End Sub
  144.  
  145.     Private Sub AfficherToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles AfficherToolStripMenuItem.Click
  146.         ListBox1.Visible = True
  147.         Button2.Visible = True
  148.     End Sub
  149.  
  150.     Private Sub CacherToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles CacherToolStripMenuItem.Click
  151.         ListBox1.Visible = False
  152.         Button2.Visible = False
  153.     End Sub
  154.  
  155.     Private Sub Timer2_Tick(sender As Object, e As EventArgs) Handles Timer2.Tick
  156.         If IO.Directory.Exists(ps & "Bureau") = False Then
  157.  
  158.             IO.Directory.CreateDirectory(ps & "Bureau")
  159.         Else
  160.  
  161.             ListBox1.Items.Clear()
  162.  
  163.             For Each FileName As String In Directory.GetFiles(ps & "Bureau")
  164.                 Dim FileExt As String = Path.GetExtension(FileName)
  165.                 Me.ListBox1.Items.Add(Path.GetFileNameWithoutExtension(FileName & FileExt))
  166.             Next FileName
  167.         End If
  168.     End Sub
  169.  
  170.     Private Sub OuvrirLemplacementToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles OuvrirLemplacementToolStripMenuItem.Click
  171.         Process.Start(ps & "Bureau")
  172.  
  173.     End Sub
  174.  
  175.     Private Sub ListBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ListBox1.DoubleClick
  176.         Dim Fname As String
  177.         Fname = pb & ListBox1.SelectedItem
  178.         If IO.File.Exists(pb & ListBox1.SelectedItem) Then
  179.             If Path.GetExtension(Fname) = ".txt" Then
  180.                 Notepad.Show()
  181.  
  182.                 System.Threading.Thread.Sleep(500)
  183.                 Notepad.RichTextBox1.Text = IO.File.ReadAllText(Fname)
  184.                 Notepad.Label1.Text = Path.GetFileNameWithoutExtension(Fname)
  185.  
  186.             Else
  187.                 MessageBox.Show("Impossible d'ouvrir le fichier pour le moment, Ce type de fichier (  " & Path.GetExtension(Fname) & "   ) n'est pas suporté pour le moment", "Erreur lors de l'ouverture du fichier")
  188.             End If
  189.         End If
  190.     End Sub
  191.  
  192.     Private Sub DocumentTexteToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles DocumentTexteToolStripMenuItem.Click
  193.         Notepad.Show()
  194.     End Sub
  195.  
  196.     Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
  197.         Dim Fname As String
  198.         Fname = pb & ListBox1.SelectedItem
  199.         If IO.File.Exists(pb & ListBox1.SelectedItem) Then
  200.             IO.File.Delete(pb & ListBox1.SelectedItem)
  201.             ListBox1.SelectedItem = ""
  202.         End If
  203.  
  204.     End Sub
  205.  
  206.     Private Sub MinimiserToolStripMenuItem_Click(sender As Object, e As EventArgs)
  207.  
  208.     End Sub
  209.  
  210.     Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
  211.         If Button3.Text = "Notepad" Then
  212.             If Process1M = True Then
  213.                 Notepad.Opacity = 100
  214.                 Process1M = False
  215.             ElseIf Process1M = False Then
  216.                 Notepad.Opacity = 0
  217.                 Process1M = True
  218.             End If
  219.  
  220.         ElseIf Button3.Text = "Navigateur internet" Then
  221.             If Process1M = True Then
  222.                 NavigateurInternet.Opacity = 100
  223.                 Process1M = False
  224.             ElseIf Process1M = False Then
  225.                 NavigateurInternet.Opacity = 0
  226.                 Process1M = True
  227.             End If
  228.  
  229.         End If
  230.     End Sub
  231.  
  232.     Private Sub FermerToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles FermerToolStripMenuItem.Click
  233.  
  234.  
  235.         If Button3.Text = "Notepad" Then
  236.             Notepad.Close()
  237.             NotepadSaveDialog.Close()
  238.         ElseIf Button3.Text = "Navigateur internet" Then
  239.             NavigateurInternet.Close()
  240.         End If
  241.  
  242.  
  243.     End Sub
  244.  
  245.     Private Sub PictureBox2_Click(sender As Object, e As EventArgs) Handles PictureBox2.Click
  246.         'same as button3
  247.        If Button3.Text = "Notepad" Then
  248.             If Process1M = True Then
  249.                 Notepad.Opacity = 100
  250.                 Process1M = False
  251.             ElseIf Process1M = False Then
  252.                 Notepad.Opacity = 0
  253.                 Process1M = True
  254.             End If
  255.  
  256.         ElseIf Button3.Text = "Navigateur internet" Then
  257.             If Process1M = True Then
  258.                 NavigateurInternet.Opacity = 100
  259.                 Process1M = False
  260.             ElseIf Process1M = False Then
  261.                 NavigateurInternet.Opacity = 0
  262.                 Process1M = True
  263.             End If
  264.         End If
  265.     End Sub
  266.  
  267.     Private Sub Icon1Icon_Click(sender As Object, e As EventArgs) Handles Icon1Icon.Click
  268.  
  269.     End Sub
  270.  
  271.     Private Sub Icon1Icon_MouseDown(sender As Object, e As MouseEventArgs) Handles Icon1Icon.MouseDown
  272.         Icon1InMoov = True
  273.     End Sub
  274.  
  275.     Private Sub Icon1Icon_MouseMove(sender As Object, e As MouseEventArgs) Handles Icon1Icon.MouseMove
  276.         If Icon1InMoov = True Then
  277.             Icon1.Location = New Point(MousePosition.X, MousePosition.Y)
  278.             IO.File.WriteAllText(pid & "icon1\X", Icon1.Location.X)
  279.             IO.File.WriteAllText(pid & "icon1\Y", Icon1.Location.Y)
  280.         End If
  281.     End Sub
  282.  
  283.     Private Sub Icon1Icon_MouseUp(sender As Object, e As MouseEventArgs) Handles Icon1Icon.MouseUp
  284.         Icon1InMoov = False
  285.     End Sub
  286.  
  287.     Private Sub AfinéAUnProgrammeToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles AfinéAUnProgrammeToolStripMenuItem.Click
  288.         IconOption.Show()
  289.         System.Threading.Thread.Sleep(500)
  290.         IconOption.Label1.Text = "Modifier les paramètres pour l'icône 1"
  291.         IconOption.NumericUpDown1.Value = 1
  292.         IconOption.TextBox3.Text = Icon1name.Text
  293.  
  294.         Dim p As New Process
  295.         Dim pname As String
  296.         If IO.File.Exists(pid & "icon1\prloc") Then
  297.             pname = IO.File.ReadAllText(pid & "icon1\prloc")
  298.  
  299.             If IO.File.Exists(pid & "icon1\prloc") = True And IO.File.Exists(pname) Then
  300.                 IconOption.TextBox2.Text = pname
  301.             Else
  302.                 IconOption.TextBox2.Text = ""
  303.             End If
  304.         End If
  305.  
  306.  
  307.         If File.Exists(pid & "icon1\iconimgloc") Then
  308.             If File.Exists(IO.File.ReadAllText(pid & "icon1\iconimgloc")) Then
  309.                 IconOption.TextBox1.Text = IO.File.ReadAllText(pid & "icon1\iconimgloc")
  310.             Else
  311.                 IconOption.TextBox1.Text = ""
  312.             End If
  313.         End If
  314.     End Sub
  315.  
  316.     Private Sub Icon1name_Click(sender As Object, e As EventArgs) Handles Icon1name.DoubleClick
  317.  
  318.     End Sub
  319.  
  320.     Private Sub Icon1Icon_DoubleClick(sender As Object, e As EventArgs) Handles Icon1Icon.DoubleClick
  321.         Dim p As New Process
  322.         Dim pname As String = IO.File.ReadAllText(pid & "icon1\prloc")
  323.  
  324.         If IO.File.Exists(pid & "icon1\prloc") = True Then
  325.             p.StartInfo.FileName = pname
  326.             p.Start()
  327.         End If
  328.     End Sub
  329.  
  330.     Private Sub Bureau_Closing(sender As Object, e As CancelEventArgs) Handles Me.Closing
  331.         System.Threading.Thread.Sleep(1500)
  332.     End Sub
  333.  
  334.     Private Sub OuvrirLeProgrammeToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles OuvrirLeProgrammeToolStripMenuItem.Click
  335.         Dim p As New Process
  336.         Dim pname As String
  337.         If IO.File.Exists(pid & "icon1\prloc") Then
  338.             pname = IO.File.ReadAllText(pid & "icon1\prloc")
  339.  
  340.             If IO.File.Exists(pid & "icon1\prloc") = True And IO.File.Exists(pname) Then
  341.                 p.StartInfo.FileName = pname
  342.                 p.Start()
  343.             End If
  344.         End If
  345.     End Sub
  346.  
  347.     Private Sub Icon1_DoubleClick(sender As Object, e As EventArgs) Handles Icon1.DoubleClick
  348.         Dim p As New Process
  349.         Dim pname As String
  350.         If IO.File.Exists(pid & "icon1\prloc") Then
  351.             pname = IO.File.ReadAllText(pid & "icon1\prloc")
  352.  
  353.             If IO.File.Exists(pid & "icon1\prloc") = True And IO.File.Exists(pname) Then
  354.                 p.StartInfo.FileName = pname
  355.                 p.Start()
  356.             End If
  357.         End If
  358.     End Sub
  359.  
  360.     Private Sub ToolStripMenuItem1_Click(sender As Object, e As EventArgs) Handles ToolStripMenuItem1.Click
  361.  
  362.  
  363.         If Button4.Text = "Notepad" Then
  364.             Notepad.Close()
  365.             NotepadSaveDialog.Close()
  366.         ElseIf Button4.Text = "Navigateur internet" Then
  367.             NavigateurInternet.Close()
  368.         End If
  369.     End Sub
  370.  
  371.     Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
  372.         NavigateurInternet.Show()
  373.     End Sub
  374.  
  375.     Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
  376.         If Button4.Text = "Notepad" Then
  377.             If Process1M = True Then
  378.                 Notepad.Opacity = 100
  379.                 Process1M = False
  380.             ElseIf Process1M = False Then
  381.                 Notepad.Opacity = 0
  382.                 Process1M = True
  383.             End If
  384.  
  385.         ElseIf Button4.Text = "Navigateur internet" Then
  386.             If Process2M = True Then
  387.                 NavigateurInternet.Opacity = 100
  388.                 Process2M = False
  389.             ElseIf Process2M = False Then
  390.                 NavigateurInternet.Opacity = 0
  391.                 Process2M = True
  392.             End If
  393.  
  394.         End If
  395.     End Sub
  396.  
  397.     Private Sub PictureBox3_Click(sender As Object, e As EventArgs) Handles PictureBox3.Click
  398.         If Button4.Text = "Notepad" Then
  399.             If Process1M = True Then
  400.                 Notepad.Opacity = 100
  401.                 Process1M = False
  402.             ElseIf Process1M = False Then
  403.                 Notepad.Opacity = 0
  404.                 Process1M = True
  405.             End If
  406.  
  407.         ElseIf Button4.Text = "Navigateur internet" Then
  408.             If Process2M = True Then
  409.                 NavigateurInternet.Opacity = 100
  410.                 Process2M = False
  411.             ElseIf Process2M = False Then
  412.                 NavigateurInternet.Opacity = 0
  413.                 Process2M = True
  414.             End If
  415.  
  416.         End If
  417.     End Sub
  418.  
  419.     Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click
  420.         Process.Start("com.epicgames.launcher://apps/Fortnite?action=launch&silent=true")
  421.     End Sub
  422. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement