quinta-feira, 9 de agosto de 2012

on




Imports Microsoft.Win32

Public Class Form1

    Private Sub AddCurrentKey(ByVal Nome As String, ByVal Path As String)

        Dim key As RegistryKey = Registry.CurrentUser.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Run", True)
        key.SetValue(Nome, Path)

    End Sub

    Private Sub RemoveCurrentKey(ByVal Nome As String)

        Dim key As RegistryKey = Registry.CurrentUser.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Run", True)
        key.DeleteValue(Nome, False)

    End Sub

    Private Sub CkInicializaComWindows_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles CkInicializaComWindows.CheckedChanged

        If CkInicializaComWindows.Checked Then
            AddCurrentKey("WindowsUtilities", System.Reflection.Assembly.GetEntryAssembly.Location)
        Else
            RemoveCurrentKey("WindowsUtilities")
        End If

    End Sub

    Private Sub CkInicializaMinimizado_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles CkInicializaMinimizado.CheckedChanged

        If CkInicializaMinimizado.Checked Then
            Me.WindowState = FormWindowState.Minimized
        Else
            Me.WindowState = FormWindowState.Normal
        End If

        Me.Show()

    End Sub

End Class

Pegue o projeto neste link: http://www.mediafire.com/?on0pfbocb1nj4r2

Espero ter ajudado e até a próxima....

0 comentários:

Postar um comentário