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. UEZ

Beiträge von UEZ

  • Rand um PNG wird schwarz

    • UEZ
    • 3. September 2012 um 22:51

    Keine Ahnung, warum das Löschen bei Tabs nicht funzt, aber als Alternative kannst du noch eine Hintergrund Bitmap zum Löschen erstellen.

    Spoiler anzeigen
    [autoit]


    #include <GuiTab.au3>
    #include <GUIConstantsEx.au3>
    #include <GDIPlus.au3>
    ;~ #include <WindowsConstants.au3>;~~~
    ;~ #include <WinAPI.au3>;~~~

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

    Global $hImage, $hBitmap, $hBmpOn, $hBmpOff
    Global $acPic[10]

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

    _GDIPlus_Startup()
    $hImage = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\on.png")
    $hBitmap = _GDIPlus_BitmapCloneArea($hImage, 0, 0, 16, 16, $GDIP_PXF32ARGB)
    $hBmpOn = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap)
    _GDIPlus_BitmapDispose($hBitmap)
    _GDIPlus_ImageDispose($hImage)

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

    $hImage = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\off.png")
    $hBitmap = _GDIPlus_BitmapCloneArea($hImage, 0, 0, 16, 16, $GDIP_PXF32ARGB)
    $hBmpOff = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap)
    _GDIPlus_BitmapDispose($hBitmap)

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

    $hBitmap = _GDIPlus_BitmapCloneArea($hImage, 0, 0, 16, 16, $GDIP_PXF32ARGB)
    $hCtx = _GDIPlus_ImageGetGraphicsContext($hBitmap)
    _GDIPlus_GraphicsClear($hCtx, 0xFFFFFFFF)
    _GDIPlus_GraphicsDispose($hCtx)
    $hBmpClear = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap)
    _GDIPlus_ImageDispose($hImage)
    _GDIPlus_BitmapDispose($hBitmap)
    _GDIPlus_Shutdown()

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

    Global $hGUI = GUICreate("Test")
    Global $cTab = GUICtrlCreateTab(5, 5, 380, 200)
    Global $hTab = GUICtrlGetHandle($cTab)
    GUICtrlCreateTabItem("Test1")
    GUICtrlCreateButton("Test", 80, 80, 80, 25)
    GUICtrlCreateTabItem("Test2")
    For $i = 0 To 9
    $acPic[$i] = GUICtrlCreatePic("", 50 + (30 * $i), 50, 16, 16)
    GUICtrlSetState(-1, $GUI_DISABLE)
    GUICtrlSendMsg($acPic[$i], 0x0172, 0, $hBmpOff)
    Next
    GUICtrlCreateTabItem("")
    GUISetState()

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

    While 1
    For $i = 0 To 9
    _WinAPI_DeleteObject(GUICtrlSendMsg($acPic[$i], 0x0172, 0, $hBmpClear))
    If Random(0, 1, 1) = 1 Then
    _WinAPI_DeleteObject(GUICtrlSendMsg($acPic[$i], 0x0172, 0, $hBmpOn))
    Else
    _WinAPI_DeleteObject(GUICtrlSendMsg($acPic[$i], 0x0172, 0, $hBmpOff))
    EndIf
    Next

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

    Switch GUIGetMsg()
    Case $GUI_EVENT_CLOSE
    _WinAPI_DeleteObject($hBmpClear)
    _WinAPI_DeleteObject($hBmpOn)
    _WinAPI_DeleteObject($hBmpOff)
    Exit
    EndSwitch
    WEnd

    [/autoit]

    Gruß,
    UEZ

  • Rand um PNG wird schwarz

    • UEZ
    • 3. September 2012 um 20:41

    Probiere es mal so:

    [autoit]


    For $i = 0 To 9
    _WinAPI_DeleteObject(GUICtrlSendMsg($acPic[$i], 0x0172, 0, 0)) ; löschen des Controls. _WinAPI_DeleteObject(), damit kein Memory Leak entsteht
    If Random(0, 1, 1) = 1 Then
    _WinAPI_DeleteObject(GUICtrlSendMsg($acPic[$i], 0x0172, 0, $hBmpOn))
    Else
    _WinAPI_DeleteObject(GUICtrlSendMsg($acPic[$i], 0x0172, 0, $hBmpOff))
    EndIf
    Next

    [/autoit]

    Nach deiner Methode produzierst du auch ein Memory Leak!

    Gruß,
    UEZ

  • Autoit Script vor decompiling schützen

    • UEZ
    • 1. September 2012 um 20:53

    Diese Frage wurde 1000 mal gefragt und 100000 mal beantwortet!

    Gruß,
    UEZ

  • Resize Control Problem

    • UEZ
    • 1. September 2012 um 14:20

    Probiere es mal mit dieser modifizierten Funktion:

    [autoit]


    func _erstellen()
    Local $aPos = ControlGetPos($Form1, "", $btnerstellen)
    If Not @error Then
    $Checkbox1 = GUICtrlCreateCheckbox("Checkbox1", $aPos[0], $aPos[1] + 40, 97, 17)
    $Checkbox2 = GUICtrlCreateCheckbox("Checkbox2", $aPos[0], $aPos[1] + 72, 97, 17)
    $Checkbox3 = GUICtrlCreateCheckbox("Checkbox3", $aPos[0] + 96, $aPos[1] + 40, 97, 17)
    EndIf
    endfunc

    [/autoit]

    Gruß,
    UEZ

  • Zeichensatz verwenden

    • UEZ
    • 31. August 2012 um 23:40

    So was?

    Spoiler anzeigen
    [autoit]


    #include <FontConstants.au3>
    #include <WinAPI.au3>
    #include <GUIConstantsEx.au3>
    #include <ListViewConstants.au3>
    #include <WindowsConstants.au3>

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

    $h_ListView_Font = _WinAPI_CreateFont(14, 0, 0, 0, 500, False, False, False, $DEFAULT_CHARSET, $OUT_DEFAULT_PRECIS, $CLIP_DEFAULT_PRECIS, $PROOF_QUALITY, 0, "Wingdings")
    $h_ListView_Font1 = _WinAPI_CreateFont(14, 0, 0, 0, 500, False, False, False, $DEFAULT_CHARSET, $OUT_DEFAULT_PRECIS, $CLIP_DEFAULT_PRECIS, $PROOF_QUALITY, 0, "Arial")

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

    $Form1 = GUICreate("Form1", 459, 215, 192, 124)
    $ListView1 = GUICtrlCreateListView("Ordner|Monat", 24, 24, 250, 150)
    GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 50)
    GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 50)
    $ListView1_0 = GUICtrlCreateListViewItem("1|Januar", $ListView1)
    $Button1 = GUICtrlCreateButton("Start", 280, 24, 75, 25, $WS_GROUP)
    $hListView = GUICtrlGetHandle($ListView1)
    GUISetState(@SW_SHOW)

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

    GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")
    _WinAPI_RedrawWindow($Form1)

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    GUIRegisterMsg($WM_NOTIFY, "")
    _WinAPI_DeleteObject($h_ListView_Font)
    _WinAPI_DeleteObject($h_ListView_Font1)
    Exit

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

    Case $Button1

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

    EndSwitch
    WEnd

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

    Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam)
    #forceref $hWnd, $iMsg, $iwParam

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

    Local $tNMHDR = DllStructCreate($tagNMHDR, $ilParam)
    Local $hWndFrom = DllStructGetData($tNMHDR, "hWndFrom")
    Local $nNotifyCode = DllStructGetData($tNMHDR, "Code")

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

    Switch $hWndFrom
    Case $hListView
    Switch $nNotifyCode
    Case $NM_CUSTOMDRAW
    Local $tCustDraw = DllStructCreate($tagNMLVCUSTOMDRAW, $ilParam)
    Local $iDrawStage = DllStructGetData($tCustDraw, "dwDrawStage")
    If $iDrawStage = $CDDS_PREPAINT Then Return $CDRF_NOTIFYITEMDRAW
    If $iDrawStage = $CDDS_ITEMPREPAINT Then Return $CDRF_NOTIFYSUBITEMDRAW
    Local $iItem = DllStructGetData($tCustDraw, "dwItemSpec")
    Local $hDC = DllStructGetData($tCustDraw, 'hdc')
    Local $iSubItem = DllStructGetData($tCustDraw, 'iSubItem')
    Switch Mod($iSubItem, 2)
    Case 0
    _WinAPI_SelectObject($hDC, $h_ListView_Font)
    Return $CDRF_NEWFONT
    Case 1
    _WinAPI_SelectObject($hDC, $h_ListView_Font1)
    Return $CDRF_NEWFONT
    EndSwitch
    Return $GUI_RUNDEFMSG
    EndSwitch
    EndSwitch
    EndFunc ;==>WM_NOTIFY

    [/autoit]

    Gruß,
    UEZ

  • Dll erstellen und mit AutoIt nutzen - FreeBasic Tutorial

    • UEZ
    • 31. August 2012 um 15:37

    Klasse Implementierung Mars! :thumbup:

    Jetzt könnte man die DLL noch einbetten und direkt vom Speicher aufrufen, so dass das Mitgeben der DLL unnötig wird.

    Gruß,
    UEZ

  • Error: Subscript used with non-Array variable

    • UEZ
    • 29. August 2012 um 15:24

    Du kannst folgendes tun, damit du die Zeile im Source Code findest:

    1)
    Kompiliere den Code mit folgendem Schalter:

    [autoit]


    #AutoIt3Wrapper_Run_Obfuscator=y
    #Obfuscator_Parameters=/so

    [/autoit]


    Es wird eine Datei DeinSkript_Obfuscated.au3 angelegt.


    2) entferne aus dieser Datei alle Zeilenumbrüche mit _


    3) Starte das neu kompilierte Skript auf dem Server.


    Wenn nun die Fehlermeldung mit der Zeilennummer erscheint, schaue in der DeinSkript_Obfuscated.au3 nach. Wenn die Zeile keinen Sinn macht, müsste sie "in der Nähe" sein.

    Gruß,
    UEZ

  • File to Base64 String Code Generator v1.20 Build 2020-06-05

    • UEZ
    • 29. August 2012 um 00:21

    Habe einen kritischen Bug gefunden!

    Bei Multi Select Files wurde der Binär String ohne Komprimierung übergeben, wenn die Komprimierung Sinn macht. Somit ist der Base64 String korrupt! :whistling:

    Gruß,
    UEZ

  • WinXP: Abfragen unter welchem User ein bestimmter Service läuft.

    • UEZ
    • 27. August 2012 um 15:43

    Da der String mit like ausgeführt wird, was passiert, wenn du nur "ServiceName." eingibst?

    Gruß,
    UAZ UEZ

  • In "Pic"-Steuerlement srollen

    • UEZ
    • 23. August 2012 um 21:59

    Hier ein Beispiel:

    Spoiler anzeigen
    [autoit]


    #include <WindowsConstants.au3>
    #include <ScrollBarConstants.au3>
    #include <Constants.au3>
    #include <GuiScrollBars.au3>
    #include <ScreenCapture.au3>

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

    Global Const $STM_SETIMAGE = 0x0172
    _GDIPlus_Startup()
    Global $hBMP_Screen = _ScreenCapture_Capture("", 0, 0, @DesktopWidth, @DesktopHeight)
    Global $hBmp = _GDIPlus_BitmapCreateFromHBITMAP($hBMP_Screen)

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

    Global $bW = _GDIPlus_ImageGetWidth($hBmp)
    Global $bH = _GDIPlus_ImageGetHeight($hBmp)

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

    Global $iW = @DesktopWidth * 0.5, $iH = @DesktopHeight * 0.5
    Global $hGUI = GUICreate("Test", $iW, $iH)
    Global $idPic = GUICtrlCreatePic("", $iW, $iH)
    GUISetState()

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

    Global $iVSscroll = _WinAPI_GetSystemMetrics(2)
    Global $iHSscroll = _WinAPI_GetSystemMetrics(3)
    Global $iYCaption = _WinAPI_GetSystemMetrics(4)
    Global $iYFixedFrame = _WinAPI_GetSystemMetrics(8)
    Global $iXFixedFrame = _WinAPI_GetSystemMetrics(7)

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

    Global $IE_offset_x, $IE_offset_y, $iNewH, $iNewW
    Global $hGfx_IE_BMP_Display, $hCtx_IE_BMP_Display
    Global $IE_ScrollbarH = False, $IE_ScrollbarV = False

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

    PlacePicCtrl()

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

    Do
    Until GUIGetMsg() = -3

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

    _GDIPlus_BitmapDispose($hGfx_IE_BMP_Display)
    _GDIPlus_GraphicsDispose($hCtx_IE_BMP_Display)
    _GDIPlus_BitmapDispose($hBmp)
    _WinAPI_DeleteObject($hBMP_Screen)
    _GDIPlus_Shutdown()
    GUIDelete()
    Exit

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

    Func PlacePicCtrl()
    GUIRegisterMsg($WM_HSCROLL, "")
    GUIRegisterMsg($WM_VSCROLL, "")

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

    Local $iVSscroll = _WinAPI_GetSystemMetrics(2)
    Local $iHSscroll = _WinAPI_GetSystemMetrics(3)
    Local $iYCaption = _WinAPI_GetSystemMetrics(4)
    Local $iYFixedFrame = _WinAPI_GetSystemMetrics(8)
    Local $iXFixedFrame = _WinAPI_GetSystemMetrics(7)

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

    Local $iMetricsSumX = ($bH > $iH ) * $iVSscroll + $iXFixedFrame * 2
    Local $iMetricsSumY = ($bW > $iW) * $iHSscroll + $iYCaption + $iYFixedFrame

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

    $iNewW = Min($bW, $iW)
    $iNewH = Min($bH, $iH)
    Calc_Offset()

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

    GUICtrlSetPos($idPic, $IE_offset_x, $IE_offset_y, $iNewW, $iNewH)

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

    _GDIPlus_BitmapDispose($hGfx_IE_BMP_Display)
    _GDIPlus_GraphicsDispose($hCtx_IE_BMP_Display)

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

    $hGfx_IE_BMP_Display = DllCall($ghGDIPDll, "uint", "GdipCreateBitmapFromScan0", "int", $iNewW, "int", $iNewH, "int", 0, "int", 0x0026200A, "ptr", 0, "int*", 0)
    $hGfx_IE_BMP_Display = $hGfx_IE_BMP_Display[6]
    $hCtx_IE_BMP_Display = _GDIPlus_ImageGetGraphicsContext($hGfx_IE_BMP_Display)
    _GDIPlus_GraphicsSetSmoothingMode($hCtx_IE_BMP_Display, 2)

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

    $IE_ScrollbarV = False
    $IE_ScrollbarH = False

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

    If $bW > $iNewW Or $bH > $iNewW Then
    _GUIScrollBars_Init($hGUI)
    _GUIScrollBars_SetScrollInfoMin($hGUI, $SB_HORZ, 0)
    _GUIScrollBars_SetScrollInfoMax($hGUI, $SB_HORZ, $bW - $iW + 61 + $iMetricsSumX)
    _GUIScrollBars_SetScrollInfoMin($hGUI, $SB_VERT, 0)
    _GUIScrollBars_SetScrollInfoMax($hGUI, $SB_VERT, $bH - $iH + $iMetricsSumY - 1)
    GUIRegisterMsg($WM_HSCROLL, "WM_HSCROLL_IE")
    GUIRegisterMsg($WM_VSCROLL, "WM_VSCROLL_IE")

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

    If $bW > $iW Then
    WM_HSCROLL_IE($hGUI, 0, $SB_THUMBTRACK, 0)
    $IE_ScrollbarH = True
    EndIf
    If $bH > ($iH) Then
    WM_VSCROLL_IE($hGUI, 0, $SB_THUMBTRACK, 0)
    $IE_ScrollbarV = True
    EndIf
    EndIf
    EndFunc

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

    Func Calc_Offset()
    Local $iDiff_x = $bW - $iW, $iDiff_y = $bH - $iH

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

    If $iDiff_x < 0 Then
    $IE_offset_x = ($iW - $bW) / 2
    $IE_signX = -1
    Else
    $IE_offset_x = 0
    $IE_signX = 1
    EndIf
    $delta_x = ($iW - $iNewW) / 2

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

    If $iDiff_y < 0 Then
    $IE_offset_y = ($iH - $bH) / 2
    $delta_y = ($iH - $iNewH) / 2
    $IE_signY = -1
    Else
    $IE_offset_y = 0
    $delta_y = ($iH - $iNewH) / 2
    $IE_signY = 1
    EndIf
    EndFunc

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

    Func WM_VSCROLL_IE($hWnd, $iMsg, $wParam, $lParam)
    #forceref $iMsg, $lParam

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

    Local $Min, $Max, $Page, $TrackPos

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

    Local $tSCROLLINFO_Y = _GUIScrollBars_GetScrollInfoEx($hWnd, $SB_VERT)
    $Min = DllStructGetData($tSCROLLINFO_Y, "nMin")
    $Max = DllStructGetData($tSCROLLINFO_Y, "nMax")
    $Page = DllStructGetData($tSCROLLINFO_Y, "nPage")

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

    $IE_offset_y = DllStructGetData($tSCROLLINFO_Y, "nPos")
    $TrackPos = DllStructGetData($tSCROLLINFO_Y, "nTrackPos")

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

    Local $nScrollCode = BitAND($wParam, 0x0000FFFF)
    Switch $nScrollCode
    Case $SB_LINELEFT ; user clicked left arrow
    DllStructSetData($tSCROLLINFO_Y, "nPos", $IE_offset_y - 1)
    Case $SB_LINERIGHT ; user clicked right arrow
    DllStructSetData($tSCROLLINFO_Y, "nPos", $IE_offset_y + 1)
    Case $SB_PAGELEFT ; user clicked the scroll bar shaft left of the scroll box
    DllStructSetData($tSCROLLINFO_Y, "nPos", $IE_offset_y - $Page)
    Case $SB_PAGERIGHT ; user clicked the scroll bar shaft right of the scroll box
    DllStructSetData($tSCROLLINFO_Y, "nPos", $IE_offset_y + $Page)
    Case $SB_THUMBTRACK ; user dragged the scroll box
    DllStructSetData($tSCROLLINFO_Y, "nPos", $TrackPos)
    EndSwitch

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

    DllStructSetData($tSCROLLINFO_Y, "fMask", $SIF_POS)
    _GUIScrollBars_SetScrollInfo($hWnd, $SB_VERT, $tSCROLLINFO_Y)

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

    $IE_offset_y = DllStructGetData($tSCROLLINFO_Y, "nPos")

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

    _GDIPlus_GraphicsDrawImageRectRect($hCtx_IE_BMP_Display, $hBmp, $IE_offset_x * $IE_ScrollbarH, $IE_offset_y * $IE_ScrollbarV, $iNewW, $iNewH, 0, 0, $iNewW, $iNewH)
    CopyImage2Control($idPic, $hGfx_IE_BMP_Display)

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

    Return "GUI_RUNDEFMSG"
    EndFunc ;==>WM_VSCROLL_IE

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

    Func WM_HSCROLL_IE($hWnd, $iMsg, $wParam, $lParam)
    #forceref $iMsg, $lParam
    Local $Min, $Max, $Page, $TrackPos

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

    Local $tSCROLLINFO_X = _GUIScrollBars_GetScrollInfoEx($hWnd, $SB_HORZ)
    $Min = DllStructGetData($tSCROLLINFO_X, "nMin")
    $Max = DllStructGetData($tSCROLLINFO_X, "nMax")
    $Page = DllStructGetData($tSCROLLINFO_X, "nPage")

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

    $IE_offset_x = DllStructGetData($tSCROLLINFO_X, "nPos")
    $TrackPos = DllStructGetData($tSCROLLINFO_X, "nTrackPos")

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

    Local $nScrollCode = BitAND($wParam, 0x0000FFFF)
    Switch $nScrollCode
    Case $SB_LINELEFT ; user clicked left arrow
    DllStructSetData($tSCROLLINFO_X, "nPos", $IE_offset_x - 1)
    Case $SB_LINERIGHT ; user clicked right arrow
    DllStructSetData($tSCROLLINFO_X, "nPos", $IE_offset_x + 1)
    Case $SB_PAGELEFT ; user clicked the scroll bar shaft left of the scroll box
    DllStructSetData($tSCROLLINFO_X, "nPos", $IE_offset_x - $Page)
    Case $SB_PAGERIGHT ; user clicked the scroll bar shaft right of the scroll box
    DllStructSetData($tSCROLLINFO_X, "nPos", $IE_offset_x + $Page)
    Case $SB_THUMBTRACK ; user dragged the scroll box
    DllStructSetData($tSCROLLINFO_X, "nPos", $TrackPos)
    EndSwitch

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

    DllStructSetData($tSCROLLINFO_X, "fMask", $SIF_POS)
    _GUIScrollBars_SetScrollInfo($hWnd, $SB_HORZ, $tSCROLLINFO_X)

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

    $IE_offset_x = DllStructGetData($tSCROLLINFO_X, "nPos")
    _GDIPlus_GraphicsDrawImageRectRect($hCtx_IE_BMP_Display, $hBmp, $IE_offset_x * $IE_ScrollbarH, $IE_offset_y * $IE_ScrollbarV, $iNewW, $iNewH, 0, 0, $iNewW, $iNewH)
    CopyImage2Control($idPic, $hGfx_IE_BMP_Display)

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

    Return "GUI_RUNDEFMSG"
    EndFunc ;==>WM_HSCROLL_IE

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

    Func CopyImage2Control($idControl, $hBmp)
    Local Const $hHBitmap_ImageEditor = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBmp)
    Local Const $hB = GUICtrlSendMsg($idControl, $STM_SETIMAGE, $IMAGE_BITMAP, $hHBitmap_ImageEditor)
    If $hB Then _WinAPI_DeleteObject($hB)
    _WinAPI_DeleteObject($hHBitmap_ImageEditor)
    EndFunc ;==>CopyImage2Control

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

    Func Min($a, $b)
    If $a < $b Then Return $a
    Return $b
    EndFunc ;==>Min

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

    Func Max($a, $b)
    If $a > $b Then Return $a
    Return $b
    EndFunc ;==>Max

    [/autoit]

    Beispiel ist ein Fast Hack und stammt vom Basic Image Editor v2...

    Gruß,
    UEZ

  • WMI - überprüfen ob $objItem vorhanden ist

    • UEZ
    • 23. August 2012 um 21:14

    Probiere es mal damit:

    [autoit]


    If ($objItem.Manufacturer <> "") Then $lResult = "MB" & "Manufacturer" & "|" & $objItem.Manufacturer

    [/autoit]

    Gruß,
    UEZ

  • _GDIPlus_ImageLoadFromFile auch anderes?

    • UEZ
    • 22. August 2012 um 21:55

    Ist eine alte Version.

    Hier die Aktuelle:

    Load_BMP_From_Mem.au3

    Spoiler anzeigen
    [autoit]


    ;~ #AutoIt3Wrapper_au3check_parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
    #include-once
    #include <GDIPlus.au3>
    #include <Memory.au3>

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

    _GDIPlus_Startup()
    OnAutoItExitRegister("__GDIPlus_Shutdown")

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

    ;======================================================================================
    ; Function Name: Load_BMP_From_Mem
    ; Description: Loads an image which is saved as a binary string and converts it to a bitmap or hbitmap
    ;
    ; Parameters: $bImage: the binary string which contains any valid image which is supported by GDI+
    ; Optional: $hHBITMAP: if false a bitmap will be created, if true a hbitmap will be created
    ;
    ; Remark: hbitmap format is used generally for GUI internal images, $bitmap is more a GDI+ image format
    ; Don't forget _GDIPlus_Startup() and _GDIPlus_Shutdown()
    ;
    ; Requirement(s): GDIPlus.au3, Memory.au3 and _GDIPlus_BitmapCreateDIBFromBitmap() from WinAPIEx.au3
    ; Return Value(s): Success: handle to bitmap (GDI+ bitmap format) or hbitmap (WinAPI bitmap format),
    ; Error: 0
    ; Error codes: 1: $bImage is not a binary string
    ; 2: unable to create stream on HGlobal
    ; 3: unable to create bitmap from stream
    ;
    ; Author(s): UEZ
    ; Additional Code: thanks to progandy for the MemGlobalAlloc and tVARIANT lines and
    ; Yashied for _GDIPlus_BitmapCreateDIBFromBitmap() from WinAPIEx.au3
    ; Version: v0.97 Build 2012-04-10 Beta
    ;=======================================================================================
    Func Load_BMP_From_Mem($bImage, $hHBITMAP = False)
    If Not IsBinary($bImage) Then Return SetError(1, 0, 0)
    Local $aResult
    Local Const $memBitmap = Binary($bImage) ;load image saved in variable (memory) and convert it to binary
    Local Const $len = BinaryLen($memBitmap) ;get length of image
    Local Const $hData = _MemGlobalAlloc($len, $GMEM_MOVEABLE) ;allocates movable memory ($GMEM_MOVEABLE = 0x0002)
    Local Const $pData = _MemGlobalLock($hData) ;translate the handle into a pointer
    Local $tMem = DllStructCreate("byte[" & $len & "]", $pData) ;create struct
    DllStructSetData($tMem, 1, $memBitmap) ;fill struct with image data
    _MemGlobalUnlock($hData) ;decrements the lock count associated with a memory object that was allocated with GMEM_MOVEABLE
    $aResult = DllCall("ole32.dll", "int", "CreateStreamOnHGlobal", "handle", $pData, "int", True, "ptr*", 0) ;Creates a stream object that uses an HGLOBAL memory handle to store the stream contents
    If @error Then Return SetError(2, 0, 0)
    Local Const $hStream = $aResult[3]
    $aResult = DllCall($ghGDIPDll, "uint", "GdipCreateBitmapFromStream", "ptr", $hStream, "int*", 0) ;Creates a Bitmap object based on an IStream COM interface
    If @error Then Return SetError(3, 0, 0)
    Local Const $hBitmap = $aResult[2]
    Local $tVARIANT = DllStructCreate("word vt;word r1;word r2;word r3;ptr data; ptr")
    DllCall("oleaut32.dll", "long", "DispCallFunc", "ptr", $hStream, "dword", 8 + 8 * @AutoItX64, _
    "dword", 4, "dword", 23, "dword", 0, "ptr", 0, "ptr", 0, "ptr", DllStructGetPtr($tVARIANT)) ;release memory from $hStream to avoid memory leak
    $tMem = 0
    $tVARIANT = 0
    If $hHBITMAP Then
    Local Const $hHBmp = _GDIPlus_BitmapCreateDIBFromBitmap($hBitmap)
    _GDIPlus_BitmapDispose($hBitmap)
    Return $hHBmp
    EndIf
    Return $hBitmap
    EndFunc ;==>Load_BMP_From_Mem

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

    Func _GDIPlus_BitmapCreateDIBFromBitmap($hBitmap)
    Local $tBIHDR, $Ret, $tData, $pBits, $hResult = 0
    $Ret = DllCall($ghGDIPDll, 'uint', 'GdipGetImageDimension', 'ptr', $hBitmap, 'float*', 0, 'float*', 0)
    If (@error) Or ($Ret[0]) Then Return 0
    $tData = _GDIPlus_BitmapLockBits($hBitmap, 0, 0, $Ret[2], $Ret[3], $GDIP_ILMREAD, $GDIP_PXF32ARGB)
    $pBits = DllStructGetData($tData, 'Scan0')
    If Not $pBits Then Return 0
    $tBIHDR = DllStructCreate('dword;long;long;ushort;ushort;dword;dword;long;long;dword;dword')
    DllStructSetData($tBIHDR, 1, DllStructGetSize($tBIHDR))
    DllStructSetData($tBIHDR, 2, $Ret[2])
    DllStructSetData($tBIHDR, 3, $Ret[3])
    DllStructSetData($tBIHDR, 4, 1)
    DllStructSetData($tBIHDR, 5, 32)
    DllStructSetData($tBIHDR, 6, 0)
    $hResult = DllCall('gdi32.dll', 'ptr', 'CreateDIBSection', 'hwnd', 0, 'ptr', DllStructGetPtr($tBIHDR), 'uint', 0, 'ptr*', 0, 'ptr', 0, 'dword', 0)
    If (Not @error) And ($hResult[0]) Then
    DllCall('gdi32.dll', 'dword', 'SetBitmapBits', 'ptr', $hResult[0], 'dword', $Ret[2] * $Ret[3] * 4, 'ptr', DllStructGetData($tData, 'Scan0'))
    $hResult = $hResult[0]
    Else
    $hResult = 0
    EndIf
    _GDIPlus_BitmapUnlockBits($hBitmap, $tData)
    Return $hResult
    EndFunc ;==>_GDIPlus_BitmapCreateDIBFromBitmap

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

    Func __GDIPlus_Shutdown()
    _GDIPlus_Shutdown()
    EndFunc ;==>GDIPlus_Shutdown

    [/autoit]

    Gruß,
    UEZ

  • OpenCl goes AutoIt Update 31.Dezember 2016

    • UEZ
    • 20. August 2012 um 22:13

    Funktioniert schon mal unter Win7 x64.

    Die 1kb JavaScript Demos sind ja bestens dafür geeignet. Wenn ich hier durchblicke und ein wenig Zeit finde, werde ich mal versuchen, einige JS Demos zu Konvertieren.

    Z.B so was:

    Spoiler anzeigen
    HTML
    <!DOCTYPE HTML>
    <html><head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    
    
    	
    		<title>JS1k, 1k demo submission [434]</title>
    		<meta charset="utf-8">
    	</head><body>
    		<canvas width="500" height="500" id="c"></canvas>
    		<script>
    /*		X="m=Math;n=255;$rDpcFm.sqrt(a*a+b+c*c)}GF(a)}H[a-a-a-a]}I{bareturn [a/b/b/b]}hb<3?b+3,F(a)+j,b,c)+l)-(1.5+F-t*4))):b-2.5}with(document.body.children)T=getContext('2d'),	=80=style;with(a)	*4+'px';setInterval('W=T.ge0,z,zE=W.data;j=tl=i1010];M20+i+20,j*4+4+i+320+i+14];i-=M;u=I(H(I([t),-1]),i=I(i))v=H(i,uD+i;for(x=q=0;x<z*z;x++){$=D+u*(x%+v*(~~x/-M;a$/=a;for(f=s=1;m.abs(s)>.01&&f<70;s=h(p,p,p)){f+=s;p+$*f}if(f<70){p<-2?c=c=c=(p/2+n)+~~(p/2+n)&1?0:1:(bp),c=b/4,c=j/2+.5,c=b/1=s-h(p0,p1,p2),r-p;a$br/=a,r/=b;b=0;b+=$*r(c+m.pow(b,54))*(1-f/65)}m.max(c,1))*n;n0}T.puWt+=.05',t=0)";for(Y=31;Y;)X=X.replace(RegExp(String.fromCharCode(Y),"g"),"for(o=0;o<3;o++)_[o]_(a,b,c){return _m.sin(_function _[0]_[1]_[2]_width=height=z_x_m.cos(t_=[];_x_?.1:0)_);_tImageData(_-t*4)/2+.5_=G(_-(o==_=[t*.7)*_z/z*2-1)_*b_$_,a_=M_,*.6)*_E[q++]=_(a,b,c)_,0_m.min(_;c=".split("_")[--Y]);
    		//X="m=Math;n=255;$=[];r=[];D=[];p=[];c=[];function F(a,b,c){return m.sqrt(a*a+b*b+c*c)}function G(a,b,c){return F(a[0],a[1],a[2])}function H(a,b,c){return [a[1]*b[2]-a[2]*b[1],a[2]*b[0]-a[0]*b[2],a[0]*b[1]-a[1]*b[0]]}function I(a,b,c){b=G(a);return [a[0]/b,a[1]/b,a[2]/b]}function h(a,b,c){return b<3?m.min(b+3,F(m.sin(a)+j,b,m.sin(c)+l)-(1.5+m.sin(F(a,b,c)-t*4))):b-2.5}with(document.body.children[0])T=getContext('2d'),width=height=z=80,a=style;with(a)width=height=z*4+'px';setInterval('W=T.getImageData(0,0,z,z);E=W.data;j=m.sin(t);l=m.cos(t);i=[m.sin(t*.7)*10,0,m.cos(t*.6)*10];M=[m.sin(t*.7)*20+i[0]+20,j*4+4+i[1]+3,m.cos(t*.6)*20+i[2]+14];for(o=0;o<3;o++)i[o]-=M[o];u=I(H(I([m.sin(t),-1,0]),i=I(i)));v=H(i,u);for(o=0;o<3;o++)D[o]=M[o]+i[o];for(x=q=0;x<3;o++)$[o]=D[o]+u[o]*(x%z/z*2-1)+v[o]*(~~x/z/z*2-1)-M[o];a=G($);for(o=0;o<3;o++)$[o]/=a;for(f=s=1;m.abs(s)>.01&&f<70;s=h(p[0],p[1],p[2])){f+=s;for(o=0;o<3;o++)p[o]=M[o]+$[o]*f}if(f<70){p[1]<-2?c[0]=c[1]=c[2]=(p[0]/2+n)+~~(p[2]/2+n)&1?0:1:(b=G(p),c[0]=m.sin(b/4-t*4)/2+.5,c[1]=j/2+.5,c[2]=m.sin(b/1-t*4)/2+.5);for(o=0;o<3;o++)$[o]=s-h(p[0]-(o==0?.1:0),p[1]-(o==1?.1:0),p[2]-(o==2?.1:0)),r[o]=M[o]-p[o];a=G($);b=G(r);for(o=0;o<3;o++)$[o]/=a,r[o]/=b;b=0;for(o=0;o<3;o++)b+=$[o]*r[o];for(o=0;o<3;o++)c[o]=(c[o]*b+m.pow(b,54))*(1-f/65)}for(o=0;o<3;o++)E[q++]=m.max(m.min(c[o],1),0)*n;E[q++]=n;for(o=0;o<3;o++)c[o]=0}T.putImageData(W,0,0);t+=.05',t=0)"
    		document.write (X);
    		eval(X);
    */		
    			m=Math;
    			n=255;
    			K=[];
    			r=[];
    			D=[];
    			p=[];
    			c=[];
    			Sin=m.sin;
    			Cos=m.cos;
    			Sqrt=m.sqrt;
    			Min=m.min;
    			Max=m.max;
    			Abs=m.abs;
    			Pow=m.pow;
    			t=0;
    
    			function F(a,b,c)
    			{
    				return Sqrt(a*a+b*b+c*c)
    			}
    
    			function G(a)
    			{
    				return F(a[0],a[1],a[2])
    			}
    
    			function H(a,b)
    			{
    				return [a[1]*b[2]-a[2]*b[1],a[2]*b[0]-a[0]*b[2],a[0]*b[1]-a[1]*b[0]]
    			}
    
    			function I(a)
    			{
    				b=G(a);
    				return [a[0]/b,a[1]/b,a[2]/b]
    			}
    
    			function JJ(a,b,c)
    			{
    				return b<3?Min(b+3,F(Sin(a)+j,b,Sin(c)+l)-(1.5+Sin(F(a,b,c)-t*4))):b-2.5
    			}
    
    			function start()
    			{
    				W=T.getImageData(0,0,z,z);
    				E=W.data;
    				j=Sin(t);
    				l=Cos(t);
    				i=[Sin(t*.7)*10,0,Cos(t*.6)*10];
    				M=[Sin(t*.7)*20+i[0]+20,j*4+7+i[1],Cos(t*.6)*20+i[2]+14];
    				for(o=0;o<3;o++)
    					i[o]-=M[o];
    				u=I(H(I([Sin(t),-1,0]),i=I(i)));
    				v=H(i,u);
    				for(o=0;o<3;o++)
    					D[o]=M[o]+i[o];
    				q=0;
    				for(x=0;x<z*z;x++)
    				{
    					for(o=0;o<3;o++)
    						K[o]=D[o]+u[o]*(x%z/z*2-1)+v[o]*(~~x/z/z*2-1)-M[o];
    					a=G(K);
    					for(o=0;o<3;o++)
    						K[o]/=a;
    					for(y=s=1;Abs(s)>.01&&y<70;s=JJ(p[0],p[1],p[2]))
    					{
    						y+=s;
    						for(o=0;o<3;o++)
    							p[o]=M[o]+K[o]*y
    					}
    					if(y<70)
    					{
    						p[1]<-2?c[0]=c[1]=c[2]=(p[0]/2+n)+~~(p[2]/2+n)&1?0:1:
    						(b=G(p),
    						c[0]=Sin(b/4-t*4)/2+.5,
    						c[1]=j/2+.5,
    						c[2]=Sin(b-t*4)/2+.5);
    						for(o=0;o<3;o++)
    							K[o]=s-JJ(p[0]-(o==0?.1:0),
    							p[1]-(o==1?.1:0),
    							p[2]-(o==2?.1:0)),
    							r[o]=M[o]-p[o];
    						a=G(K);
    						b=G(r);
    						for(o=0;o<3;o++)
    							K[o]/=a,
    							r[o]/=b;
    						b=0;
    						for(o=0;o<3;o++)
    							b+=K[o]*r[o];
    						for(o=0;o<3;o++)
    							c[o]=(c[o]*b+Pow(b,54))*(1-y/65)
    					}
    					for(o=0;o<3;o++)
    						E[q]=Max(Min(c[o],1),0)*n,
    						q+=1;
    					E[q]=n;
    					q+=1;
    					for(o=0;o<3;o++)
    						c[o]=0
    				}
    				T.putImageData(W,0,0);
    				t+=.05
    			}
    
    			with(document.body.children[0])
    			T=getContext('2d'),width=height=z=80,a=style;
    			with(a)width=height=z*4+'px';
    			setInterval(start,10)
    
    		</script>
    	</body></html>
    Alles anzeigen

    Den Code als HTML Datei speichern und starten...

    Gruß,
    UEZ

  • Dll erstellen und mit AutoIt nutzen - FreeBasic Tutorial

    • UEZ
    • 20. August 2012 um 13:24

    Klasse Sache! :thumbup:

    Vielen Dank für das Tutorial 8o


    Gruß,
    UEZ

  • Neues Control: Living Graph

    • UEZ
    • 20. August 2012 um 10:45

    Das Ganze UDF tauglich zu machen, ist schon klasse! Zumal man "um die Ecke" denken muss. Ich bin eher der Anti UDF Typ.

    Sauber programmiert! :thumbup:

    Gruß,
    UEZ

  • Kleinster HD-Kurzfilm

    • UEZ
    • 19. August 2012 um 14:36
    Zitat von Andy

    Gut, abgemacht, ich hol dich dann ab, ob man 500km fährt oder 600 ist für mich egal :thumbup:
    Mal sehen, vielleicht bekommen wir ne Übernachtung hin, dass es sich lohnt, und können den einen oder anderen AutoIt-ler aktivieren^^

    Abgemacht! :thumbup:

    Gruß,
    UEZ

  • Kleinster HD-Kurzfilm

    • UEZ
    • 19. August 2012 um 14:05

    Ich glaube, dach mache ich wieder mit! Scheiß auf die Entferung!

    Hauptsache AAAAAAAMMMMMMMMMIIIIIIIIIIIGGGGGGAAAAAAAAAAA! :thumbup:

    :rock:
    UEZ

  • OpenCl goes AutoIt Update 31.Dezember 2016

    • UEZ
    • 19. August 2012 um 13:52

    Die das Resultat von meinem Arbeitsschlepptop:

    Der Inhalt kann nicht angezeigt werden, da er nicht mehr verfügbar ist.

    Gruß,
    UEZ

    Dateien

    OpenCL Result.png 15,49 kB – 0 Downloads
  • Kleinster HD-Kurzfilm

    • UEZ
    • 19. August 2012 um 13:14

    Hier die Award Demos zu den entsprechenden Kategorien: http://awards.scene.org/awards.php 8o

    Andy: AAAAAAAAAAMMMMMMMMMMMMMMIIIIIIIIIIIIIIIIIGGGGGGGGGGGGGGGGGAAAAAAAAAAAAAAAAAAAAAAAAAAAAA :rock:

    Gruß,
    UEZ

  • WinXP: Abfragen unter welchem User ein bestimmter Service läuft.

    • UEZ
    • 17. August 2012 um 14:07

    Probiere es mal damit:

    Spoiler anzeigen
    [autoit]


    ;coded by UEZ 2012
    Global $oErrorHandler = ObjEvent("AutoIt.Error", "ObjErrorHandler")

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

    $host = "localhost"
    MsgBox(0, "test", WMI_GetServiceStarterName($host, "Application Layer Gateway Service"))

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

    Func WMI_GetServiceStarterName($sHost, $sService, $sUsr = "", $sPass = "") ;coded by UEZ 2012
    Local $ping = Ping($sHost, 500)
    If @error Then SetError(1, 0, -1)
    Local $objWMILocator = ObjCreate("WbemScripting.SWbemLocator")
    If @error Then Return SetError(2, 0, 0)
    Local $objWMIService = $objWMILocator.ConnectServer($sHost, "\root\cimv2", $sUsr, $sPass, "", "", 128)
    If @error Then Return SetError(3, 0, 0)
    ;~ Local $objWMIService = ObjGet("winmgmts:{impersonationLevel = impersonate}!\\" & $sHost & "\root\cimv2")
    Local $colItems = $objWMIService.ExecQuery("SELECT Caption,Name, StartName FROM Win32_Service WHERE Caption LIKE '%" & $sService & "%'", "WQL", 0x30)
    Local $sString
    If IsObj($colItems) Then
    For $objItem In $colItems
    $sString &= $objItem.Caption & " (" &$objItem.Name & ") : " & $objItem.StartName & ";"
    Next
    Return StringTrimRight($sString, 1)
    EndIf
    Return SetError(4, 0, 0)
    EndFunc

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

    Func ObjErrorHandler()
    ConsoleWrite( "A COM Error has occured!" & @CRLF & @CRLF & _
    "err.description is: " & @TAB & $oErrorHandler.description & @CRLF & _
    "err.windescription:" & @TAB & $oErrorHandler & @CRLF & _
    "err.number is: " & @TAB & Hex($oErrorHandler.number, 8) & @CRLF & _
    "err.lastdllerror is: " & @TAB & $oErrorHandler.lastdllerror & @CRLF & _
    "err.scriptline is: " & @TAB & $oErrorHandler.scriptline & @CRLF & _
    "err.source is: " & @TAB & $oErrorHandler.source & @CRLF & _
    "err.helpfile is: " & @TAB & $oErrorHandler.helpfile & @CRLF & _
    "err.helpcontext is: " & @TAB & $oErrorHandler.helpcontext & @CRLF _
    )
    EndFunc

    [/autoit]

    Gruß,
    UEZ

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™