[Blockierte Grafik: http://www.abload.de/img/p_0007joki1.jpg]
#################%###########
Kirjaudu 2
Kirjaudu.limesoft.at.tf
#################%###########
Hey Leute,
als allererstes: Prosit Neujahr aus Österreich!
Nachdem ich einige Zeit AutoIt gelernt habe, melde ich mich mal mit einem kleinen, aber feinem Skript. Es ging hier mir nicht so sehr umd die Vielfalt und Länge des Skriptes. Mit dem Script habe ich fast alle wichtige Funktionen integriert.
Was ist Kirjaudu?
Kirjaudu ist ein Programm, mit dessen Hilfe man den Windows 7 (und andere?) Anmeldebildschirm modifizieren und ändern kann.
Was ist so besonders?
Kirjaudu hat wenig Code (~105 Zeilen) und hat eine ausführliche Fehlerbehandlung und zeigt nebenbei die Informationen des Bildes an und erkennt, ob man das Bild verwenden kann.
Warum der Name?
Da Finnisch für Programme gerade "IN" ist, steht Kirjaudu für das finnische "Anmelden".
Neue Version: 1.1
Hab einen Fehler entdeckt und ihn verbessert. Script aktualisiert.
Neue Version: 1.1.1
Problem vollständig gelöst (Danke Matricus!); Script aktualisiert.
Script:
Spoiler anzeigen
DllCall("kernel32.dll", "int", "Wow64DisableWow64FsRedirection", "int", 1)
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=..\..\Icons\Basic\Basic_set2_Win\photo.ico
#AutoIt3Wrapper_Outfile=Kirjaudu.exe
#AutoIt3Wrapper_UseX64=n
#AutoIt3Wrapper_Res_Comment=Change your Login Wallpaper in Finish
#AutoIt3Wrapper_Res_Description=Kirjaudu
#AutoIt3Wrapper_Res_Fileversion=1.1
#AutoIt3Wrapper_Res_LegalCopyright=(C) LimeSoft Solutions 2012
#AutoIt3Wrapper_Res_requestedExecutionLevel=requireAdministrator
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <GDIPlus.au3>
_GDIPlus_Startup()
#region ### START Koda GUI section ### Form=C:\Users\Administrator\Documents\StevenX Media\Kirjaudu\1.1\Gui1.kxf
$Form1 = GUICreate("Kirjaudu 1.1", 628, 338, 192, 124)
$Label1 = GUICtrlCreateLabel("Kirjaudu", 232, 24, 148, 49)
GUICtrlSetFont(-1, 30, 400, 0, "Myriad")
$Start_1 = GUICtrlCreateButton("Click to start", 24, 136, 569, 89)
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###
If @CPUArch = "X64" Then
$Reg_CPU = "HKLM64"
Else
$Reg_CPU = "HKEY_LOCAL_MACHINE"
EndIf
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Start_1
GUISetState(@SW_HIDE, $Form1)
$Photo_File = FileOpenDialog("Open the Photo", "", "JPG Photo(*.jpg)")
_GUI2()
EndSwitch
WEnd
Func _GUI2()
#region ### START Koda GUI section ### Form=c:\users\administrator\documents\stevenx media\kirjaudu\1.1\gui2.kxf
$Kirjaudu2 = GUICreate("Kirjaudu 1.1", 630, 453, 309, 100)
$Group1 = GUICtrlCreateGroup("File Informations", 32, 32, 569, 337)
$Photo_Dim_L = GUICtrlCreateLabel("Photo Dimensions:", 40, 64,100,100)
$Photo_Size_L = GUICtrlCreateLabel("Photo Size:", 40, 104,100,100)
$Desktop_Dim_L = GUICtrlCreateLabel("Desktop Dimensions:", 40, 144,100,100)
$Ready_L = GUICtrlCreateLabel("Status:", 40, 176,100,100)
$Pic1 = GUICtrlCreatePic ("", 328, 64, 265,250)
$Photo_Label = GUICtrlCreateLabel("Photo Path: ", 200, 328,500)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Start_Button = GUICtrlCreateButton("Start", 32, 384, 209, 41)
$Revert_Button = GUICtrlCreateButton("Back To Normal", 280, 384, 209, 41)
$Label5 = GUICtrlCreateLabel("Kirjaudu", 240, 8, 103, 36)
GUICtrlSetFont(-1, 20, 400, 0, "Myriad")
GUICtrlSetColor(-1, 0x646464)
GUISetState(@SW_SHOW, $Kirjaudu2)
GUICtrlSetImage($Pic1, $Photo_File)
$hImage = _GDIPlus_ImageLoadFromFile($Photo_File)
$Photo_width = _GDIPlus_ImageGetWidth($hImage)
$Photo_height = _GDIPlus_ImageGetHeight($hImage)
GUICtrlSetData($Photo_Label, "Photo Path: " & $Photo_File)
GUICtrlSetData($Photo_Size_L, "Photo Size: " & FileGetSize($Photo_File) / 1024 & " Kilobytes")
GUICtrlSetData($Photo_Dim_L, "Dimensions: " & $Photo_width & "X" & $Photo_height)
GUICtrlSetData($Desktop_Dim_L, "Desktop Dimensions: " & @DesktopWidth & "X" & @DesktopHeight)
If $Photo_width & "X" & $Photo_height <> @DesktopWidth & "X" & @DesktopHeight And FileGetSize($Photo_File) > 256000 Then
GUICtrlSetData($Ready_L, "Ready: The Photo size is bigger than 250 kilobytes." & @CRLF & "The Photo Dimensions are not equal with the dimensions of your Desktop. If you start, the picture will not appear.")
ElseIf FileGetSize($Photo_File) > 256000 Then
GUICtrlSetData($Ready_L, "Ready: The Photo size is bigger than 250 kilobytes. If you start, the picture will not appear.")
ElseIf $Photo_width & "X" & $Photo_height <> @DesktopWidth & "X" & @DesktopHeight Then
GUICtrlSetData($Ready_L, "Ready: The Photo Dimensions are not equal with the dimensions of your Desktop. But you can start")
Else
GUICtrlSetData($Ready_L, "Ready: You can start")
EndIf
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Start_Button
DirRemove( @HomeDrive & '\Windows\System32\oobe\Info\backgrounds\')
DirCreate( @HomeDrive & '\Windows\System32\oobe\Info\backgrounds\')
FileDelete( @HomeDrive & '\Windows\System32\oobe\Info\backgrounds\backgroundDefault.jpg')
RegDelete( $Reg_CPU & "\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\Background", "OEMBackground");This is the Registry Key for the Background
$Reg = RegWrite( $Reg_CPU & "\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\Background", "OEMBackground", "REG_DWORD", "1")
$Copy = FileCopy( $Photo_File, @HomeDrive & '\Windows\System32\oobe\Info\backgrounds\backgroundDefault.jpg',
If $Copy = 0 AND $Reg = 0 Then
MsgBox( 0+16, "ERROR", "Could not edit Registry AND could not copy photo")
ElseIf $Reg = 0 Then
MsgBox( 0+16, "ERROR", "Could not edit Registry")
ElseIf $Copy = 0 Then
MsgBox( 0+16, "ERROR", "Could not copy photo")
Else
MsgBox( 0+64, "Successful", "Finished successfully")
EndIf
Case $Revert_Button
$Reg_Del = RegDelete( $Reg_CPU & "\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\Background", "OEMBackground")
$Reg = RegWrite( $Reg_CPU & "\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\Background", "OEMBackground", "REG_DWORD", "0")
If $Reg_Del = 0 AND $Reg = 0 Then
MsgBox( 0+16, "ERROR", "Could not edit Registry AND could not copy photo")
ElseIf $Reg = 0 Then
MsgBox( 0+16, "ERROR", "Could not edit Registry")
ElseIf $Reg_Del = 0 Then
MsgBox( 0+16, "ERROR", "Could not copy photo")
Else
MsgBox( 0+64, "Successful", "Finished successful")
EndIf
EndSwitch
WEnd
EndFunc ;==>_GUI2
Kirjaudu: Informationen:
Aktuelle Version: 1.1.1
Sourceforge: https://sourceforge.net/projects/kirjaudu/
Update Server: NEIN
Aktulle Größe: ~377 KB
Ich hoffe es macht euch Spaß, rumzuexperimentieren und an alles Vista und XP Nutzer: geht es bei euch?
Dann mal
MFG,
StevenX