1. Dashboard
  2. Mitglieder
    1. Letzte Aktivitäten
    2. Benutzer online
    3. Team
    4. Mitgliedersuche
  3. Forenregeln
  4. Forum
    1. Unerledigte Themen
  • Anmelden
  • Registrieren
  • Suche
Alles
  • Alles
  • Artikel
  • Seiten
  • Forum
  • Erweiterte Suche
  1. AutoIt.de - Das deutschsprachige Forum.
  2. Mitglieder
  3. fschaef

Beiträge von fschaef

  • Problem mit XML Datei lesen

    • fschaef
    • 26. Juli 2011 um 20:53

    Hallo und Guten Abend an Alle,
    ich möchte eine Datei (XML) parsen. Dazu habe ich mir die xmldom besorgt.
    Wenn ich jetzt die Anzahl der Nodes ausgeben lassen will, erhalte ich folgende Fehlermeldung:

    Spoiler anzeigen


    >"C:\Programme\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "G:\Eigene Dateien 14.7.2011\meine.au3" /autoit3dir "C:\Programme\AutoIt3" /UserParams
    +>20:37:40 Starting AutoIt3Wrapper v.2.0.1.24 Environment(Language:0407 Keyboard:00000407 OS:WIN_XP/Service Pack 3 CPU:X64 OS:X86)
    >Running AU3Check (1.54.19.0) from:C:\Programme\AutoIt3
    +>20:37:40 AU3Check ended.rc:0
    >Running 3.3.6.1):C:\Programme\AutoIt3\autoit3.exe "G:\Eigene Dateien 14.7.2011\meine.au3"
    @@ Debug(25) : $rc = 1
    >Error code: 0
    Error retrieving node count for: /feed/entry
    No nodes of specified type found.

    @@ Debug(2 : $rc = -1
    >Error code: 1
    +>20:37:41 AutoIT3.exe ended.rc:0
    >Exit code: 0 Time: 2.232

    Ich bin mir aber hundertprozentig sicher, daß es hunderte von Einträgen für "entry" gibt.

    Auszug aus der XML:

    Spoiler anzeigen


    <?xml version='1.0' encoding='UTF-8'?>
    <feed xmlns='http://www.w3.org/2005/Atom' xmlns:app='http://www.w3.org/2007/app' xmlns:media='http://search.yahoo.com/mrss/' xmlns:openSearch='http://a9.com/-/spec/opensearch/1.1/' xmlns:gd='http://schemas.google.com/g/2005' xmlns:yt='http://gdata.youtube.com/schemas/2007' gd:etag='W/&quot;Dk8MQ389fCp7ImA9WhdSFkU.&quot;'>
    <id>tag:youtube.com,2008:user:7600celsius:uploads</id>
    <updated>2011-07-26T12:54:42.164Z</updated>
    <category scheme='http://schemas.google.com/g/2005#kind' term='http://gdata.youtube.com/schemas/2007#video'/>
    <title>Uploads by 7600celsius</title>
    <logo>http://www.youtube.com/img/pic_youtubelogo_123x63.gif</logo>
    <link rel='related' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/users/7600celsius'/>
    <link rel='alternate' type='text/html' href='http://www.youtube.com/profile_videos?user=7600celsius'/>
    <link rel='hub' href='http://pubsubhubbub.appspot.com'/>
    <link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/users/7600celsius/uploads'/>
    <link rel='http://schemas.google.com/g/2005#batch' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/users/7600celsius/uploads/batch'/>
    <link rel='self' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/users/7600celsius/uploads?start-index=51&amp;max-results=5'/>
    <link rel='service' type='application/atomsvc+xml' href='http://gdata.youtube.com/feeds/api/users/7600celsius/uploads?alt=atom-service'/>
    <link rel='previous' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/users/7600celsius/uploads?start-index=46&amp;max-results=5'/>
    <link rel='next' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/users/7600celsius/uploads?start-index=56&amp;max-results=5'/>
    <author>
    <name>7600celsius</name>
    <uri>http://gdata.youtube.com/feeds/api/users/7600celsius</uri>
    </author>
    <generator version='2.0' uri='http://gdata.youtube.com/'>YouTube data API</generator>
    <openSearch:totalResults>1254</openSearch:totalResults>
    <openSearch:startIndex>51</openSearch:startIndex>
    <openSearch:itemsPerPage>5</openSearch:itemsPerPage>
    <entry gd:etag='W/&quot;DUMBSH47eCp7ImA9WhdTGUs.&quot;'>
    <id>tag:youtube.com,2008:video:FxIh70nkZmE</id>
    <published>2011-05-16T04:18:07.000Z</published>
    <updated>2011-07-18T05:37:39.000Z</updated>
    <app:control>
    <app:draft>yes</app:draft>
    <yt:state name='restricted' reasonCode='requesterRegion'>This video is not available in your region.</yt:state>
    </app:control>
    <category scheme='http://schemas.google.com/g/2005#kind' term='http://gdata.youtube.com/schemas/2007#video'/>
    <title>Alan Parsons - Prime Time ( live )</title>
    <link rel='alternate' type='text/html' href='http://www.youtube.com/watch?v=FxIh70nkZmE&amp;feature=youtube_gdata'/>
    <link rel='self' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/users/7600celsius/uploads/FxIh70nkZmE'/>
    <author>
    <name>7600celsius</name>
    <uri>http://gdata.youtube.com/feeds/api/users/7600celsius</uri>
    </author>
    <media:group>
    <media:category label='Musik' scheme='http://gdata.youtube.com/schemas/2007/categories.cat'>Music</media:category>
    <media:credit role='uploader' scheme='urn:youtube'>7600celsius</media:credit>
    <media:title type='plain'>Alan Parsons - Prime Time ( live )</media:title>
    <yt:videoid>FxIh70nkZmE</yt:videoid>
    </media:group>
    </entry>
    <entry gd:etag='W/&quot;DEYMR347eCp7ImA9WhdTGUs.&quot;'>
    <id>tag:youtube.com,2008:video:m1pbM7_gdUg</id>
    <published>2011-05-14T04:31:05.000Z</published>
    <updated>2011-07-18T05:16:26.000Z</updated>
    <app:control>
    <app:draft>yes</app:draft>
    <yt:state name='restricted' reasonCode='requesterRegion'>This video is not available in your region.</yt:state>
    </app:control>
    <category scheme='http://schemas.google.com/g/2005#kind' term='http://gdata.youtube.com/schemas/2007#video'/>
    <title>Alan Parsons - Prime time ( live )</title>
    <link rel='alternate' type='text/html' href='http://www.youtube.com/watch?v=m1pbM7_gdUg&amp;feature=youtube_gdata'/>
    <link rel='self' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/users/7600celsius/uploads/m1pbM7_gdUg'/>
    <author>
    <name>7600celsius</name>
    <uri>http://gdata.youtube.com/feeds/api/users/7600celsius</uri>
    </author>
    <media:group>
    <media:category label='Musik' scheme='http://gdata.youtube.com/schemas/2007/categories.cat'>Music</media:category>
    <media:credit role='uploader' scheme='urn:youtube'>7600celsius</media:credit>
    <media:title type='plain'>Alan Parsons - Prime time ( live )</media:title>
    <yt:videoid>m1pbM7_gdUg</yt:videoid>
    </media:group>
    </entry>
    <entry gd:etag='W/&quot;DEYMRH47eCp7ImA9WhdTGUs.&quot;'>
    <id>tag:youtube.com,2008:video:l5K7st4YfTA</id>
    <published>2011-05-14T04:29:42.000Z</published>
    <updated>2011-07-18T05:16:25.000Z</updated>
    <app:control>
    <app:draft>yes</app:draft>
    <yt:state name='restricted' reasonCode='requesterRegion'>This video is not available in your region.</yt:state>
    </app:control>
    <category scheme='http://schemas.google.com/g/2005#kind' term='http://gdata.youtube.com/schemas/2007#video'/>
    <title>Alan Parsons - Old and wise ( Live )</title>
    <link rel='alternate' type='text/html' href='http://www.youtube.com/watch?v=l5K7st4YfTA&amp;feature=youtube_gdata'/>
    <link rel='self' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/users/7600celsius/uploads/l5K7st4YfTA'/>
    <author>
    <name>7600celsius</name>
    <uri>http://gdata.youtube.com/feeds/api/users/7600celsius</uri>
    </author>
    <media:group>
    <media:category label='Musik' scheme='http://gdata.youtube.com/schemas/2007/categories.cat'>Music</media:category>
    <media:credit role='uploader' scheme='urn:youtube'>7600celsius</media:credit>
    <media:title type='plain'>Alan Parsons - Old and wise ( Live )</media:title>
    <yt:videoid>l5K7st4YfTA</yt:videoid>
    </media:group>
    </entry>

    Hier mein Script:

    [autoit]


    Global $debugging = True

    [/autoit][autoit][/autoit][autoit]

    $rc = _XMLFileOpen(@ScriptDir & "\test.xml")
    ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $rc = ' & $rc & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
    if $rc = 1 Then
    $iEntryCnt = _XMLGetNodeCount("/feed/entry", "", $NODE_ELEMENT)
    ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $rc = ' & $iEntryCnt & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
    EndIf

    [/autoit]

    Vielen Dank schon mal für Eure Hilfe.

  • GDI+ Text jede Sekunde neu zeichnen

    • fschaef
    • 3. März 2011 um 16:29

    Hi,

    danke schön. Wie übermale ich meinen Backpuffer?

  • GDI+ Text jede Sekunde neu zeichnen

    • fschaef
    • 3. März 2011 um 16:06

    Hallo Alle,

    ich habe mir eine Uhr mit GDI+ gebastelt. (Analog + Digital). Nur wird die Anzeige für die digitale Anzeige immer fetter und unlesericher. Woran liegt das? Ich bitte um Hilfe.

    Spoiler anzeigen

    ; all credits to WideBoyDixon, i just reordered his code.
    #include <WindowsConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <GDIPlus.au3>

    Opt("GUIOnEventMode", 1)
    $width = 240
    $height = 240
    $hWnd = GUICreate("Clock", $width, $height)


    GUISetOnEvent($GUI_EVENT_CLOSE, "close")


    _GDIPlus_Startup()
    $graphics = _GDIPlus_GraphicsCreateFromHWND($hWnd)
    $bitmap = _GDIPlus_BitmapCreateFromFile (@MyDocumentsDir & "\GDIPlus_Image.bmp")
    ;- $bitmap = _GDIPlus_BitmapCreateFromGraphics($width, $height, $graphics)
    $backbuffer = _GDIPlus_ImageGetGraphicsContext($bitmap)
    _GDIPlus_GraphicsSetSmoothingMode($backbuffer, 4)

    $inc = 0
    AdlibRegister("_DrawClock",200)
    $lgBrush = _GDIPlus_CreateLineBrushFromRect(20, 20, 230, 230, -1, -1, 0xFF7878FF, 0x00000000, 0)
    $irBrush = _GDIPlus_CreateLineBrushFromRect(20, 20, 230, 230, -1, -1, 0x00000000, 0xFF7878FF, 0)
    $nuBrush = _GDIPlus_BrushCreateSolid(0xFFFFFFFF)
    $hFormat = _GDIPlus_StringFormatCreate()
    $hFamily = _GDIPlus_FontFamilyCreate("Arial")
    $nuFont = _GDIPlus_FontCreate($hFamily, 12, 1)

    $hourBrush = _GDIPlus_BrushCreateSolid(0xFF7878FF)
    $minuteBrush = _GDIPlus_BrushCreateSolid(0xFF7878FF)
    $secondPen = _GDIPlus_PenCreate(0xCC330000, 1)

    ;- $bitmap2 = _GDIPlus_BitmapCreateFromGraphics($width, $height, $graphics)
    $bitmap2 = _GDIPlus_BitmapCreateFromFile (@MyDocumentsDir & "\GDIPlus_Image.bmp")
    $backbuffer2 = _GDIPlus_ImageGetGraphicsContext($bitmap2)

    _GDIPlus_GraphicsSetSmoothingMode($backbuffer2, 4)
    ;- _GDIPlus_GraphicsClear($backbuffer2, 0xFFFFFFFF)

    ;- _GDIPlus_GraphicsFillEllipse($backbuffer2, 20, 20, 200, 200, $lgBrush)
    ;- _GDIPlus_GraphicsFillEllipse($backbuffer2, 30, 30, 180, 180, $irBrush)
    ;- _GDIPlus_GraphicsFillEllipse($backbuffer2, 33, 33, 174, 174, $lgBrush)

    _DrawMyText("12", 109, 40)
    _DrawMyText("11", 75, 50)
    _DrawMyText("10", 47, 75)
    _DrawMyText("9", 43, 110)
    _DrawMyText("8", 52, 145)
    _DrawMyText("7", 75, 170)
    _DrawMyText("6", 113, 180)
    _DrawMyText("5", 150, 170)
    _DrawMyText("4", 173, 145)
    _DrawMyText("3", 182, 110)
    _DrawMyText("2", 173, 75)
    _DrawMyText("1", 150, 50)
    _DrawMyText("PM", 105, 155)


    GUIRegisterMsg($WM_PAINT,"MY_PAINT")
    GUISetState()
    Do


    Until Not Sleep(100)
    Func MY_PAINT($hWnd,$uMsg,$lParam,$wParam)
    _DrawClock()
    Return $GUI_RUNDEFMSG
    EndFunc
    Func _DrawClock()
    _GDIPlus_GraphicsDrawImage($backbuffer,$bitmap2,0,0)
    _DrawMyTime()
    ;Create angles
    $secondAngle = 8.0 * ATan(1) * @SEC / 60.0
    $minuteAngle = 8.0 * ATan(1) * (@MIN + @SEC / 60.0) / 60.0
    $hourAngle = 8.0 * ATan(1) * (@HOUR + @MIN / 60.0) / 12.0

    ;Draw Hour Hand
    Local $HourArrow[5][2] = [[4, 0], _
    [Int(40 * Sin($hourAngle)) + 120, Int(-40 * Cos($hourAngle)) + 120], _
    [Int(-5 * Cos($hourAngle)) + 120, Int(-5 * Sin($hourAngle)) + 120], _
    [Int(5 * Cos($hourAngle)) + 120, Int(5 * Sin($hourAngle)) + 120], _
    [Int(40 * Sin($hourAngle)) + 120, Int(-40 * Cos($hourAngle)) + 120]]

    _GDIPlus_GraphicsFillPolygon($backbuffer, $HourArrow, $hourBrush)
    ;~ _GDIPlus_GraphicsFillEllipse($backbuffer, 115, 115, 10, 10, $hourBrush)

    Local $MinuteArrow[5][2] = [[4, 0], _
    [Int(70 * Sin($minuteAngle)) + 120, Int(-70 * Cos($minuteAngle)) + 120], _
    [Int(-5 * Cos($minuteAngle)) + 120, Int(-5 * Sin($minuteAngle)) + 120], _
    [Int(5 * Cos($minuteAngle)) + 120, Int(5 * Sin($minuteAngle)) + 120], _
    [Int(70 * Sin($minuteAngle)) + 120, Int(-70 * Cos($minuteAngle)) + 120]]

    _GDIPlus_GraphicsFillPolygon($backbuffer, $MinuteArrow, $minuteBrush)
    _GDIPlus_GraphicsFillEllipse($backbuffer, 115, 115, 10, 10, $minuteBrush)

    _GDIPlus_GraphicsDrawLine($backbuffer, 120, 120, Int(70 * Sin($secondAngle)) + 120, _
    Int(-70 * Cos($secondAngle)) + 120, $secondPen)

    _GDIPlus_GraphicsDrawImage($graphics, $bitmap, 0, 0)
    EndFunc

    Func _DrawMyText($text, $x, $y)
    $tLayout = _GDIPlus_RectFCreate($x, $y)
    $aInfo = _GDIPlus_GraphicsMeasureString($backbuffer2, $text, $nuFont, $tLayout, $hFormat)
    _GDIPlus_GraphicsDrawStringEx($backbuffer2, $text, $nuFont, $aInfo[0], $hFormat, $nuBrush)
    EndFunc ;==>_DrawMyText

    Func _DrawMyTime()
    $tLayout = _GDIPlus_RectFCreate(20, 20,0,0)
    $text = @HOUR & ":" & @MIN & ":" & @SEC
    $aInfo = _GDIPlus_GraphicsMeasureString($backbuffer2, $text, $nuFont, $tLayout, $hFormat)
    _GDIPlus_GraphicsDrawString($backbuffer2, $text, $nuFont, $aInfo[0], $hFormat, $nuBrush)
    EndFunc ;==>_DrawMyText

    Func close()
    _GDIPlus_GraphicsDispose($backbuffer2)
    _GDIPlus_BitmapDispose($bitmap2)
    _GDIPlus_PenDispose($secondPen)
    _GDIPlus_BrushDispose($minuteBrush)
    _GDIPlus_BrushDispose($hourBrush)
    _GDIPlus_FontDispose($nuFont)
    _GDIPlus_FontFamilyDispose($hFamily)
    _GDIPlus_StringFormatDispose($hFormat)
    _GDIPlus_BrushDispose($nuBrush)
    _GDIPlus_BrushDispose($irBrush)
    _GDIPlus_BrushDispose($lgBrush)
    _GDIPlus_GraphicsDispose($backbuffer)
    _GDIPlus_BitmapDispose($bitmap)
    _GDIPlus_GraphicsDispose($graphics)
    _GDIPlus_Shutdown()
    Exit
    EndFunc ;==>close

    ;==== GDIPlus_CreateLineBrushFromRect ===
    ;Description - Creates a LinearGradientBrush object from a set of boundary points and boundary colors.
    ; $aFactors - If non-array, default array will be used.
    ; Pointer to an array of real numbers that specify blend factors. Each number in the array
    ; specifies a percentage of the ending color and should be in the range from 0.0 through 1.0.
    ;$aPositions - If non-array, default array will be used.
    ; Pointer to an array of real numbers that specify blend factors' positions. Each number in the array
    ; indicates a percentage of the distance between the starting boundary and the ending boundary
    ; and is in the range from 0.0 through 1.0, where 0.0 indicates the starting boundary of the
    ; gradient and 1.0 indicates the ending boundary. There must be at least two positions
    ; specified: the first position, which is always 0.0, and the last position, which is always
    ; 1.0. Otherwise, the behavior is undefined. A blend position between 0.0 and 1.0 indicates a
    ; line, parallel to the boundary lines, that is a certain fraction of the distance from the
    ; starting boundary to the ending boundary. For example, a blend position of 0.7 indicates
    ; the line that is 70 percent of the distance from the starting boundary to the ending boundary.
    ; The color is constant on lines that are parallel to the boundary lines.
    ; $iArgb1 - First Top color in 0xAARRGGBB format
    ; $iArgb2 - Second color in 0xAARRGGBB format
    ; $LinearGradientMode - LinearGradientModeHorizontal = 0x00000000,
    ; LinearGradientModeVertical = 0x00000001,
    ; LinearGradientModeForwardDiagonal = 0x00000002,
    ; LinearGradientModeBackwardDiagonal = 0x00000003
    ; $WrapMode - WrapModeTile = 0,
    ; WrapModeTileFlipX = 1,
    ; WrapModeTileFlipY = 2,
    ; WrapModeTileFlipXY = 3,
    ; WrapModeClamp = 4
    ; GdipCreateLineBrushFromRect(GDIPCONST GpRectF* rect, ARGB color1, ARGB color2,
    ; LinearGradientMode mode, GpWrapMode wrapMode, GpLineGradient **lineGradient)
    ; Reference: http://msdn.microsoft.com/en-us/library/ms534043(VS.85).aspx
    ;
    Func _GDIPlus_CreateLineBrushFromRect($iX, $iY, $iWidth, $iHeight, $aFactors, $aPositions, _
    $iArgb1 = 0xFF0000FF, $iArgb2 = 0xFFFF0000, $LinearGradientMode = 0x00000001, $WrapMode = 0)

    Local $tRect, $pRect, $aRet, $tFactors, $pFactors, $tPositions, $pPositions, $iCount

    If $iArgb1 = -1 Then $iArgb1 = 0xFF0000FF
    If $iArgb2 = -1 Then $iArgb2 = 0xFFFF0000
    If $LinearGradientMode = -1 Then $LinearGradientMode = 0x00000001
    If $WrapMode = -1 Then $WrapMode = 1

    $tRect = DllStructCreate("float X;float Y;float Width;float Height")
    $pRect = DllStructGetPtr($tRect)
    DllStructSetData($tRect, "X", $iX)
    DllStructSetData($tRect, "Y", $iY)
    DllStructSetData($tRect, "Width", $iWidth)
    DllStructSetData($tRect, "Height", $iHeight)

    ;Note: Withn _GDIPlus_Startup(), $ghGDIPDll is defined
    $aRet = DllCall($ghGDIPDll, "int", "GdipCreateLineBrushFromRect", "ptr", $pRect, "int", $iArgb1, _
    "int", $iArgb2, "int", $LinearGradientMode, "int", $WrapMode, "int*", 0)

    If IsArray($aFactors) = 0 Then Dim $aFactors[4] = [0.0, 0.4, 0.6, 1.0]
    If IsArray($aPositions) = 0 Then Dim $aPositions[4] = [0.0, 0.3, 0.7, 1.0]

    $iCount = UBound($aPositions)
    $tFactors = DllStructCreate("float[" & $iCount & "]")
    $pFactors = DllStructGetPtr($tFactors)
    For $iI = 0 To $iCount - 1
    DllStructSetData($tFactors, 1, $aFactors[$iI], $iI + 1)
    Next
    $tPositions = DllStructCreate("float[" & $iCount & "]")
    $pPositions = DllStructGetPtr($tPositions)
    For $iI = 0 To $iCount - 1
    DllStructSetData($tPositions, 1, $aPositions[$iI], $iI + 1)
    Next

    $hStatus = DllCall($ghGDIPDll, "int", "GdipSetLineBlend", "hwnd", $aRet[6], _
    "ptr", $pFactors, "ptr", $pPositions, "int", $iCount)
    Return $aRet[6]; Handle of Line Brush
    EndFunc ;==>_GDIPlus_CreateLineBrushFromRect

    ; #CURRENT# =====================================================================================================================
    ; _GUICreate_Transparent
    ; ===============================================================================================================================


    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _GUICreate_Transparent
    ; Description ...: Transparente Popup-GUIs aus Bildern (z.B. PNG) erstellen
    ; Syntax.........: _GUICreate_Transparent($sImage, $iLeft = -1, $iTop = -1, $iOpacity = 255)
    ; Parameters ....: $sImage - Pfad zur Bilddatei
    ; $iLeft - Bidschirmposition der linken Seite des GUI in Pixeln
    ; |Default - -1 (zentriert)
    ; $iTop - Bidschirmposition der oberen Seite des GUI in Pixeln
    ; |Default - -1 (zentriert)
    ; $iOpacity - Transparenz für das gesamte GUI (siehe WinSetTrans())
    ; |Default - 255 (nicht transparent)
    ; Return values .: Im Erfolgsfall: HWND des GUI aus GUICreate()
    ; Im Fehlerfall: False, @error wird gesetzt:
    ; |1 = GDIPlus konnte nicht gestartet werden
    ; |2 = Die Bilddatei konnte nicht geladen werden
    ; Author ........: UEZ (http://www.autoit.de/index.php?page…9839#post199839)
    ; Modified.......: Großvater (http://www.autoit.de/)
    ; Remarks .......: Das GUI wird immer in der Originalgröße des Bildes mit dem Style $WS_POPUP und dem
    ; Exstyle $WS_EX_LAYERED erstellt. Der Exstyle $WS_EX_LAYERED verträgt sich offenbar
    ; nicht mit normalen Child-GUIs. Controls müssen deshalb in (einer) eigenen GUI(s)
    ; mit den Exstyles $WS_EX_MDICHILD und $WS_EX_LAYERED und der HWND des Bild-GUI
    ; als Parent erstellt werden. Dafür liefert UEZ im o.a. Thread ein Beispiel.
    ; Related .......:
    ; Link ..........:
    ; Example .......:
    ; ===============================================================================================================================
    Func _GUICreate_Transparent($sImage, $iLeft = -1, $iTop = -1, $iOpacity = 255)
    ; GDIPlus starten
    If NotNot _GDIPlus_Startup() Then Return SetError(1, 0, 0)
    ; Bild laden
    Local $hImage = _GDIPlus_ImageLoadFromFile($sImage)
    If @error Then
    _GDIPlus_Shutdown()
    Return SetError(2, 0, 0)
    EndIf
    Local $iWidth = _GDIPlus_ImageGetWidth($hImage)
    Local $iHeight = _GDIPlus_ImageGetHeight($hImage)
    ; GUI erstellen
    Local $hGUI = GUICreate("", $iWidth, $iHeight, $iLeft, $iTop, $WS_POPUP, $WS_EX_LAYERED)
    Local $hDCDst = _WinAPI_GetDC($hGUI)
    Local $hDCSrc = _WinAPI_CreateCompatibleDC($hDCDst)
    Local $hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage)
    _WinAPI_SelectObject($hDCSrc, $hBitmap)
    Local $tSize = DllStructCreate($tagSIZE)
    Local $pSize = DllStructGetPtr($tSize)
    DllStructSetData($tSize, "X", $iWidth)
    DllStructSetData($tSize, "Y", $iHeight)
    Local $tSource = DllStructCreate($tagPOINT)
    Local $pSource = DllStructGetPtr($tSource)
    Local $tBlend = DllStructCreate($tagBLENDFUNCTION)
    Local $pBlend = DllStructGetPtr($tBlend)
    DllStructSetData($tBlend, "Alpha", $iOpacity)
    DllStructSetData($tBlend, "Format", 1)
    _WinAPI_UpdateLayeredWindow($hGUI, $hDCDst, 0, $pSize, $hDCSrc, $pSource, 0, $pBlend, $ULW_ALPHA)
    ; Ressourcen freigeben
    _GDIPlus_ImageDispose($hImage)
    _WinAPI_DeleteObject($hBitmap)
    _WinAPI_DeleteDC($hDCSrc)
    _WinAPI_ReleaseDC($hGUI, $hDCDst)
    _GDIPlus_Shutdown()
    ; HWND des GUI zurückgeben
    Return $hGUI
    EndFunc ;==>_GUICreate_Transparent

  • _GUICtrlListView_SetBkImage - Hintergrundbild wird mitgescrollt

    • fschaef
    • 18. Juni 2010 um 10:54

    Bei mir verschwindet tdas Bild nach oben beim scrollen resp. erscheint wieder in der Gegenrichtung.

    Win XP Home 32-bit SP3.

  • Probleme mit Includes

    • fschaef
    • 18. Juni 2010 um 10:49

    Im Scite im Menü Tools organizeincludes auswählen. Dann im erscheinenden Fenster auf Organisize includes, danach auf Restart klicken.

  • Wie erstelle ich aus Excel Sheets pdf-Dateien?

    • fschaef
    • 18. Juni 2010 um 10:39
    Zitat von BugFix

    Nutze PDFCreator, der verfügt über eine COM-Schnittstelle und eine entsprechende AutoIt-UDF zu deren Anwendung hatte ich auch schon mal gesehen (such mal hier oder im EN-Forum).
    Damit solltest du keine Probleme haben.
    Alternativ kannst du natürlich auch OpenOfficeOrg verwenden und von dort dein Excel-Dokument direkt als PDF ausgeben. Mit ca. 90% der Exceldokumente sollte das problemlos möglich sein. Nur wenn umfangreiche Formeln im Einsatz sind, ist eine direkte Umsetzung teils nicht möglich.

    Zitat von Buddha

    Hallo zusammen,

    wie erstelle ich mit AutoIt am besten aus mehreren Exceldateien mit jeweils mehreren Sheets aus jedem Sheet einen einzelne pdf-Datei?

    Mein erster Ansatz war über ausdrucken mit pdf-Drucker. Jedoch blieb das Script nach dem ersten ausdruck hängen. Problem war: Es sprang nicht zurück zum ExcelBook.

    Für Tips und Denksnstösse bin ich sehr dankbar.

    Gruß Buddha

    Zitat von Buddha

    Hallo zusammen,

    Zitat von Buddha

    wie erstelle ich mit AutoIt am besten aus mehreren Exceldateien mit jeweils mehreren Sheets aus jedem Sheet einen einzelne pdf-Datei?

    Zitat von Buddha

    Mein erster Ansatz war über ausdrucken mit pdf-Drucker. Jedoch blieb das Script nach dem ersten ausdruck hängen. Problem war: Es sprang nicht zurück zum ExcelBook.

    Zitat von Buddha

    Für Tips und Denksnstösse bin ich sehr dankbar.

    Zitat von Buddha

    Gruß Buddha

    Irgendwas ist da schiefgelaufen.

    PDF Creator, genau.

  • Listbox mit Hintergrundbild

    • fschaef
    • 17. Juni 2010 um 10:40

    Hallo,

    sorry wenn ich hier ein bestimmt steinzeitaltes Thema berühre, aber die Suche war nicht ergiebig genug.

    Aufgabenstellung: Ich möchte eine Listbox mit einem Hintergrunbild versehen.
    Irgendjemand ne Idee, Lösung, Link usw.

    Danke im voraus.

  • _GUICtrlListView_SetBkImage löscht meine Bilder

    • fschaef
    • 17. Juni 2010 um 09:08
    Zitat von t002

    Aus purer Neugier: funktioniert es jetzt wirklich?

    Eigentlich dürfte es nur so

    [autoit]

    _GUICtrlListView_Create($GUI, "", 2, 2, 594, 268, -1, -1, True) ;; Der letzte Parameter führt zum Aufruf von CoInitializeEx

    [/autoit]

    gehen?

    mfg

    Ja, es funzt & wie ... :P

  • _GUICtrlListView_SetBkImage löscht meine Bilder

    • fschaef
    • 16. Juni 2010 um 15:24
    Zitat von Sprenger120

    Der Link zum Bild funzt nicht aber ich habe deinen Code mal etwas aufgebessert

    Spoiler anzeigen
    [autoit]


    #AutoIt3Wrapper_au3check_parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6

    [/autoit] [autoit][/autoit] [autoit]

    #include
    #include
    #include
    #include
    #include
    #include

    [/autoit] [autoit][/autoit] [autoit]

    #include
    #include
    #include
    #include
    #include
    #include
    #include
    #include
    #include
    #include
    #include
    #include

    [/autoit] [autoit][/autoit] [autoit]

    ;~ Opt('MustDeclareVars', 1)

    [/autoit] [autoit][/autoit] [autoit]

    $Debug_LV = False ; Check ClassName being passed to ListView functions, set to True and use a handle to another control to see it work
    Global $zip[6] = ["76646", "71032", "66403", "76227", "67065", "11083"]
    Global $hListView = ""
    ;~ _Main()

    [/autoit] [autoit][/autoit] [autoit]

    ;~ Func _Main()
    Global $hImage,$GUI,$sFilePath,$iResult

    [/autoit] [autoit][/autoit] [autoit]

    $GUI = GUICreate("Arbeitsplatz-Wetter-Info", 600, 300)
    ; $pic = GUICtrlCreatePic("msde10081077bd1.jpg",2,2,588,298)
    ;$hListView = GUICtrlCreateListView("", 2, 2, 594, 268)
    $hListView = _GUICtrlListView_Create($GUI, "", 2, 2, 594, 268)
    _GUICtrlListView_SetExtendedListViewStyle($hListView, BitOR($LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT, $LVS_EX_SUBITEMIMAGES))

    [/autoit] [autoit][/autoit] [autoit]

    $sFilePath = @ScriptDir & "\wetterhahn.jpg"

    [/autoit] [autoit][/autoit] [autoit]

    ; Set the Background Image
    _GUICtrlListView_SetBkImage($hListView, $sFilePath)
    GUISetState()

    [/autoit] [autoit][/autoit] [autoit]

    ; Load images
    $hImage = _GUIImageList_Create()
    _GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 110)
    _GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 131)
    _GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 165)
    _GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 168)
    _GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 137)
    _GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 146)

    [/autoit] [autoit][/autoit] [autoit]

    _GUICtrlListView_SetImageList($hListView, $hImage, 1)

    [/autoit] [autoit][/autoit] [autoit]

    ; Add columns
    _GUICtrlListView_AddColumn($hListView, "Aktuell", 200)
    _GUICtrlListView_AddColumn($hListView, "Grad", 50)
    _GUICtrlListView_AddColumn($hListView, "Wind", 150)
    _GUICtrlListView_AddColumn($hListView, "Feuchtigkeit", 150)

    [/autoit] [autoit][/autoit] [autoit]

    Display_Data()
    AdlibRegister("Display_Data", 60000)

    [/autoit] [autoit][/autoit] [autoit]

    ; Loop until user exits
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE
    ;~ GUIDelete()
    ;~ EndFunc ;==>_Main

    [/autoit] [autoit][/autoit] [autoit]

    Func CheckINet()
    #cs
    local $sIp

    [/autoit] [autoit][/autoit] [autoit]

    TCPStartup()
    $sIp = TCPNameToIP("www.google.de")
    ;MsgBox(64, "sIP", $sIp & " ! " & @error)
    TCPShutdown()
    Return @error
    #ce

    [/autoit] [autoit][/autoit] [autoit]

    #cs
    $iResult = Ping("www.google.de")
    Switch @error
    Case 0
    return 0
    Case 1
    return -1
    Case 2
    return -1
    Case 3
    return -1
    Case 4
    return -1
    EndSwitch
    return @error

    [/autoit] [autoit][/autoit] [autoit]

    #ce ----> Das Geht auch kürzer

    [/autoit] [autoit][/autoit] [autoit]

    $iResult = Ping("www.google.de")
    If Not @error And Not $iResult Then
    Return 0
    Else
    Return -1
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    EndFunc ;==>CheckINet

    [/autoit] [autoit][/autoit] [autoit]

    Func _getXML_Weather_data($pcode)
    Local $Api, $XML_Source, $Rc, $City, $Wstatus, $Temp, $Wind, $Humidity
    $Api = "http://www.google.com/ig/api?weather=" & $pcode & ',Germany&hl=de'
    $XML_Source = _INetGetSource($Api)
    $Rc = _StringBetween($XML_Source, '')

    [/autoit] [autoit][/autoit] [autoit]

    If $Rc <> "" Then

    [/autoit] [autoit][/autoit] [autoit]

    Local $Sonst[5] = ["ist nicht gültig", "N/A", "N/A", "N/A", "N/A"]
    Local $MyWeather[5] = [$Sonst[0], $Sonst[1], $Sonst[2] & " °C", $Sonst[3], $Sonst[4]]
    Else
    $City = _StringBetween($XML_Source, '')
    $Wstatus = _StringBetween($XML_Source, '')
    $Temp = _StringBetween($XML_Source, '')
    $Wind = _StringBetween($XML_Source, '')
    $Humidity = _StringBetween($XML_Source, '')
    ;Return
    Local $MyWeather[5] = [$City[0], $Wstatus[0], $Temp[0] & " °C", $Wind[0], $Humidity[0]]
    EndIf
    Return $MyWeather
    EndFunc ;==>_getXML_Weather_data

    [/autoit] [autoit][/autoit] [autoit]

    Func Display_Data()
    ;- msgbox(64,"Display_Ddata","Display_Data" & @CRLF & "Handle: " & $hListView,1)
    Local $wetter[5]
    ; global $hListView
    _GUICtrlListView_BeginUpdate($hListView)
    _GUICtrlListView_EnableGroupView($hListView)
    _GUICtrlListView_DeleteAllItems($hListView)

    [/autoit] [autoit][/autoit] [autoit]

    if (CheckINet()) Then
    ; Keine aktive Internetverbindung
    _GUICtrlListView_AddItem($hListView, "Keine Internetverbindung", 0)
    Else

    [/autoit] [autoit][/autoit] [autoit]

    For $x = 0 To UBound($zip) - 1
    ; get data from inet
    $wetter = _getXML_Weather_data($zip[$x])

    [/autoit] [autoit][/autoit] [autoit]

    ; Add items
    _GUICtrlListView_AddItem($hListView, $wetter[1])
    _GUICtrlListView_InsertGroup($hListView, -1, $x, $zip[$x] & " " & $wetter[0])
    _GUICtrlListView_AddSubItem($hListView, $x, $wetter[2], 1, 1)
    _GUICtrlListView_AddSubItem($hListView, $x, $wetter[3], 2)
    _GUICtrlListView_AddSubItem($hListView, $x, $wetter[4], 3, 4)

    [/autoit] [autoit][/autoit] [autoit]

    _GUICtrlListView_SetItemGroupID($hListView, $x, $x)

    [/autoit] [autoit][/autoit] [autoit]

    Next
    _GUICtrlListView_EndUpdate($hListView)

    [/autoit] [autoit][/autoit] [autoit]

    EndIf
    EndFunc ;==>Display_Data

    [/autoit]

    </problem_cause>

    Alles anzeigen


    Ja, das mit dem Bild habe ich auch schon gemerkt.

    Danke für Deine Überarbeitung, stimmt, ist einfacher.


    EDIT: Kann als gelöst betrachtet werden, lesen & kopieren müßte man können, dann ist man eindeutig im Vorteil.

  • _GUICtrlListView_SetBkImage löscht meine Bilder

    • fschaef
    • 16. Juni 2010 um 14:27

    Hallo Alle,
    _GUICtrlListView_SetBkImage($hListView,$sFilePath)
    $aImage=_GUICtrlListView_GetBkImage($hListView)
    löschen die Bilder im angegebenen Ordner. Hat das jemand auch schon mal erlebt?

    Mein eigentliches Problem ist, das ich in einem Listview einen eigenen Hintergrund haben möchte. (Bild)

    Ich füge mal mein Script ein.

    Spoiler anzeigen
    [autoit]


    #AutoIt3Wrapper_au3check_parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6

    [/autoit] [autoit][/autoit] [autoit]

    #include <GUIConstantsEx.au3>
    #include <GuiImageList.au3>
    #include <GuiListView.au3>
    #include <Inet.au3>
    #include <ListViewConstants.au3>
    #include <String.au3>

    [/autoit] [autoit][/autoit] [autoit]

    #include <GuiConstantsEx.au3>
    #include <GuiListView.au3>
    #include <GuiImageList.au3>
    #include <string.au3>
    #include <inet.au3>
    #include <ListViewConstants.au3>
    #include <GuiListView.au3>
    #include <GUIConstantsEx.au3>
    #include <String.au3>
    #include <GuiConstantsEx.au3>
    #include <GuiListView.au3>
    #include <GuiImageList.au3>

    [/autoit] [autoit][/autoit] [autoit]

    Opt('MustDeclareVars', 1)

    [/autoit] [autoit][/autoit] [autoit]

    $Debug_LV = False ; Check ClassName being passed to ListView functions, set to True and use a handle to another control to see it work
    global $zip[6] = ["76646","71032","66403","76227","67065","11083"]
    global $hListView = ""
    _Main()

    [/autoit] [autoit][/autoit] [autoit]

    Func _Main()
    Local $hImage

    [/autoit] [autoit][/autoit] [autoit]

    $GUI = GUICreate("Arbeitsplatz-Wetter-Info", 600, 300)
    ; $pic = GUICtrlCreatePic("msde10081077bd1.jpg",2,2,588,298)
    ;$hListView = GUICtrlCreateListView("", 2, 2, 594, 268)
    $hListView = _GUICtrlListView_Create($GUI, "", 2, 2, 594, 268)
    _GUICtrlListView_SetExtendedListViewStyle($hListView, BitOR($LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT, $LVS_EX_SUBITEMIMAGES))

    [/autoit] [autoit][/autoit] [autoit]

    $sFilePath = @ScriptDir & "\wetterhahn.jpg"

    [/autoit] [autoit][/autoit] [autoit]

    ; Set the Background Image
    _GUICtrlListView_SetBkImage($hListView, $sFilePath)
    GUISetState()

    [/autoit] [autoit][/autoit] [autoit]

    ; Load images
    $hImage = _GUIImageList_Create()
    _GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 110)
    _GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 131)
    _GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 165)
    _GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 168)
    _GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 137)
    _GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 146)

    [/autoit] [autoit][/autoit] [autoit]

    _GUICtrlListView_SetImageList($hListView, $hImage, 1)

    [/autoit] [autoit][/autoit] [autoit]

    ; Add columns
    _GUICtrlListView_AddColumn($hListView, "Aktuell", 200)
    _GUICtrlListView_AddColumn($hListView, "Grad", 50)
    _GUICtrlListView_AddColumn($hListView, "Wind", 150)
    _GUICtrlListView_AddColumn($hListView, "Feuchtigkeit", 150)

    [/autoit] [autoit][/autoit] [autoit]

    Display_Data()
    AdlibRegister("Display_Data", 60000)

    [/autoit] [autoit][/autoit] [autoit]

    ; Loop until user exits
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE
    GUIDelete()
    EndFunc ;==>_Main

    [/autoit] [autoit][/autoit] [autoit]

    Func CheckINet()
    #cs
    local $sIp

    [/autoit] [autoit][/autoit] [autoit]

    TCPStartup()
    $sIp = TCPNameToIP("www.google.de")
    ;MsgBox(64, "sIP", $sIp & " ! " & @error)
    TCPShutdown()
    Return @error
    #ce

    [/autoit] [autoit][/autoit] [autoit]

    $iResult = Ping("www.google.de")
    Switch @error
    Case 0
    return 0
    Case 1
    return -1
    Case 2
    return -1
    Case 3
    return -1
    Case 4
    return -1
    EndSwitch
    return @error
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _getXML_Weather_data($pcode)
    Local $Api, $XML_Source, $Rc, $City, $Wstatus, $Temp, $Wind, $Humidity
    $Api = "http://www.google.com/ig/api?weather=" & $pcode & ',Germany&hl=de'
    $XML_Source = _INetGetSource($Api)
    $Rc = _StringBetween($XML_Source, '<problem_cause data="', '"/>')

    [/autoit] [autoit][/autoit] [autoit]

    if $Rc <> "" Then

    [/autoit] [autoit][/autoit] [autoit]

    Local $Sonst[5] = ["ist nicht gültig", "N/A", "N/A", "N/A", "N/A"]
    Local $MyWeather[5] = [$Sonst[0], $Sonst[1], $Sonst[2] & " °C", $Sonst[3], $Sonst[4]]
    Else
    $City = _StringBetween($XML_Source, '<city data="', '"/>')
    $Wstatus = _StringBetween($XML_Source, '<condition data="', '"/>')
    $Temp = _StringBetween($XML_Source, '<temp_c data="', '"/>')
    $Wind = _StringBetween($XML_Source, '<wind_condition data="', '"/>')
    $Humidity = _StringBetween($XML_Source, '<humidity data="', '"/>')
    ;Return
    Local $MyWeather[5] = [$City[0], $Wstatus[0], $Temp[0] & " °C", $Wind[0], $Humidity[0]]
    endif
    Return $MyWeather
    EndFunc ;==>_getXML_Weather_data

    [/autoit] [autoit][/autoit] [autoit]

    Func Display_Data()
    ;- msgbox(64,"Display_Ddata","Display_Data" & @CRLF & "Handle: " & $hListView,1)
    local $wetter[5]
    ; global $hListView
    _GUICtrlListView_BeginUpdate($hListView)
    _GUICtrlListView_EnableGroupView($hListView)
    _GUICtrlListView_DeleteAllItems($hListView)

    [/autoit] [autoit][/autoit] [autoit]

    if (CheckINet()) Then
    ; Keine aktive Internetverbindung
    _GUICtrlListView_AddItem($hListView, "Keine Internetverbindung", 0)
    Else

    [/autoit] [autoit][/autoit] [autoit]

    for $x = 0 to UBound($zip)-1
    ; get data from inet
    $wetter = _getXML_Weather_data($zip[$x])

    [/autoit] [autoit][/autoit] [autoit]

    ; Add items
    _GUICtrlListView_AddItem($hListView, $wetter[1])
    _GUICtrlListView_InsertGroup($hListView, -1, $x, $zip[$x] & " " & $wetter[0])
    _GUICtrlListView_AddSubItem($hListView, $x, $wetter[2], 1, 1)
    _GUICtrlListView_AddSubItem($hListView, $x, $wetter[3], 2)
    _GUICtrlListView_AddSubItem($hListView, $x, $wetter[4], 3, 4)

    [/autoit] [autoit][/autoit] [autoit]

    _GUICtrlListView_SetItemGroupID($hListView, $x, $x)

    [/autoit] [autoit][/autoit] [autoit]

    Next
    _GUICtrlListView_EndUpdate($hListView)

    [/autoit] [autoit][/autoit] [autoit]

    EndIf
    EndFunc

    [/autoit]

    Und hier das Bild.

  • Splash Ladebildschirm (ähnlich wie bei Office 2010)

    • fschaef
    • 14. Juni 2010 um 16:41
    Zitat von Ubuntu

    Ich hab xp 32 Bit und s.o. (wobei der Fehler nichts mit Flashplayern zu tun hat )

    mfg Ubuntu

    Zitat von GtaSpider

    Heyho,

    Ich habe ein UDF geschrieben, mit dem man grafisch relativ aufwendig ein Ladebildschirm für das eigene Programm entwickeln kann.
    Hier mal ein Beispiel:

    Spoiler anzeigen
    [autoit]

    #include "ModernSplash.au3"

    [/autoit] [autoit][/autoit] [autoit]

    ; $sTitle, $sBuild = "", $bProgress = False, $sCallBack_Exit = "", $iCorners = 20, $sMovieFile = "", $sFont = "Arial"
    _ModernSplash_Create( "ModernSplash", "v1.1 ("&FileGetTime(@ScriptFullPath,0,1)&")", True, "_exit", 20);Warning, changed now...

    [/autoit] [autoit][/autoit] [autoit]

    _ModernSplash_Initiate("Load...");First initiate. Stat with Text: "Load..."

    [/autoit] [autoit][/autoit] [autoit]

    ;Progress Marquee. As higher the number (10) as slower the marquee!
    _ModernSplash_ProgressMarquee(10)
    _ModernSplash_TextNext("Loading resources...")
    Sleep(100);do smth
    _ModernSplash_TextNext("This is a quite long text to test how quite long textes looks like on this splash and i think it looks quite nice, doesn't it?")
    Sleep(500);do smth
    _ModernSplash_TextNext("Max rox!")
    MsgBox(0,"","You can try to exit the Splash by clicking on the X on the right or push esc"&@CRLF&"It will close then after this messagebox dissappears")

    [/autoit] [autoit][/autoit] [autoit]

    ;Stop Marquee
    _ModernSplash_ProgressMarquee(False)
    $ms = 0
    For $i = 1 To 10
    _ModernSplash_TextChange("Ping Google"&@CRLF&$i&"/10");Update text without animation
    $ms += Ping("www.google.de")
    _ModernSplash_ProgressUpdate($i*10);Update Progress
    If $i = 6 Then
    _ModernSplash_ProgressColor(3);Make Progress Yellow (only vista/server08 or higher)
    MsgBox(0,"","Yellow Progress Color")
    EndIf
    If $i = 9 Then _ModernSplash_ProgressColor(1);Reset Progress to green
    Sleep(200)
    Next
    _ModernSplash_ProgressColor(2);Make Progess Red (only vista/server08 or higher)
    _ModernSplash_TextNext("Roundtrip: "&Round($ms/10)&"ms")
    Sleep(500)
    _ModernSplash_TextNext("Mesagebox")
    MsgBox(0,"","Click ok to continue or watch this beautiful animation. Hope you have enough time, its endless ;-)")
    _ModernSplash_DeInitiate()
    MsgBox(0,"","Programm succesfull loaded :)")
    Func _exit()
    MsgBox(0,"","You abborted loading...script exit now!")
    Exit
    EndFunc

    [/autoit]

    Und hier ein Video (denn Bilder sagen mehr als 1000 Worte ;) )
    http://www.youtube.com/watch?v=ASbejjkB_cI

    Download Version 1.2
    Die Datei gibt es auf http://www.maxreble.de/autoit.html oder HIER DIREKT zu laden
    Changelog

    Achja, das Script steht unter der CreativeCommon Lizenz:
    http://creativecommons.org/licenses/by/3.0/de/

    Gruß
    Spider

    Alles anzeigen


    Geile Sache, Dein LB, aber ich kann ihn nur 1 Mal aufrufen, danach bricht Autoit mit irgendeinem Flash-Fehler ab, ich glaube es wäre besser, eine Version ohne Flash oder per GDI zu machen . Trotzdem super, echt! :D :thumbup: :D

  • Desktop Wetter

    • fschaef
    • 14. Juni 2010 um 14:02
    Zitat von tuttifrutti

    Neues Design ist fertig !

    Bitte auf Feedback & bugs ! :)

    Siehe 1# Post Download


    Super, aber PLZ wird mit falschem Ort wiedergegeben. Bsp. 67065 kommt als Isabel, KS; ist aber Ludwigshafen ?( :thumbup:

  • Script-Fehlermeldung: Hilfe, sehe den Wald vor lauter Bäumen nicht mehr ...

    • fschaef
    • 10. Juni 2010 um 09:16
    Zitat von m-obi

    Achja ich würde die Schleife so machen.

    Spoiler anzeigen
    [autoit]

    _GUICtrlListView_BeginUpdate($listview)
    for $i = 1 to $swds[0]

    [/autoit] [autoit][/autoit] [autoit]

    $hProgress[$i - 1] = _ListView_InsertProgressBar($ListView, $i - 1, 8)
    _Progress_SetPos($hProgress[$i - 1], Random(1, 50, 1)) ; zum Testen
    $helparray = DirGetSize($swds[$i] , 1)

    [/autoit] [autoit][/autoit] [autoit]

    ;_ArrayDisplay($helparray, "Directories:")
    $item2=GUICtrlCreateListViewItem(StringReplace($swds[$i], "\", "|"), $listview)
    If $helparray[2] = 0 Then
    GUICtrlSetColor($item2, 0x007000)
    GUICtrlSetData($item2, "||||||-->|bereit zum installieren")
    Else
    GUICtrlSetColor($item2, 0xEE9999)
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    Next
    _GUICtrlListView_EndUpdate($listview)

    [/autoit]
    Alles anzeigen


    Super, ne Ahnung, warum die Progressbars so planlos herumhängen und nicht in der 8. Spalte (Status)?

  • Script-Fehlermeldung: Hilfe, sehe den Wald vor lauter Bäumen nicht mehr ...

    • fschaef
    • 9. Juni 2010 um 23:12
    Zitat von L3viathan

    @SW_HIDE und SHOW statt $SW_HIDE, ...


    Ich sags ja, der Wald mit den vielen Bäumen, ich danke Dir.

  • Script-Fehlermeldung: Hilfe, sehe den Wald vor lauter Bäumen nicht mehr ...

    • fschaef
    • 9. Juni 2010 um 22:52

    Hallo & guten Abend,
    ich habe ein Autoit-Skript, welches mir folgende Fehlermeldung bringt:

    >"C:\Programme\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "C:\Programme\AutoIt3\Examples\xxx1.au3" /autoit3dir "C:\Programme\AutoIt3" /UserParams
    +>22:37:01 Starting AutoIt3Wrapper v.2.0.1.24 Environment(Language:0407 Keyboard:00000407 OS:WIN_XP/Service Pack 3 CPU:X64 OS:X86)
    >Running AU3Check (1.54.19.0) from:C:\Programme\AutoIt3
    C:\Programme\AutoIt3\Examples\xxx1.au3(204,42) : WARNING: $SW_HIDE: possibly used before declaration.
    _WinAPI_ShowWindow($hProgress, $SW_HIDE)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
    C:\Programme\AutoIt3\Examples\xxx1.au3(206,42) : WARNING: $SW_SHOW: possibly used before declaration.
    _WinAPI_ShowWindow($hProgress, $SW_SHOW)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
    C:\Programme\AutoIt3\Examples\xxx1.au3(204,42) : ERROR: $SW_HIDE: undeclared global variable.
    _WinAPI_ShowWindow($hProgress, $SW_HIDE)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
    C:\Programme\AutoIt3\Examples\xxx1.au3 - 1 error(s), 2 warning(s)
    !>22:37:01 AU3Check ended.rc:2
    >Running:(3.3.6.1):C:\Programme\AutoIt3\autoit3.exe "C:\Programme\AutoIt3\Examples\xxx1.au3"
    +>22:37:24 AutoIT3.exe ended.rc:0
    >Exit code: 0 Time: 24.881

    Das deutet für mich darauf hin, daß ein INCLUDE fehlt, aber meiner Meinung nach ist dieser drin. Werde ich etwa (berufs)blind? :D

    Ich füge mal das Script ein, vllt. ist ja einer oder mehrere so nett und schauem Mal nach, Danke im voraus.

    [autoit]


    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <GuiStatusBar.au3>
    #include <ListViewConstants.au3>
    #include <WindowsConstants.au3>
    #include <GuiButton.au3>
    #include <GuiListView.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <ComboConstants.au3>
    #include <File.au3>
    #include <Misc.au3>
    #include <Constants.au3>
    #include <ProgressConstants.au3>
    #include <HeaderConstants.au3>
    #include <WinAPI.au3>
    #include <IE.au3>
    #include <String.au3>

    [/autoit][autoit][/autoit][autoit]

    GUICreate("listview items",920,260, 100,200,-1)
    ;GUISetBkColor (0x00E0FFFF)
    local $hProgress[200]
    Local $aProgress[100][100]

    [/autoit][autoit][/autoit][autoit]

    $swds = _RecursiveFileListToArray("c:\xpcd\software", "", 2, 1, @CRLF)

    [/autoit][autoit][/autoit][autoit]

    $listview = GUICtrlCreateListView ("col1 |col2|col3 | col4|col5|col6|col7|col8|Status", 10, 10, 850, 250)
    GUICtrlSetColor(-1, 0x0000A0)
    ;GUICtrlSetBkColor(-1, 0xBBCCEE)
    ;$button = GUICtrlCreateButton ("bCol Item2", 75, 170, 70, 20)
    ; $item1=GUICtrlCreateListViewItem("item1|col12|col13", $listview)
    ;GUICtrlSetColor(-1, 0x007000)
    ;GUICtrlSetBkColor(-1, 0xEE9999)
    GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 20)
    GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 100)
    GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 2, 100)
    GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 3, 100)
    GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 4, 100)
    GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 5, 100)
    GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 6, 30)
    GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 7, 100)
    GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 8, 100)
    _GUICtrlListView_BeginUpdate($listview)
    for $i = 1 to UBound($swds)-1

    [/autoit][autoit][/autoit][autoit]

    $hProgress[$i] = _ListView_InsertProgressBar($ListView, $i, 9)

    [/autoit][autoit][/autoit][autoit]

    $helparray = DirGetSize ( $swds[$i] , 1 )

    [/autoit][autoit][/autoit][autoit]

    ;_ArrayDisplay($helparray, "Directories:")
    $item2=GUICtrlCreateListViewItem(StringReplace($swds[$i], "\", "|"), $listview)
    If $helparray[2] = 0 Then
    GUICtrlSetColor($item2, 0x007000)
    GUICtrlSetData($item2, "||||||-->|bereit zum installieren")
    Else
    GUICtrlSetColor($item2, 0xEE9999)
    EndIf

    [/autoit][autoit][/autoit][autoit]

    Next
    _GUICtrlListView_EndUpdate($listview)

    [/autoit][autoit][/autoit][autoit]

    GUISetState()

    [/autoit][autoit][/autoit][autoit][/autoit][autoit][/autoit][autoit]

    Do
    $msg = GUIGetMsg ()

    [/autoit][autoit][/autoit][autoit]

    Select
    ; Case $msg = $button
    ;~ MsgBox(0, "listview item", GUICtrlRead(GUICtrlRead($listview)), 2)
    ; GUICtrlSetBkColor($item2, 0x00008B)
    Case $msg = $listview
    MsgBox(0, "listview", "clicked=" & GUICtrlGetState($listview), 2)
    EndSelect
    Until $msg = $GUI_EVENT_CLOSE

    [/autoit][autoit][/autoit][autoit][/autoit][autoit]

    ;===============================================================================
    ; Function Name: _RecursiveFileListToArray($sPath, $sPattern, $iFlag = 0, $iFormat = 1, $sDelim = @CRLF)
    ; Description:: gibt Verzeichnisse und/oder Dateien (rekursiv) zurück, die
    ; einem RegExp-Pattern entsprechen
    ; Parameter(s): $sPath = Startverzeichnis
    ; $sPattern = ein beliebiges RexExp-Pattern für die Auswahl
    ; $iFlag = Auswahl
    ; 0 = Dateien & Verzeichnisse
    ; 1 = nur Dateien
    ; 2 = nur Verzeichnisse
    ; $iFormat = Rückgabeformat
    ; 0 = String
    ; 1 = Array mit [0] = Anzahl
    ; 2 = Nullbasiertes Array
    ; $sDelim = Trennzeichen für die String-Rückgabe
    ; Requirement(s): AutoIt 3.3.0.0
    ; Return Value(s): Array/String mit den gefundenen Dateien/Verzeichnissen
    ; Author(s): Oscar (http://www.autoit.de)
    ; Anregungen von: bernd670 (http://www.autoit.de)
    ;===============================================================================
    Func _RecursiveFileListToArray($sPath, $sPattern, $iFlag = 0, $iFormat = 1, $sDelim = @CRLF)
    Local $hSearch, $sFile, $sReturn = ''
    If StringRight($sPath, 1) <> '\' Then $sPath &= '\'
    $hSearch = FileFindFirstFile($sPath & '*.*')
    If @error Or $hSearch = -1 Then Return SetError(0, 0, $sReturn)
    While True
    $sFile = FileFindNextFile($hSearch)
    If @error Then ExitLoop
    If StringInStr(FileGetAttrib($sPath & $sFile), 'D') Then
    If StringRegExp($sPath & $sFile, $sPattern) And ($iFlag = 0 Or $iFlag = 2) Then $sReturn &= $sPath & $sFile & '\' & $sDelim
    $sReturn &= _RecursiveFileListToArray($sPath & $sFile & '\', $sPattern, $iFlag, 0)
    ContinueLoop
    EndIf
    If StringRegExp($sFile, $sPattern) And ($iFlag = 0 Or $iFlag = 1) Then $sReturn &= $sPath & $sFile & $sDelim
    WEnd
    FileClose($hSearch)
    If $iFormat Then Return StringSplit(StringTrimRight($sReturn, StringLen($sDelim)), $sDelim, $iFormat)
    Return $sReturn
    EndFunc

    [/autoit][autoit][/autoit][autoit][/autoit][autoit]

    ; #FUNCTION# ======================================================================================
    ; Function Name: _ListView_InsertProgressBar()
    ; Description: Inserts a progressbar control in the ListView control.
    ; Syntax.........: _ListView_InsertProgressBar($sHwnd, $sItemIndex[, $sSubItemIndex])
    ; Parameter(s): $sHwnd - Handle to the ListView control.
    ; $sItemIndex - Zero based index of the item at which the progressbar should be inserted.
    ; $sSubItemIndex - [Optional] One based index of the subitem where progressbar should be placed, default is 1.
    ;
    ; Return Value(s): Returns the identifier (controlID) of the new progressbar control.
    ; Requirement(s): AutoIt 3.2.10.0 and above
    ; Note(s): Optimal amount of progressbar controls is 5-10. Don`t abuse with many amount of progressbar controls.
    ;
    ; Author(s): R.Gilman (a.k.a rasim), arcker
    ;==================================================================================================
    Func _ListView_InsertProgressBar($sHwnd, $sItemIndex, $sSubItemIndex = 0)
    If Not IsHWnd($sHwnd) Then $sHwnd = GUICtrlGetHandle($sHwnd)

    [/autoit][autoit][/autoit][autoit]

    Local $iStyle = _WinAPI_GetWindowLong($sHwnd, $GWL_STYLE)

    [/autoit][autoit][/autoit][autoit]

    If BitAND($iStyle, $WS_CLIPCHILDREN) <> $WS_CLIPCHILDREN Then
    _WinAPI_SetWindowLong($sHwnd, $GWL_STYLE, BitOR($iStyle, $WS_CLIPCHILDREN))
    EndIf

    [/autoit][autoit][/autoit][autoit]

    Local $aRect

    [/autoit][autoit][/autoit][autoit]

    If $sSubItemIndex = 0 Then
    $aRect = _GUICtrlListView_GetItemRect($sHwnd, $sItemIndex, 2)
    Else
    $aRect = _GUICtrlListView_GetSubItemRect($sHwnd, $sItemIndex, $sSubItemIndex)
    EndIf

    [/autoit][autoit][/autoit][autoit]

    $aProgress[0][0] += 1
    ReDim $aProgress[$aProgress[0][0] + 1][4]
    $aProgress[$aProgress[0][0]][0] = _Progress_Create($sHwnd, $aRect[0], $aRect[1], $aRect[2] - $aRect[0], $aRect[3] - $aRect[1])

    [/autoit][autoit][/autoit][autoit]

    $aProgress[$aProgress[0][0]][1] = $sItemIndex
    $aProgress[$aProgress[0][0]][2] = $sSubItemIndex
    $aProgress[$aProgress[0][0]][3] = $sHwnd

    [/autoit][autoit][/autoit][autoit]

    Return $aProgress[$aProgress[0][0]][0]
    EndFunc ;==>

    [/autoit][autoit][/autoit][autoit]

    Func _Progress_Create($hWnd, $iX, $iY, $iWidth = -1, $iHeight = -1, $iStyle = 0, $iExStyle = 0)
    $iStyle = BitOR($iStyle, $WS_CHILD, $WS_VISIBLE)
    Return _WinAPI_CreateWindowEx($iExStyle, "msctls_progress32", "", $iStyle, $iX, $iY, $iWidth, $iHeight, $hWnd)
    EndFunc ;==>_Progress_Create

    [/autoit][autoit][/autoit][autoit]

    Func _ListView_Notify($hWnd, $Msg, $wParam, $lParam)
    If $Msg = $WM_SIZE Then
    _WinAPI_InvalidateRect($hWnd)
    Return $GUI_RUNDEFMSG
    EndIf

    [/autoit][autoit][/autoit][autoit]

    Local $tNMHEADER, $hWndFrom, $iCode, $i

    [/autoit][autoit][/autoit][autoit]

    $tNMHEADER = DllStructCreate($tagNMHEADER, $lParam)
    $hWndFrom = DllStructGetData($tNMHEADER, "hwndFrom")
    $iCode = DllStructGetData($tNMHEADER, "Code")

    [/autoit][autoit][/autoit][autoit]

    Switch $iCode
    Case $HDN_ITEMCHANGED, $HDN_ITEMCHANGEDW, $LVN_ENDSCROLL
    If $iCode <> $LVN_ENDSCROLL Then $hWndFrom = _WinAPI_GetParent($hWndFrom)

    [/autoit][autoit][/autoit][autoit]

    For $i = 1 To $aProgress[0][0]
    If $aProgress[$i][3] = $hWndFrom Then _
    _MoveProgress($hWndFrom, $aProgress[$i][0], $aProgress[$i][1], $aProgress[$i][2])
    Next

    [/autoit][autoit][/autoit][autoit]

    _WinAPI_InvalidateRect($hWndFrom)
    EndSwitch

    [/autoit][autoit][/autoit][autoit]

    Return $GUI_RUNDEFMSG
    EndFunc ;==>_ListView_Notify

    [/autoit][autoit][/autoit][autoit]

    Func _MoveProgress($hListView, $hProgress, $sItemIndex, $sSubItemIndex)
    Local $aRect

    [/autoit][autoit][/autoit][autoit]

    If $sSubItemIndex = 0 Then
    $aRect = _GUICtrlListView_GetItemRect($hListView, $sItemIndex, 2)
    Else
    $aRect = _GUICtrlListView_GetSubItemRect($hListView, $sItemIndex, $sSubItemIndex)
    EndIf

    [/autoit][autoit][/autoit][autoit]

    If $aRect[1] < 10 Then
    _WinAPI_ShowWindow($hProgress, $SW_HIDE)
    ElseIf $aRect[1] >= 10 Then
    _WinAPI_ShowWindow($hProgress, $SW_SHOW)
    EndIf

    [/autoit][autoit][/autoit][autoit]

    _WinAPI_MoveWindow($hProgress, $aRect[0], $aRect[1], $aRect[2] - $aRect[0], $aRect[3] - $aRect[1], True)
    EndFunc ;==>_MoveProgress

    [/autoit][autoit][/autoit][autoit]

    ; #FUNCTION# ====================================================================================================
    ; Description ...: Sets the color of the indicator bar
    ; Parameters ....: $hWnd - Handle to the control
    ; $iColor - The new progress indicator bar color. Specify the CLR_DEFAULT value to cause the progress bar
    ; +to use its default progress indicator bar color.
    ; Return values .: Success - The previous progress indicator bar color, or CLR_DEFAULT if the progress indicator bar color
    ; +is the default color.
    ; Author ........: Paul Campbell (PaulIA), Updated By Arcker
    ; Remarks .......: This message is supported only in the Windows Classic theme
    ; Related .......:
    ; ====================================================================================================
    Func _Progress_SetBarColor($hWnd, $iColor)
    Return _SendMessage($hWnd, $PBM_SETBARCOLOR, 0, $iColor)
    EndFunc ;==>_Progress_SetBarColor

    [/autoit][autoit][/autoit][autoit]

    ; #FUNCTION# ====================================================================================================
    ; Description ...: Sets the current position
    ; Parameters ....: $hWnd - Handle to the control
    ; $iPos - The new position
    ; Return values .: Success - The previous position
    ; Author ........: Paul Campbell (PaulIA), Updated By Arcker
    ; Remarks .......:
    ; Related .......: _Progress_GetPos
    ; ====================================================================================================
    Func _Progress_SetPos($hWnd, $iPos)
    Return _SendMessage($hWnd, $PBM_SETPOS, $iPos, 0)
    EndFunc ;==>_Progress_SetPos

    [/autoit][autoit][/autoit][autoit]

    ; #FUNCTION# ====================================================================================================
    ; Description ...: Sets the background color in the progress bar
    ; Parameters ....: $hWnd - Handle to the control
    ; $iColor - The new background color. Specify the CLR_DEFAULT value to cause the progress bar to use its
    ; +default background color.
    ; Return values .: Success - The previous background color, or CLR_DEFAULT if the background color is the default color.
    ; Author ........: Paul Campbell (PaulIA), Updated By Arcker
    ; Remarks .......: This message is supported only in the Windows Classic theme
    ; Related .......:
    ; ====================================================================================================
    Func _Progress_SetBkColor($hWnd, $iColor)
    Return _SendMessage($hWnd, $PBM_SETBKCOLOR, 0, $iColor)
    EndFunc ;==>_Progress_SetBkColor

    [/autoit][autoit][/autoit][autoit]

    ; #FUNCTION# ====================================================================================================

    [/autoit][autoit][/autoit][autoit]

    ; Description ...: Specifies the step increment
    ; Parameters ....: $hWnd - Handle to the control
    ; $iStep - Step increment.
    ; Return values .: Success - The previous step increment
    ; Author ........: Paul Campbell (PaulIA)
    ; Remarks .......: The step increment is the amount by which the progress bar increases its current position whenever you use the
    ; _Progress_StepIt function. By default, the step increment is set to 10.
    ; Related .......: _Progress_StepIt
    ; ====================================================================================================
    Func _Progress_SetStep($hWnd, $iStep = 10)
    Return _SendMessage($hWnd, $PBM_SETSTEP, $iStep, 0)
    EndFunc ;==>_Progress_SetStep

    [/autoit][autoit][/autoit][autoit]

    ; #FUNCTION# ====================================================================================================
    ; Description ...: Advances the current position by the step increment
    ; Parameters ....: $hWnd - Handle to the control
    ; Return values .: Success - The previous position
    ; Author ........: Paul Campbell (PaulIA), Updated By Arcker
    ; Remarks .......:
    ; Related .......: _Progress_SetStep
    ; ====================================================================================================
    Func _Progress_StepIt($hWnd)
    Return _SendMessage($hWnd, $PBM_STEPIT, 0, 0)
    EndFunc ;==>_Progress_StepIt

    [/autoit][autoit][/autoit][autoit]

    ; #FUNCTION# ====================================================================================================
    ; Description ...: Delete the progressbar control
    ; Parameters ....: $hWnd - Handle to the control
    ; Return values .: Success - True
    ; Failure - False
    ; Author ........: G. Sandler (MrCreatoR), Updated by rasim
    ; Remarks .......:
    ; Related .......: _Progress_SetStep
    ; ====================================================================================================
    Func _Progress_Delete($hWnd)
    Local $aTmpArr[1][3]

    [/autoit][autoit][/autoit][autoit]

    For $i = 1 To $aProgress[0][0]
    If $aProgress[$i][0] <> $hWnd Then
    $aTmpArr[0][0] += 1
    ReDim $aTmpArr[$aTmpArr[0][0] + 1][4]

    [/autoit][autoit][/autoit][autoit]

    $aTmpArr[$aTmpArr[0][0]][0] = $aProgress[$i][0]
    $aTmpArr[$aTmpArr[0][0]][1] = $aProgress[$i][1]
    $aTmpArr[$aTmpArr[0][0]][2] = $aProgress[$i][2]
    $aTmpArr[$aTmpArr[0][0]][3] = $aProgress[$i][3]
    EndIf
    Next

    [/autoit][autoit][/autoit][autoit]

    $aProgress = $aTmpArr

    [/autoit][autoit][/autoit][autoit]

    Local $aResult = DllCall("User32.dll", "int", "DestroyWindow", "hwnd", $hWnd)
    If @error Then Return SetError(1, 0, 0)

    [/autoit][autoit][/autoit][autoit]

    Return $aResult[0] <> 0
    EndFunc ;==>_Progress_Delete

    [/autoit]
  • Progressbar im Treeview - möglich oder nicht?

    • fschaef
    • 9. Juni 2010 um 13:50
    Zitat von DjBlume

    Da musst du mal nach "DownSync v0.3" oder so suchen.
    ist von Jautois. Der hat das geschafft, Die Progressbar in ein TreeView einzubauen.

    Es kann aber auch eine ListView gewesen sein ;)


    Hi & Danke, ich werde mal Suchen, ggfs. baue ich meine GUI um. Vielen Dank für Deinen Tip. :D :D :D

  • Splash Ladebildschirm (ähnlich wie bei Office 2010)

    • fschaef
    • 9. Juni 2010 um 13:18
    Zitat von GtaSpider

    Heyho,

    Ich habe ein UDF geschrieben, mit dem man grafisch relativ aufwendig ein Ladebildschirm für das eigene Programm entwickeln kann.
    Hier mal ein Beispiel:

    Spoiler anzeigen
    [autoit]

    #include
    #include
    #include

    [/autoit] [autoit][/autoit] [autoit]

    #include
    _ModernSplash_Create("Test Program","v1.0 Build 1243#rev64453","_exit",20)
    _ModernSplash_Initiate("Load...")
    Sleep(100)
    _ModernSplash_AddText("Loading resources...")
    _ModernSplash_AddText("Test Text 123 quite long... errm jup..")
    _ModernSplash_AddText(Random(100000,1000000,1))
    Sleep(100);do smth
    _ModernSplash_AddText("Max rox!")
    MsgBox(0,"","You can try to exit the Splash by clicking on the X on the right or push esc"&@CRLF&"It will close then after this messagebox dissappears")
    Sleep(400);do smth
    _ModernSplash_AddText(Random(100000,1000000,1))
    Sleep(200);do smth
    _ModernSplash_AddText("Ping Google 1...")
    _ModernSplash_AddText("Returned: "&Ping("www.google.de")&"ms")
    _ModernSplash_AddText("Ping Google 2...")
    _ModernSplash_AddText("Returned: "&Ping("www.google.de")&"ms")
    _ModernSplash_AddText("Ping Google 10 times")
    $ms = 0
    For $i = 1 To 10
    $ms += Ping("www.google.de")
    Next
    _ModernSplash_AddText("Roundtrip: "&Round($ms/10)&"ms")
    _ModernSplash_AddText("Mesagebox")
    MsgBox(0,"","Click ok to continue or watch this beautiful animation. Hope you have enough time, its endless ;-)")
    _ModernSplash_DeInitiate()
    MsgBox(0,"","Programm succesfull loaded :)")
    Func _exit()
    MsgBox(0,"","You abborted loading...script exit now!")
    Exit
    EndFunc

    [/autoit]

    Und hier ein Video (denn Bilder sagen mehr als 1000 Worte ;) )
    http://www.youtube.com/watch?v=ASbejjkB_cI

    Die Daten sind im Anhang, über ein Feedback würd ich mich freuen :)

    Achja, das Script steht unter der CreativeCommon Lizenz:
    http://creativecommons.org/licenses/by/3.0/de/

    Gruß
    Spider

    Alles anzeigen


    Meine Hochachtung, richtig gut.

  • Wetter

    • fschaef
    • 9. Juni 2010 um 13:10
    Zitat von Ineluki

    Hab jetzt mal mein Wetter Script fertiggestellt ( ich weiß, man kann viel verbessern und es hat keine Bilder, aber egal) :

    Spoiler anzeigen
    [autoit]

    ; Globale Variablen und Einstellungen
    Global $windtype
    Global $oGUI
    Global $state
    Global $city
    Global $trans
    Opt("GUIOnEventMode", "1")
    Opt("TrayMenuMode",1)
    Opt("TrayOnEventMode", 1)
    $opt=TrayCreateItem("Optionen")
    TrayItemSetOnEvent(-1, "options")
    TrayCreateItem("")
    $about=TrayCreateItem("Über")
    TrayItemSetOnEvent(-1, "about")
    ;==> Globale Variablen und Einstellungen
    ; Haupt GUI
    GUICreate('Wetter', 233, 193, 186, 132)
    GUISetOnEvent(-3, "_exit")
    $type = GUICtrlCreateLabel('', 8, 16, 188, 18)
    $Temperatur = GUICtrlCreateLabel('Temperatur:', 8, 56, 115, 17)
    $gtemperatur = GUICtrlCreateLabel('Gefühlte Temperatur:', 8, 88, 160, 17)
    $luftfeuchtigkeit = GUICtrlCreateLabel('Luftfeuchtigkeit:', 8, 120, 118, 17)
    $wind = GUICtrlCreateLabel('Wind:', 8, 152, 160, 17)
    $hMenu=GUICtrlCreateMenu("Menü")
    GUICtrlCreateMenuItem("Optionen", $hMenu)
    GUICtrlSetOnEvent(-1, "options")
    GUICtrlCreateMenuItem("Über", $hMenu)
    GUICtrlSetOnEvent(-1, "about")
    WinSetTrans("Wetter", "", IniRead("data", "Other", "Trans", "255"))
    GUISetState(@SW_SHOW)
    ; ==> Haupt GUI
    update()
    AdlibRegister('update', '30000')

    [/autoit] [autoit][/autoit] [autoit]

    While sleep(500)
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    ; Eigene Funktionen
    Func update()
    $source=_INetGetSource('http://www.accuweather.com/de/EUR/DE/GM'&IniRead("data", "Main", "state", "003")&'/'&IniRead("data", "Main", "city", "Berlin")&'/quick-look.aspx')

    [/autoit] [autoit][/autoit] [autoit]

    $ntype=_StringBetween($source, '', "")
    GUICtrlSetData($type, $ntype[0])
    $ntemperatur=_StringBetween($source, '', '°')
    $ntemperatur[0]-=32
    $ntemperatur[0]/=1.8
    GUICtrlSetData($Temperatur, "Temperatur: "&Round($ntemperatur[0])&" °C")
    $ngtemperatur=_StringBetween($source, 'display: block;">', '°')
    $ngtemperatur[0]=StringRight($ngtemperatur[0], 2)
    $ngtemperatur[0]-=32
    $ngtemperatur[0]/=1.8
    GUICtrlSetData($gtemperatur, "Gefühlte Temperatur: "&Round($ngtemperatur[0])&" °C")
    $nluftfeuchtigkeit=_StringBetween($source, 'display: block;"', '%')
    $nluftfeuchtigkeit[0]=StringRight($nluftfeuchtigkeit[0], 2)
    GUICtrlSetData($luftfeuchtigkeit, "Luftfeuchtigkeit: "&$nluftfeuchtigkeit[0]&" %")
    $nwind=_StringBetween($source, '', '')
    If StringLen($nwind[0])=7 Then
    $windtype=StringLeft($nwind[0], 1)
    $nwind[0]=StringTrimLeft($nwind[0], 1)
    ElseIf StringLen($nwind[0])=8 Then
    $windtype=StringLeft($nwind[0], 2)
    $nwind[0]=StringTrimLeft($nwind[0], 2)
    ElseIf StringLen($nwind[0])=10 Then
    $windtype=StringLeft($nwind[0], 3)
    $nwind[0]=StringTrimLeft($nwind[0], 3)
    EndIf
    $nwind[0]=StringTrimRight($nwind[0], 3)
    $nwind[0]*=1.609344
    If StringRegExp($windtype, "E")=1 Then $windtype=StringRegExpReplace($windtype, "E", "O")
    GUICtrlSetData($wind, "Wind: "&$windtype&" "&Round($nwind[0])&" km/h")
    EndFunc
    Func _exit()
    Exit
    EndFunc
    Func options()
    TrayItemSetState($opt, 4)
    $oGUI = GUICreate("Optionen", 204, 179, 192, 124)
    GUISetOnEvent(-3, "close")
    GUICtrlCreateLabel("Bundesland: ", 8, 8, 100, 17)
    $state = GUICtrlCreateInput("", 64, 6, 121, 21)
    GUICtrlCreateLabel("Stadt: ", 8, 48, 27, 17)
    $city = GUICtrlCreateInput("", 64, 46, 121, 21)
    GUICtrlCreateLabel("Sichtbarkeit:", 8, 88, 60, 17)
    $trans = GUICtrlCreateSlider(72, 80, 126, 45)
    GUICtrlSetLimit(-1, 255, 0)
    GUICtrlSetData(-1, IniRead("data", "Other", "trans", "0"))
    GUICtrlCreateButton("Änderungen speichern", 44, 128, 120, 25)
    GUICtrlSetOnEvent(-1, "save")
    GUISetState(@SW_SHOW)
    EndFunc
    Func close()
    GUIDelete($oGUI)
    EndFunc
    Func save()
    $state=GUICtrlRead($state)
    If $state="Baden-Württemberg" Then $nstate="001"
    If $state="Baden Württemberg" Then $nstate="001"
    If $state="Bayern" Then $nstate="002"
    If $state="Berlin" Then $nstate="003"
    If $state="Brandenburg" Then $nstate="004"
    If $state="Bremen" Then $nstate="005"
    If $state="Hamburg" Then $nstate="006"
    If $state="Hessen" Then $nstate="007"
    If $state="Niedersachsen" Then $nstate="009"
    If $state="Mecklenburg-Vorpommern" Then $nstate="010"
    If $state="Mecklenburg Vorpommern" Then $nstate="010"
    If $state="Nordrhein-Westfalen" Then $nstate="011"
    If $state="Nordrhein Westfalen" Then $nstate="011"
    If $state="Rheinland-Pfalz" Then $nstate="012"
    If $state="Rheinland Pfalz" Then $nstate="012"
    If $state="Saarland" Then $nstate="013"
    If $state="Sachsen" Then $nstate="014"
    If $state="Sachsen-Anhalt" Then $nstate="015"
    If $state="Sachsen Anhalt" Then $nstate="015"
    If $state="Schleswig-Holstein" Then $nstate="016"
    If $state="Schleswig Holstein" Then $nstate="016"
    If $state="Thüringen" Then $nstate="017"
    $city=GUICtrlRead($city)
    $trans=GUICtrlRead($trans)
    If $nstate<>IniRead("data", "Main", "state", "") Then IniWrite("data", "Main", "state", $nstate)
    If $city<>"" Then IniWrite("data", "Main", "city", $city)
    If $trans<>IniRead("data", "Other", "trans", "") Then IniWrite("data", "Other", "trans", $trans)
    GUIDelete($oGUI)
    WinSetTrans("Wetter", "", $trans)
    update()
    EndFunc
    Func about()
    TrayItemSetState($about, 4)
    MsgBox(0, "Über", "Code: Jan Timon"&@CRLF&"Wetterdaten: http://www.accuweather.com")
    EndFunc ;==>Eigene Funktionen

    [/autoit] [autoit][/autoit] [autoit]

    ; Funktionen aus UDF's
    Func _INetGetSource($s_URL, $bString = True)
    Local $sString = InetRead($s_URL, 1)
    Local $nError = @error, $nExtended = @extended
    If $bString Then $sString = BinaryToString($sString)
    Return SetError($nError, $nExtended, $sString)
    EndFunc
    Func _StringBetween($s_String, $s_Start, $s_End, $v_If = -1)

    [/autoit] [autoit][/autoit] [autoit]

    ; Set If type
    Local $s_If = ""
    If $v_If = Default Or $v_If = -1 Then $s_If = "(?i)"

    [/autoit] [autoit][/autoit] [autoit]

    ; Escape characters
    Local $s_pattern_escape = "(\.|\||\*|\?|\+|\(|\)|\{|\}|\[|\]|\^|\$|\\)"
    $s_Start = StringRegExpReplace($s_Start, $s_pattern_escape, "\\$1")
    $s_End = StringRegExpReplace($s_End, $s_pattern_escape, "\\$1")

    [/autoit] [autoit][/autoit] [autoit]

    ; If you want data from beginning then replace blank start with beginning of string
    If $s_Start = "" Then $s_Start = "\A"

    [/autoit] [autoit][/autoit] [autoit]

    ; If you want data from a start to an end then replace blank with end of string
    If $s_End = "" Then $s_End = "\z"

    [/autoit] [autoit][/autoit] [autoit]

    Local $a_ret = StringRegExp($s_String, "(?s)" & $s_If & $s_Start & "(.*?)" & $s_End, 3)

    [/autoit] [autoit][/autoit] [autoit]

    If @error Then Return SetError(1, 0, 0)
    Return $a_ret
    EndFunc ;==>Funktionen aus UDF's

    [/autoit]


    Es gehen bis jetzt nur Städte in Deutschland.

    Alles anzeigen

    2 Worte: ;)
    Einfach & gut

  • Progressbar im Treeview - möglich oder nicht?

    • fschaef
    • 9. Juni 2010 um 11:04

    Hallo Alle,
    ich bin gerade dabei, eine GUI zu entwerfen, die verscheidene Software-Pakete zum installieren anbietet. Soweit so gut, läuft auch.
    Jetzt möchte ich aber noch eine Progressbar auf jedem TreeItem haben, die den Installationsfortschrit anzeigt, pro Paket.

    Weiß jemand, wie man daß mit Autoit (???) hinbekommt?
    Google habe ich bemüht, kommt aber nichts Brauchbares zu dem Thema.

    Thnx im voraus & Happy WM.

  • Bitmap mittels GDI+ mit CopyRight u. Zeitstempel versehen

    • fschaef
    • 20. März 2010 um 12:03

    Super & vielen Dank, ich hätrte wenn überhaupt Wochen eh Monate dafür gebraucht. ^^ :) ^^

Spenden

Jeder Euro hilft uns, Euch zu helfen.

Download

AutoIt Tutorial
AutoIt Buch
Onlinehilfe
AutoIt Entwickler
  1. Datenschutzerklärung
  2. Impressum
  3. Shoutbox-Archiv
Community-Software: WoltLab Suite™