Hi,
da Outlook immer nur sehr kurz eine Meldung anzeigt wenn eine neue Email vorhanden ist, habe ich mal ein kleines Script geschrieben das das ganze dauerhaft anzeigt bis man es weg klickt.
Ist nichts großes, einfach nur kleines Infofenster. Benötigt wird die OutlookUDF: klick mich
Spoiler anzeigen
#include <Outlook.au3>
#include <GDIPlus.au3>
#include <GUIConstantsEx.au3>
AdlibRegister("_getemail", 300000)
Global $gui
$sichtbar = False
$guiwidth = 100
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
GUIDelete($gui)
$sichtbar = False
EndSwitch
WEnd
Func _getemail()
If $sichtbar = False Then
$ol = _OutlookOpen()
$mail = _OutlookGetMail($ol, 6, False, "", "", "", "", "", "", True)
$gui = GUICreate("Neue Email", $guiwidth, 65 * $mail[0][1], -1, -1)
GUISetBkColor(0xFFFF00)
If $mail[0][1] > 0 Then
For $i = 1 To $mail[0][1] Step 1
If $i = 1 Then
$top = 8
Else
$top = (64 * ($i - 1)) + 8
EndIf
$absenderwidth = _textlaenge($mail[$i][0])
$betreffwidth = _textlaenge($mail[$i][7])
If $absenderwidth > $betreffwidth Then
$width = $absenderwidth
Else
$width = $betreffwidth
EndIf
If $width > $guiwidth Then
$guiwidth = $width + 20
EndIf
WinMove("Neue Email", "", (@DesktopWidth / 2) - ($guiwidth / 2), (@DesktopHeight / 2) - ((65 * $mail[0][1]) / 2), $guiwidth)
[/autoit] [autoit][/autoit] [autoit]GUICtrlCreateLabel($mail[$i][0] & @CRLF & $mail[$i][7], 0, $top, $width, 50)
GUICtrlSetFont(-1, 12, 400, 0, "Arial")
Next
GUISetState(@SW_SHOW)
$sichtbar = True
EndIf
_OutlookClose()
EndIf
EndFunc ;==>_getemail
Func _textlaenge($text)
If $text = '' Then Return
_GDIPlus_Startup()
Local $hFormat = _GDIPlus_StringFormatCreate(0)
Local $hFamily = _GDIPlus_FontFamilyCreate("Arial")
Local $hFont = _GDIPlus_FontCreate($hFamily, 12, 0, 3)
Local $tLayout = _GDIPlus_RectFCreate(15, 171, 0, 0)
Local $hGraphic = _GDIPlus_GraphicsCreateFromHWND($gui)
Local $aInfo = _GDIPlus_GraphicsMeasureString($hGraphic, $text, $hFont, $tLayout, $hFormat)
Local $iWidth = Ceiling(DllStructGetData($aInfo[0], "Width"))
;Local $iHeight = Ceiling(DllStructGetData($aInfo[0], "Height"))
_GDIPlus_StringFormatDispose($hFormat)
_GDIPlus_FontDispose($hFont)
_GDIPlus_FontFamilyDispose($hFamily)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_Shutdown()
Return $iWidth
EndFunc ;==>_textlaenge