Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports System.IO
- Public Class LogonScreen
- 'Written By Sixem 03.08.2013
- 'This needs admin rights
- Public Shared Title As String = CStr("Logon Screen")
- Public Shared Function Logon_Check()
- Dim LogonOEM As Integer = My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\Background", "OEMBackground", Nothing)
- Return LogonOEM
- End Function
- Public Shared Sub Logon_Patch()
- My.Computer.Registry.SetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\Background", "OEMBackground", "1")
- Dim LogonOEM As Integer = My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\Background", "OEMBackground", Nothing)
- If LogonOEM = 1 Then
- MessageBox.Show("Registry Patched!", Title)
- End If
- End Sub
- Public Shared Sub Logon_Unpatch()
- My.Computer.Registry.SetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\Background", "OEMBackground", "0")
- Dim LogonOEM As Integer = My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\Background", "OEMBackground", Nothing)
- If LogonOEM = 0 Then
- MessageBox.Show("Registry Unpatched!", Title)
- End If
- End Sub
- Public Shared Sub Logon_Change()
- Dim LogonOEM As Integer = My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\Background", "OEMBackground", Nothing)
- If LogonOEM = 1 Then
- Dim fd As OpenFileDialog = New OpenFileDialog()
- fd.Title = "Choose Image For Background"
- fd.Filter = "Image files (*.jpg, *.jpeg, *.jpe, *.jfif, *.png) | *.jpg; *.jpeg; *.jpe; *.jfif; *.png"
- fd.InitialDirectory = "C:\"
- fd.FilterIndex = 2
- fd.RestoreDirectory = True
- If fd.ShowDialog() = DialogResult.OK Then
- Dim File_Handle As New FileInfo(fd.FileName)
- Dim File_Length As Long = File_Handle.Length
- Dim File_Size_KB As Integer = Math.Round((File_Length / 1024), 0)
- If File_Size_KB > 256 Then
- MessageBox.Show("That image is too big, it can't be over 256 KB!", Title)
- Else
- Dim Background As New Bitmap(fd.FileName)
- Dim S32 As String = (Environment.GetFolderPath(Environment.SpecialFolder.System)) & "\oobe\Info\backgrounds\"
- Background.Save(S32 & "backgroundDefault.jpg", System.Drawing.Imaging.ImageFormat.Jpeg)
- MessageBox.Show("Successfully Changed!", Title)
- End If
- End If
- Else
- MessageBox.Show("Registry needs to be patched first!", Title)
- End If
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment