Hey,
meine Skripte entstehen meistens einem "Heureka!" Moment :D. So auch dieses. Mich nervte immer, dass Lima-City nur Roundcube anbietet, da es aus irgendeinen Grund keine Cookies speichert (sprich: ist es nur bei mir so?). So hab ich schnell dieses Skript geschrieben. Für Die Error.html hab ich die EXE gespeichert, diese wird allerdings nicht unbedingt benötigt (ist nur eine Hilfe "Seite", wo steht, wie man das Programm einstellt). Ich will noch eventuell eine Auswahl einbauen für mehrere Benutzer und auch dass das Passwort verschlüsselt gespeichert wird. Das letztere habe ich schon ausprobiert, bin aber kläglich gescheitert . Ah, da ist noch was. Ich hasse die Punkte beim Passwort Feld. Am iPhone ist es ja ok, wenn ich grad in der U-Bahn mein Facebook Passwort eingebe. Aber ich hasse es wirklich. Sie vermeiden immer das korrekte schreiben, wenn man grad die Tastatur nicht gerade auswendig kennt. Und so baue ich die Maske in keinem meiner Skripte ein.
Das Skript:
Spoiler anzeigen
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=icon.ico
#AutoIt3Wrapper_Outfile=Mail for Roundcube.exe
#AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <WindowsConstants.au3>
#include <IE.au3>
#Include <Crypt.au3>
Global $USER, $Pass
FileInstall( "Error.html", "Error.html")
If IniRead( "User.ini", "User", "URL", "error") = "error" Then
$url = @ScriptDir & "\Error.html"
Else
$url = IniRead( "User.ini", "User", "URL", "error")
$Pass = IniRead( "User.ini", "User", "Password", "error")
$USER = IniRead( "User.ini", "User", "Username", "error")
EndIf
$GUI = GUICreate("Mail for Roundcube©",@DesktopWidth,@DesktopHeight-70)
$object = ObjCreate("Shell.Explorer.2")
$object_ctrl = GUICtrlCreateObj($object, 0, 0, @DesktopWidth-10, @DesktopHeight-80)
$Menu = GUICtrlCreateMenu( "Settings")
$Setup = GUICtrlCreateMenuItem( "Setup Program", $Menu)
GUISetState( @SW_SHOW, $GUI)
_IENavigate($object, $url)
If $url <> "error" Then
_Login()
EndIf
While 1
$nMsg = GUIGetMsg()
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]Switch $nMsg
[/autoit] [autoit][/autoit] [autoit]Case $GUI_EVENT_CLOSE
Exit
Case $Setup
$url = InputBox( "URL", "Type in your Mailbox URL")
$USER = InputBox( "Username", "Type in your username.")
$Pass = InputBox( "Password", "Type in your password.")
IniWrite( "User.ini", "User", "Username", $USER)
IniWrite( "User.ini", "User", "Password", $Pass)
IniWrite( "User.ini", "User", "URL", $url)
MsgBox( 64, "Setted", "Setted up!")
_IENavigate($object, $url)
_Login()
EndSwitch
WEnd
Func _Login()
ControlSend( "Mail for Roundcube©", "", "[CLASS:Internet Explorer_Server; INSTANCE:1]", $USER)
Send("{TAB}")
Send($Pass)
Send( "{ENTER}")
EndFunc
Die EXE findet ihr im Anhang. Kritiken - sowohl gute als auch schlechte - sind erwünscht!
MFG,
StevenX
P.S.: Das Icon hab nicht ich erstellt, aber ist für kommerzielle Nutzung erlaubt