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

Beiträge von veronesi

  • Image aus Datei extrahieren

    • veronesi
    • 17. November 2014 um 14:50

    Also in VB.NET sieht die gewünschte Funktion so aus:

    Spoiler anzeigen
    Code
    Public Class MapOrganizer
        Dim MapFile As String = "C:\Temp\Graue Bastion_GiTM Djamboo.fc2map"
        Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
            PicBox1.Image = ReadImage(MapFile)
        End Sub
    
    
        Private Function ReadImage(ByVal sFile As String) As Image
            Dim MyPicture As Image = Nothing
            Dim Offset As Integer = 0
    
    
            Using FileStream As FileStream = File.OpenRead(sFile)
                FileStream.Seek(28, SeekOrigin.Begin) 'Set pointer to initial position
                Offset = ReadInt32(FileStream) 'Creator
                FileStream.Seek(Offset, SeekOrigin.Current)
                FileStream.Seek(8, SeekOrigin.Current)
                Offset = ReadInt32(FileStream) 'Author
                FileStream.Seek(Offset, SeekOrigin.Current)
                Offset = ReadInt32(FileStream) 'Name
                FileStream.Seek(Offset, SeekOrigin.Current)
                FileStream.Seek(80, SeekOrigin.Current)
                ReadInt32(FileStream) 'MapSize
                FileStream.Seek(4, SeekOrigin.Current)
                ReadInt32(FileStream) 'GameMode
    
    
                Dim num As Integer = ReadInt32(FileStream)
                Dim num2 As Integer = ReadInt32(FileStream)
                Dim num3 As Integer = ReadInt32(FileStream)
                Dim num4 As Integer = ReadInt32(FileStream)
                Dim num5 As Integer = CInt(num * num2 * num3 * num4 / 8)
                If num5 > 0 Then
                    Dim array As Byte() = New Byte(num5 - 1) {}
                    FileStream.Read(array, 0, num5)
                    Dim bitmap As Bitmap = New Bitmap(num, num2)
                    Dim bitmapData As Imaging.BitmapData = bitmap.LockBits(New Rectangle(0, 0, bitmap.Width, bitmap.Height), Imaging.ImageLockMode.WriteOnly, Imaging.PixelFormat.Format32bppArgb)
                    Marshal.Copy(array, 0, bitmapData.Scan0, num5)
                    bitmap.UnlockBits(bitmapData)
                    MyPicture = bitmap
                End If
            End Using
    
    
            Return MyPicture
        End Function
    
    
        Private Function ReadInt32(ByVal Stream As FileStream) As Integer
            Dim array As Byte() = New Byte(4 - 1) {}
            Stream.Read(array, 0, 4)
            Return BitConverter.ToInt32(array, 0)
        End Function
    End Class
    Alles anzeigen


    Jetzt muss nur noch jemand diese Funktionen in AutoIt umsetzen!

    Und der Beweis, dass es funktioniert ist gleich hier.
    Ich habe die EXE aus VB.NET gleich hochgeladen.
    Einfach starten - wenn ihr möchtet - und Load Map drücken. Danach wird die Karte dargestellt.


    Ich habe die Exe selbst erstellt und weiss, dass sie keinen Virus enthält. Aber im Zweifel lieber einmal mehr prüfen, als einmal weniger.
    Es ist der gleiche Code wie oben im Spoiler, ausser, dass ich beim Button Klick nun den Dateinamen abfrage.

    Gruss Veronesi

  • Passwort verschlüsseln / auslagern

    • veronesi
    • 24. Oktober 2014 um 08:05
    Zitat von michach
    Code
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        TestInternetConnection() ' Beim laden des Formulars wird geprüft ob Internet vorhanden ist
        RunUpdate() ' Wenn Internet und eine neue Version gefunden wird, beginnt der Download
        Autostart("CPU_RAM_Status")
    End Sub


    Wenn Du das Ganze aber im MyBase.Load Event machst, dann braucht Dein UI "lange", bis es geladen ist.
    Normalerweise solltest Du erst im Shown Event einen neuen Thread (oder Backgroundworker) starten und mit diesem die Daten holen.
    Dann friert Deine UI nicht ein und die Form wird schnell geladen.

    Zudem hat VB.NET ein Problem mit dem Load Event: Wenn nämlich hier eine Exception geworfen wird, dann wird diese einfach "geschluckt" ohne dass man diese mit Try...Catch abfangen könnte. Dies betrifft aber nur den .Load Event.

    Btw: Anstelle eines neuen Threads (welcher viel RAM benötigt; 1-2MB) könntest Du ebensogut einen Threadpool verwenden.

    Code
    System.Threading.ThreadPool.QueueUserWorkItem(AddressOf MySub, Nothing)

    Ach ja: Wenn ich so Deine Try...Catch Strukturen sehe, möchte ich Dich gerne auf diesen Artikel verweisen:
    https://www.vb-paradise.de/index.php/Thre…%C3%9Fes-Eisen/

    Veronesi

  • Regex Herausforderung

    • veronesi
    • 11. Juni 2013 um 21:22

    Sorry, noch nicht dazu gekommen.
    Aber nun nachgeholt!

    Veronesi

  • Regex Herausforderung

    • veronesi
    • 11. Juni 2013 um 20:33

    Perfekt, vielen Dank!
    Gruss Veronesi

  • Regex Herausforderung

    • veronesi
    • 11. Juni 2013 um 18:45

    Hallo Zsammen

    Ich habe eine Herausforderung für Regex, zu der ich momentan keine Lösung habe.
    Ich habe einen STRING der z.B so aussieht:
    Abcdef"ghi"jklmno"pqrstuvw"xyz


    Nun müsste ich mit einem Regex Pattern den String in ein Array umfüllen, so dass jeweils alle Zeichen in Anführungszeichen ein neues Element im Array sind.
    Das Beispiel würde also so umgesetzt:
    Array 0: Abcdef
    Array 1: "ghi"
    Array 2: jklmno
    Array 3: "pqrstuvw"
    Array 4: xyz

    Wie kann ich das bewerkstelligen?

    Veronesi


    G

  • COM Objekt für RS232 Kommunikation

    • veronesi
    • 15. Mai 2013 um 07:33

    Hallo
    Das steht doch im Header der UDF.
    0 bedeutet 1 Stopp-Bit.
    1 bedeutet 1.5 Stopp-Bit.
    2 bedeutet 2 Stopp-Bits.

    Siehe auch in der MSDN: Link

    Gruß Veronesi

  • Scroll GUI mit MouseDrag

    • veronesi
    • 1. April 2013 um 17:30

    So, nun habe ich die Lösung gefunden!

    Man kann nun mit dem Finger auf einem Touchscreen scrollen und die Button(s) benutzen!
    Hier der Code! (Tidy benutzen, da Windows 8 mir die Tabs hier im Forum zerstört....)

    Spoiler anzeigen
    [autoit]

    #include <GUIConstantsEx.au3>
    #include <WinAPI.au3>
    #include <Array.au3>
    #include "GUIScrollbars_Ex.au3"
    Opt("GUIOnEventMode", 1)
    Global $fParimaryDown = False, $iXMouse = 0, $iCurrentScrollPos = 0
    Global $hHook
    $hGUI = GUICreate("Test", 1920, 700, 0, 0)
    GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")
    GUISetOnEvent($GUI_EVENT_PRIMARYDOWN, "_PrimaryDown")
    GUISetOnEvent($GUI_EVENT_PRIMARYUP, "_PrimaryUp")
    GUISetOnEvent($GUI_EVENT_MOUSEMOVE, "_Move")
    _SpecialEventMouseClick()
    GUISetBkColor(0xFF0000, $hGUI)
    GUICtrlCreateLabel("", 0, 0, 1920, 700)
    GUICtrlSetBkColor(-1, 0x00FF00)
    Global $hbutton = GUICtrlCreateButton("test", 100, 100, 50, 50)

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

    GUISetState()
    _GUIScrollbars_Generate($hGUI, 5000, 0)

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

    While 1
    Sleep(100)
    WEnd
    Func _SpecialEventMouseClick()
    $hStub_MouseProc = DllCallbackRegister("_MouseProc", "long", "int;wparam;lparam")
    $hmod = _WinAPI_GetModuleHandle(0)
    $hHook = _WinAPI_SetWindowsHookEx($WH_MOUSE_LL, DllCallbackGetPtr($hStub_MouseProc), $hmod)
    EndFunc ;==>_SpecialEventMouseClick
    Func _MouseProc($nCode, $wParam, $lParam)
    Local $HC_ACTION = 0
    Local $event, $info, $iX, $iY, $mouseData = "", $wheelData = "", $wheelCount
    $info = DllStructCreate("int X;int Y;dword mouseData;dword flags;dword time;ulong_ptr dwExtraInfo", $lParam)
    $iX = DllStructGetData($info, 1)
    $iY = DllStructGetData($info, 2)
    $mouseData = DllStructGetData($info, 3)
    If $nCode < 0 Then Return _WinAPI_CallNextHookEx($hHook, $nCode, $wParam, $lParam)
    If $nCode = $HC_ACTION Then
    Switch $wParam
    Case $WM_MOUSEMOVE
    ;Mouse Move
    Case $WM_MOUSEWHEEL
    ;Wheel
    If _WinAPI_HiWord($mouseData) > 0 Then
    ;Forward
    Else
    ;Backward
    EndIf
    $wheelCount = _WinAPI_HiWord($mouseData) / 120
    Case $WM_LBUTTONDOWN
    ;Left Mouse Down
    Local $Cursor = GUIGetCursorInfo()
    If $Cursor[4] = $hbutton Then _Button()
    ;~ Return -1 ; Return -1 würde die Nachricht verwerfen! Wirkt sich auf das System aus, wie wenn gar kein Left down gekommen wäre!
    Case $WM_LBUTTONUP
    ;Left Mouse Up
    Case $WM_RBUTTONDOWN
    ;Right Mouse Down
    Case $WM_RBUTTONUP
    ;Right Mouse Up
    Case $WM_MBUTTONDOWN
    ;Wheel Down
    Case $WM_MBUTTONUP
    ;Wheel Up
    EndSwitch
    EndIf
    ;~ ConsoleWrite($iX & ', ' & $iY & ' ' & $event & $wheelData & ' count: ' & $wheelCount & @CRLF)
    Return _WinAPI_CallNextHookEx($hHook, $nCode, $wParam, $lParam)
    EndFunc ;==>_MouseProc
    Func _Button()
    ConsoleWrite("Button" & @CRLF)
    EndFunc
    Func _PrimaryDown()
    $fParimaryDown = True
    $iXMouse = MouseGetPos(0)
    Local $tagSCROLLINFO = _GUIScrollBars_GetScrollInfoEx($hGUI, $SB_HORZ)
    $iCurrentScrollPos = DllStructGetData($tagSCROLLINFO, 7)
    EndFunc
    Func _PrimaryUp()
    $fParimaryDown = False
    EndFunc
    Func _Move()
    If $fParimaryDown Then
    Local $iDeltaMove = MouseGetPos(0) - $iXMouse
    Local $iNewPos = $iCurrentScrollPos - ($iDeltaMove / 9)
    Local $tagSCROLLINFO = _GUIScrollBars_GetScrollInfoEx($hGUI, $SB_HORZ)
    If $iNewPos < DllStructGetData($tagSCROLLINFO, 3) Then $iNewPos = DllStructGetData($tagSCROLLINFO, 3) + 1
    If $iNewPos > DllStructGetData($tagSCROLLINFO, 4) Then $iNewPos = DllStructGetData($tagSCROLLINFO, 4) - 1
    _GUIScrollbars_Scroll_Pos($hGUI, $iNewPos, 0)
    EndIf
    EndFunc
    Func _Exit()
    Exit
    EndFunc

    [/autoit]

    Die fehlende GUIScrollbars_Ex.au3 ist im letzten Post bereits vorhanden!
    Veronesi

  • Scroll GUI mit MouseDrag

    • veronesi
    • 1. April 2013 um 17:13

    So, ich bin nun einen Schritt weiter.

    Ich kann nun mit dem Finger horizontal scrollen! Geht natürlich auch mit dem Touchpen oder mit der gedrückten linken Maustaste und herumfahren.
    Das funktioniert.
    Wenn ich nun aber auf den Button klicke, dann sieht es anders aus:
    Mit der Maus, wird der Befehl anstandslos ausgeführt. (ConsoleWrite...)
    Wenn ich hingegen mit dem Touchpen oder dem Finger darauf klicke, dann passiert nichts!

    Bei dem Finger wird der Event _PrimaryDown erst ausgeführt, wenn ich entweder einen Doppelklick mit dem Finger mache, oder wenn ich auf den Bildschirm Tippe und ganz wenig bewege. Mit anderen Worten, der Event wird erst ausgeführt, wenn ich den Finger etwas bewege!

    Hier das Programm:

    Spoiler anzeigen
    [autoit]

    #include <GUIConstantsEx.au3>
    #include <WinAPI.au3>
    #include <Array.au3>
    #include "GUIScrollbars_Ex.au3"
    Opt("GUIOnEventMode", 1)
    Global $fParimaryDown = False, $iXMouse = 0, $iCurrentScrollPos = 0
    $hGUI = GUICreate("Test", 1920, 700, 0, 0)
    GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")
    GUISetOnEvent($GUI_EVENT_PRIMARYDOWN, "_PrimaryDown")
    GUISetOnEvent($GUI_EVENT_PRIMARYUP, "_PrimaryUp")
    GUISetOnEvent($GUI_EVENT_MOUSEMOVE, "_Move")
    GUISetBkColor(0xFF0000, $hGUI)
    GUICtrlCreateLabel("", 0, 0, 1920, 700)
    GUICtrlSetBkColor(-1, 0x00FF00)
    Global $hbutton = GUICtrlCreateButton("test", 100, 100, 50, 50)
    GUICtrlSetOnEvent(-1, "_Button")
    GUISetState()
    _GUIScrollbars_Generate($hGUI, 5000, 0)

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

    While 1
    Sleep(100)
    WEnd
    Func _Button()
    ConsoleWrite("Button" & @CRLF)
    EndFunc
    Func _PrimaryDown()
    $fParimaryDown = True
    $iXMouse = MouseGetPos(0)
    Local $tagSCROLLINFO = _GUIScrollBars_GetScrollInfoEx($hGUI, $SB_HORZ)
    $iCurrentScrollPos = DllStructGetData($tagSCROLLINFO, 7)
    Local $Cursor = GUIGetCursorInfo()
    If $Cursor[4] = $hbutton Then _Button()
    EndFunc
    Func _PrimaryUp()
    $fParimaryDown = False
    EndFunc
    Func _Move()
    If $fParimaryDown Then
    Local $iDeltaMove = MouseGetPos(0) - $iXMouse
    Local $iNewPos = $iCurrentScrollPos - ($iDeltaMove / 8)
    Local $tagSCROLLINFO = _GUIScrollBars_GetScrollInfoEx($hGUI, $SB_HORZ)
    If $iNewPos < DllStructGetData($tagSCROLLINFO, 3) Then $iNewPos = DllStructGetData($tagSCROLLINFO, 3) + 1
    If $iNewPos > DllStructGetData($tagSCROLLINFO, 4) Then $iNewPos = DllStructGetData($tagSCROLLINFO, 4) - 1
    _GUIScrollbars_Scroll_Pos($hGUI, $iNewPos, 0)
    EndIf
    EndFunc
    Func _Exit()
    Exit
    EndFunc

    [/autoit]

    Und hier die etwas angepasste UDF GUIScrollbars_Ex:

    Spoiler anzeigen
    [autoit]

    #include-once
    ; #INDEX# ============================================================================================================
    ; Title .........: GUIScrollBars_Ex
    ; AutoIt Version : v3.3.6.0
    ; Language ......: English
    ; Description ...: Generates scrollbars for user defined sizes of GUI and aperture and sets proportional thumb sizes
    ; Remarks .......:
    ; Note ..........:
    ; Author(s) .....: Melba23 - with some code based on the WinAPI and GUIScrollBars includes
    ; and contributions from rover, czardas, MrCreatoR and Malkey
    ; ====================================================================================================================
    ;#AutoIt3Wrapper_au3check_parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
    ; #INCLUDES# =========================================================================================================
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    #include <GuiScrollBars.au3>
    #include <ScrollBarConstants.au3>
    #include <SendMessage.au3>
    ; #GLOBAL VARIABLES# =================================================================================================
    Global $aSB_WindowInfo[1][10]
    ; [0] = Handle to window
    ; [1] = Not used
    ; [2] = Average horizontal pixels per char
    ; [3] = Vertical pixels per char
    ; [4] = Client area width
    ; [5] = Client area height
    ; [6] = Horizontal max setting
    ; [7] = Vertical max setting
    ; [8] = Vertical scrollbar position for minimize/restore
    ; [9] = Horizontal scrollbar position for minimize/restore
    Global $aSB_WindowInfoEx[1][5]
    ; [0] = Horizontal scrollable size
    ; [1] = Vertical scrollable size
    ; [2] = Width correction factor
    ; [3] = Height correction factor
    ; [4] = Before/After flag
    ; #CURRENT# ==========================================================================================================
    ; _GUIScrollbars_Generate: Generates scrollbars for a GUI with a defined aperture with proportional thumb sizes
    ; _GUIScrollbars_Locate_Ctrl: Calculates coordinates to use to position controls after scrollbar creation
    ; _GUIScrollbars_Scroll_Page: Scrolls to min, max or page number
    ; _GUIScrollbars_Minimize: Stores scrollbar positions on GUI minimize
    ; _GUIScrollbars_Restore: Restores scrollbar positions on GUI restore
    ; ====================================================================================================================
    ; #INTERNAL_USE_ONLY#=================================================================================================
    ; _Scrollbars_WM_VSCROLL: GUIRegisterMsg procedure for vertical scrollbar
    ; _Scrollbars_WM_HSCROLL: GUIRegisterMsg procedure for horizontal scrollbar
    ; _Scrollbars_WM_MOUSEWHEEL : GUIRegisterMsg procedure for vertical mouse wheel scroll
    ; _Scrollbars_WM_MOUSEHWHEEL : GUIRegisterMsg procedure for horizontal mouse wheel scroll
    ;=====================================================================================================================
    ; #FUNCTION# =========================================================================================================
    ; Name...........: _GUIScrollbars_Generate
    ; Description ...: Generates scrollbars for a GUI with a defined aperture with proportional thumb sizes
    ; Syntax.........: _GUIScrollbars_Generate ($hWnd, $iH_Scroll = 0, [$iV_Scroll = 0, [$iH_Tight = 0, [$iV_Tight = 0, [$fBefore = False]]]])
    ; Parameters ....: $hWnd -> GUI to contain scrollbars
    ; $iH_Scroll -> Width in pixels of area to be scrolled
    ; $iV_Scroll -> Height in pixels of area to be scrolled (default = 0)
    ; $iH_Tight -> 1 = Adjust mean position of right edge of scrolled area to right (default = 0)
    ; $iV_Tight -> 1 = Adjust mean position of bottom edge of scrolled area down (default = 0)
    ; $fBefore -> True = Scrollbars are being generated BEFORE controls
    ; False = Scrollbars are being generated AFTER controls (default)
    ; Requirement(s).: v3.3.6.0 or higher
    ; Return values .: Success - Returns a 4-element array (see remarks for details):
    ; [0] = Actual aperture width ; [1] = Actual aperture height]
    ; [2] = Width correction factor ; [3] = Height correction factor]
    ; Failure - Returns either 0 (UDF error) or negative integer (API error)
    ; If UDF error then @error set as follows:
    ; 1 - hWnd not a valid handle
    ; 2 - No scroll size parameters
    ; 3 - Scrollbar creation or parameter setting failure
    ; If API error then @error and @extended as set by API error. Return values:
    ; -1 - GetDC failure
    ; -2 - GetTextMetricsW failure
    ; -3 - GetClientRect failure
    ; Remarks .......; The $fBefore parameter is needed because of the way Windows deals with scrollbars. When the
    ; scrollbars are generated, the visible part of the scrollable GUI resizes to fit the in the
    ; remaining (smaller) client area.
    ; - If the scrollbars are to be generated BEFORE any controls, the UDF shoudl be called with the
    ; $fBefore parameter set. The new client size of the aperture window is returned so that
    ; controls can then be created using these values.
    ; - If controls have been created before the scrollbars are generated then the UDF should be
    ; called without the $fBefore parameter. The correction factors returned can then be applied to
    ; any subsequent control positioning and sizing. This is necessary because of the positions and
    ; sizes of existing controls will be slightly altered as the scrollbars are generated and the GUI
    ; resized. Any controls created subsequently would therefore be slightly misplaced in relation
    ; to the existing ones unless the correction factors are used when positoning and sizing them.
    ; - If existing controls were fixed in place using GUICtrlResizing($GUI_DOCKALL) there is no need
    ; to apply the correction factors as the controls will not have moved with the GUI resizing.
    ; Author ........: Melba23 - with some code based on the WinAPI and GUIScrollBars includes
    ; Example........; Yes
    ;=====================================================================================================================
    Func _GUIScrollbars_Generate($hWnd, $iH_Scroll = 0, $iV_Scroll = 0, $iH_Tight = 0, $iV_Tight = 0, $fBefore = False)
    ; Check if valid window handle
    If Not IsHWnd($hWnd) Then Return SetError(1, 0, 0)
    If $aSB_WindowInfo[0][0] <> "" Then
    ReDim $aSB_WindowInfo[UBound($aSB_WindowInfo) + 1][10]
    ReDim $aSB_WindowInfoEx[UBound($aSB_WindowInfo) + 1][5]
    EndIf
    ; If no scroll sizes set, return error
    If $iH_Scroll = 0 And $iV_Scroll = 0 Then Return SetError(2, 0, 0)
    ; Confirm Tight values
    If $iH_Tight <> 0 Then $iH_Tight = 1
    If $iV_Tight <> 0 Then $iV_Tight = 1
    ; Create structs
    Local $tTEXTMETRIC = DllStructCreate($tagTEXTMETRIC)
    Local $tSCROLLINFO = DllStructCreate($tagSCROLLINFO)
    DllStructSetData($tSCROLLINFO, "cbSize", DllStructGetSize($tSCROLLINFO))
    Local $tRect = DllStructCreate($tagRECT)
    ; Declare local variables
    Local $iIndex = UBound($aSB_WindowInfo) - 1
    Local $iError, $iExtended
    ; Save window handle
    $aSB_WindowInfo[$iIndex][0] = $hWnd
    ; Determine text size
    Local $hDC = DllCall("user32.dll", "handle", "GetDC", "hwnd", $hWnd)
    If Not @error Then
    $hDC = $hDC[0]
    DllCall("gdi32.dll", "bool", "GetTextMetricsW", "handle", $hDC, "ptr", DllStructGetPtr($tTEXTMETRIC))
    If @error Then
    $iError = @error
    $iExtended = @extended
    DllCall("user32.dll", "int", "ReleaseDC", "hwnd", $hWnd, "handle", $hDC)
    Return SetError($iError, $iExtended, -2)
    EndIf
    DllCall("user32.dll", "int", "ReleaseDC", "hwnd", $hWnd, "handle", $hDC)
    Else
    Return SetError(@error, @extended, -1)
    EndIf
    $aSB_WindowInfo[$iIndex][2] = DllStructGetData($tTEXTMETRIC, "tmAveCharWidth")
    $aSB_WindowInfo[$iIndex][3] = DllStructGetData($tTEXTMETRIC, "tmHeight") + DllStructGetData($tTEXTMETRIC, "tmExternalLeading")
    ; Size aperture window without bars
    DllCall("user32.dll", "bool", "GetClientRect", "hwnd", $hWnd, "ptr", DllStructGetPtr($tRect))
    If @error Then Return SetError(@error, @extended, -3)
    Local $iX_Client_Full = DllStructGetData($tRect, "Right") - DllStructGetData($tRect, "Left")
    Local $iY_Client_Full = DllStructGetData($tRect, "Bottom") - DllStructGetData($tRect, "Top")
    $aSB_WindowInfo[$iIndex][4] = $iX_Client_Full
    $aSB_WindowInfo[$iIndex][5] = $iY_Client_Full
    ; Hide both scrollbars
    _GUIScrollBars_ShowScrollBar($hWnd, $SB_BOTH, False)
    ; Show scrollbars and register scrollbar and mousewheel messages if required
    If $iH_Scroll Then
    _GUIScrollBars_ShowScrollBar($hWnd, $SB_HORZ)
    GUIRegisterMsg($WM_HSCROLL, "_Scrollbars_WM_HSCROLL")
    GUIRegisterMsg($WM_MOUSEHWHEEL, '_Scrollbars_WM_MOUSEHWHEEL')
    EndIf
    If $iV_Scroll Then
    _GUIScrollBars_ShowScrollBar($hWnd, $SB_VERT)
    GUIRegisterMsg($WM_VSCROLL, "_Scrollbars_WM_VSCROLL")
    GUIRegisterMsg($WM_MOUSEWHEEL, "_Scrollbars_WM_MOUSEWHEEL")
    EndIf
    ; Size aperture window with bars
    DllCall("user32.dll", "bool", "GetClientRect", "hwnd", $hWnd, "ptr", DllStructGetPtr($tRect))
    If @error Then Return SetError(@error, @extended, -3)
    Local $iX_Client_Bar = DllStructGetData($tRect, "Right") - DllStructGetData($tRect, "Left")
    Local $iY_Client_Bar = DllStructGetData($tRect, "Bottom") - DllStructGetData($tRect, "Top")
    ; If horizontal scrollbar is required
    Local $iH_FullPage
    If $iH_Scroll Then
    If $fBefore Then
    ; Use actual aperture width
    $aSB_WindowInfo[$iIndex][4] = $iX_Client_Bar
    ; Determine page size (aperture width / text width)
    $iH_FullPage = Floor($aSB_WindowInfo[$iIndex][4] / $aSB_WindowInfo[$iIndex][2])
    ; Determine max size (scroll width / text width - tight)
    $aSB_WindowInfo[$iIndex][6] = Floor($iH_Scroll / $aSB_WindowInfo[$iIndex][2]) - $iH_Tight
    Else
    ; Use reduced aperture width only if other scrollbar exists
    If $iV_Scroll Then $aSB_WindowInfo[$iIndex][4] = $iX_Client_Bar
    ; Determine page size (aperture width / text width)
    $iH_FullPage = Floor($aSB_WindowInfo[$iIndex][4] / $aSB_WindowInfo[$iIndex][2])
    ; Determine max size (scroll width / text width * correction factor for V scrollbar if required - tight)
    $aSB_WindowInfo[$iIndex][6] = Floor($iH_Scroll / $aSB_WindowInfo[$iIndex][2] * $aSB_WindowInfo[$iIndex][4] / $iX_Client_Full) - $iH_Tight
    EndIf
    Else
    $aSB_WindowInfo[$iIndex][6] = 0
    EndIf
    ; If vertical scrollbar required
    Local $iV_FullPage
    If $iV_Scroll Then
    If $fBefore Then
    ; Use actual aperture height
    $aSB_WindowInfo[$iIndex][5] = $iY_Client_Bar
    ; Determine page size (aperture width / text width)
    $iV_FullPage = Floor($aSB_WindowInfo[$iIndex][5] / $aSB_WindowInfo[$iIndex][3])
    ; Determine max size (scroll width / text width - tight)
    $aSB_WindowInfo[$iIndex][7] = Floor($iV_Scroll / $aSB_WindowInfo[$iIndex][3]) - $iV_Tight
    Else
    ; Use reduced aperture width only if other scrollbar exists
    If $iH_Scroll Then $aSB_WindowInfo[$iIndex][5] = $iY_Client_Bar
    ; Determine page size (aperture width / text width)
    $iV_FullPage = Floor($aSB_WindowInfo[$iIndex][5] / $aSB_WindowInfo[$iIndex][3])
    ; Determine max size (scroll width / text width * correction factor for H scrollbar if required - tight)
    $aSB_WindowInfo[$iIndex][7] = Floor($iV_Scroll / $aSB_WindowInfo[$iIndex][3] * $aSB_WindowInfo[$iIndex][5] / $iY_Client_Full) - $iV_Tight
    EndIf
    Else
    $aSB_WindowInfo[$iIndex][7] = 0
    EndIf
    Local $aRet[4]
    If $iV_Scroll Then
    $aRet[0] = $iX_Client_Bar
    Else
    $aRet[0] = $iX_Client_Full
    EndIf
    If $iH_Scroll Then
    $aRet[1] = $iY_Client_Bar
    Else
    $aRet[1] = $iY_Client_Full
    EndIf
    $aRet[2] = $iX_Client_Bar / $iX_Client_Full
    $aRet[3] = $iY_Client_Bar / $iY_Client_Full
    ; Save extended window info
    $aSB_WindowInfoEx[$iIndex][0] = $iH_Scroll
    $aSB_WindowInfoEx[$iIndex][1] = $iV_Scroll
    $aSB_WindowInfoEx[$iIndex][2] = $aRet[2]
    $aSB_WindowInfoEx[$iIndex][3] = $aRet[3]
    $aSB_WindowInfoEx[$iIndex][4] = $fBefore
    Local $fSuccess = True
    If _GUIScrollBars_ShowScrollBar($hWnd, $SB_BOTH, False) = False Then $fSuccess = False
    If $iH_Scroll Then
    If _GUIScrollBars_SetScrollInfoMax($hWnd, $SB_HORZ, $aSB_WindowInfo[$iIndex][6]) = False Then $fSuccess = False
    _GUIScrollBars_SetScrollInfoPage($hWnd, $SB_HORZ, $iH_FullPage)
    If @error Then $fSuccess = False
    If _GUIScrollBars_ShowScrollBar($hWnd, $SB_HORZ, True) = False Then $fSuccess = False
    Else
    If _GUIScrollBars_ShowScrollBar($hWnd, $SB_HORZ, False) = False Then $fSuccess = False
    EndIf
    If $iV_Scroll Then
    If _GUIScrollBars_SetScrollInfoMax($hWnd, $SB_VERT, $aSB_WindowInfo[$iIndex][7]) = False Then $fSuccess = False
    _GUIScrollBars_SetScrollInfoPage($hWnd, $SB_VERT, $iV_FullPage)
    If @error Then $fSuccess = False
    If _GUIScrollBars_ShowScrollBar($hWnd, $SB_VERT, True) = False Then $fSuccess = False
    Else
    If _GUIScrollBars_ShowScrollBar($hWnd, $SB_VERT, False) = False Then $fSuccess = False
    EndIf
    If $fSuccess Then Return $aRet
    Return SetError(3, 0, 0)
    EndFunc ;==>_GUIScrollbars_Generate
    ; #FUNCTION# =========================================================================================================
    ; Name...........: _GUIScrollbars_Locate_Ctrl
    ; Description ...: Calculates coordinates to use to position controls after scrollbar creation
    ; Syntax.........: _GUIScrollbars_Locate_Ctrl ($hWnd, $iX, $iY)
    ; Parameters ....: $hWnd -> GUI to contain control
    ; $iX -> Horizontal coordinate relative to scrollable area
    ; $iY -> Vertical coordinate relative to scrollable area
    ; Requirement(s).: v3.3.6.0 or higher
    ; Return values .: Success - Returns a 2-element array:
    ; [0] = Horizontal coordinate
    ; [1] = Vertical coordinate
    ; Failure - Returns either 0 with @error set as follows:
    ; 1 - Invalid window handle
    ; 2 - Parameter error
    ; 3 - Window not found
    ; Remarks .......;
    ; Author ........: Melba23
    ; Example........; Yes
    ;=====================================================================================================================
    Func _GUIScrollbars_Locate_Ctrl($hWnd, $iX, $iY)
    ; Check $hWnd
    If Not IsHWnd($hWnd) Then Return SetError(1, 0, 0)
    ; Find window info
    Local $iIndex = -1
    For $i = 0 To UBound($aSB_WindowInfo) - 1
    If $hWnd = $aSB_WindowInfo[$i][0] Then $iIndex = $i
    Next
    If $iIndex = -1 Then Return SetError(3, 0, 0)
    ; Check if location is within scrollable area of the window
    If $iX < 0 Or $iX > $aSB_WindowInfoEx[$iIndex][0] Then Return SetError(2, 0, 0)
    If $iY < 0 Or $iY > $aSB_WindowInfoEx[$iIndex][1] Then Return SetError(2, 0, 0)
    ; Calculate factored coordinates if needed
    If Not $aSB_WindowInfoEx[$iIndex][4] Then
    $iX *= $aSB_WindowInfoEx[$iIndex][2]
    $iY *= $aSB_WindowInfoEx[$iIndex][3]
    EndIf
    ; Correct for any scrollbar movement
    $iX -= _GUIScrollBars_GetScrollInfoPos($hWnd, $SB_HORZ) * $aSB_WindowInfo[$iIndex][2]
    $iY -= _GUIScrollBars_GetScrollInfoPos($hWnd, $SB_VERT) * $aSB_WindowInfo[$iIndex][3]
    Local $aRet[2] = [$iX, $iY]
    Return $aRet
    EndFunc ;==>_GUIScrollbars_Locate_Ctrl
    ; #FUNCTION# =========================================================================================================
    ; Name...........: _GUIScrollbars_Scroll_Page
    ; Description ...: Scrolls scrollbars generated by _GUIScrollbars_Generate to min, max or page number
    ; Syntax.........: _GUIScrollbars_Scroll_Page ($hWnd, [$iH_Scroll_Pos = -1, [$iV_Scroll_Pos = -1]])
    ; Parameters ....: $hWnd -> GUI to contain scrollbars
    ; $iH_Scroll_Pos -> Horizontal age number:
    ; 0 = No change
    ; 1+ = Scroll to page number
    ; If page number is over max pages, then scroll to max position
    ; $iV_Scroll_Pos -> As $iH_Scroll_Pos for vertical pages
    ; Requirement(s).: v3.3.6.0 or higher
    ; Return values .: Success: @error = 0
    ; Failure: @error set as follows:
    ; 1 - hWnd not a valid handle
    ; 2 - Scrollbars not generated in that GUI
    ; 3 - Invalid position parameters
    ; Remarks .......;
    ; Author ........: Melba23
    ; Example........; Yes
    ;=====================================================================================================================
    Func _GUIScrollbars_Scroll_Page($hWnd, $iH_Scroll_Pos = 0, $iV_Scroll_Pos = 0)
    Local $iPos
    ; Check $hWnd
    If Not IsHWnd($hWnd) Then Return SetError(1, 0, 0)
    ; Check $iH/V_Scroll_Pos
    If Not (IsInt($iH_Scroll_Pos) And IsInt($iV_Scroll_Pos)) Then Return SetError(3, 0, 0)
    ; Find window info
    Local $iIndex = -1
    For $i = 0 To UBound($aSB_WindowInfo) - 1
    If $hWnd = $aSB_WindowInfo[$i][0] Then $iIndex = $i
    Next
    If $iIndex = -1 Then Return SetError(2, 0, 0)
    ; Get page sizes
    Local $iH_Page = Floor($aSB_WindowInfo[$iIndex][4] / $aSB_WindowInfo[$iIndex][2])
    Local $iV_Page = Floor($aSB_WindowInfo[$iIndex][5] / $aSB_WindowInfo[$iIndex][3])
    If $iH_Scroll_Pos > 0 Then
    $iPos = ($iH_Scroll_Pos - 1) * $iH_Page
    If $iPos > $aSB_WindowInfo[$iIndex][6] Then $iPos = $aSB_WindowInfo[$iIndex][6]
    _GUIScrollBars_SetScrollInfoPos($hWnd, $SB_HORZ, $iPos)
    EndIf
    If $iV_Scroll_Pos > 0 Then
    $iPos = ($iV_Scroll_Pos - 1) * $iV_Page
    If $iPos > $aSB_WindowInfo[$iIndex][7] Then $iPos = $aSB_WindowInfo[$iIndex][7]
    _GUIScrollBars_SetScrollInfoPos($hWnd, $SB_VERT, $iPos)
    EndIf
    EndFunc ;==>_GUIScrollbars_Scroll_Page
    ; #FUNCTION# =========================================================================================================
    ; Name...........: _GUIScrollbars_Scroll_Pos
    ; Description ...: Scrolls scrollbars generated by _GUIScrollbars_Generate to pos
    ; Syntax.........: _GUIScrollbars_Scroll_Page ($hWnd, [$iH_Scroll_Pos = -1, [$iV_Scroll_Pos = -1]])
    ; Parameters ....: $hWnd -> GUI to contain scrollbars
    ; $iH_Scroll_Pos -> Horizontal age number:
    ; 0 = No change
    ; 1+ = Position
    ; $iV_Scroll_Pos -> As $iH_Scroll_Pos for vertical pos
    ; Requirement(s).: v3.3.6.0 or higher
    ; Return values .: Success: @error = 0
    ; Failure: @error set as follows:
    ; 1 - hWnd not a valid handle
    ; 2 - Scrollbars not generated in that GUI
    ; 3 - Invalid position parameters
    ; Remarks .......;
    ; Author ........: Melba23 / Veronesi
    ; Example........; Yes
    ;=====================================================================================================================
    Func _GUIScrollbars_Scroll_Pos($hWnd, $iH_Scroll_Pos = 0, $iV_Scroll_Pos = 0)
    Local $iPos
    ; Check $hWnd
    If Not IsHWnd($hWnd) Then Return SetError(1, 0, 0)
    ; Find window info
    Local $iIndex = -1
    For $i = 0 To UBound($aSB_WindowInfo) - 1
    If $hWnd = $aSB_WindowInfo[$i][0] Then $iIndex = $i
    Next
    If $iIndex = -1 Then Return SetError(2, 0, 0)
    If $iH_Scroll_Pos > 0 Then
    $iPos = ($iH_Scroll_Pos - 1)
    If $iPos > $aSB_WindowInfo[$iIndex][6] Then $iPos = $aSB_WindowInfo[$iIndex][6]
    _GUIScrollBars_SetScrollInfoPos($hWnd, $SB_HORZ, $iPos)
    EndIf
    If $iV_Scroll_Pos > 0 Then
    $iPos = ($iV_Scroll_Pos - 1)
    If $iPos > $aSB_WindowInfo[$iIndex][7] Then $iPos = $aSB_WindowInfo[$iIndex][7]
    _GUIScrollBars_SetScrollInfoPos($hWnd, $SB_VERT, $iPos)
    EndIf
    EndFunc ;==>_GUIScrollbars_Scroll_Pos
    ; #FUNCTION# =========================================================================================================
    ; Name...........: _GUIScrollbars_Minimize
    ; Description ...: Stores scrollbar positions on GUI minimize
    ; Syntax.........: _GUIScrollbars_Minimize($hWnd)
    ; Parameters ....: $hWnd -> GUI containing scrollbars
    ; Requirement(s).: v3.3.6.0 or higher
    ; Return values .: Success: @error = 0
    ; Failure: @error set as follows:
    ; 1 - hWnd not a valid handle
    ; 2 - Scrollbars not generated in that GUI
    ; Remarks .......;
    ; Author ........: Melba23, based on code from rover and czardas
    ; Example........; Yes
    ;=====================================================================================================================
    Func _GUIScrollbars_Minimize($hWnd)
    ; Check $hWnd
    If Not IsHWnd($hWnd) Then Return SetError(1, 0, 0)
    ; Find window info
    Local $iIndex = -1
    For $i = 0 To UBound($aSB_WindowInfo) - 1
    If $hWnd = $aSB_WindowInfo[$i][0] Then $iIndex = $i
    Next
    If $iIndex = -1 Then Return SetError(1, 0, 0)
    ; Show both scrollbars
    _GUIScrollBars_ShowScrollBar($hWnd, $SB_BOTH, True)
    ; Get vertical current position and move to top
    $aSB_WindowInfo[$iIndex][8] = _GUIScrollBars_GetScrollPos($hWnd, $SB_VERT)
    _GUIScrollBars_SetScrollInfoPos($hWnd, $SB_VERT, 0)
    ; Get horizontal current position and move to left
    $aSB_WindowInfo[$iIndex][9] = _GUIScrollBars_GetScrollPos($hWnd, $SB_HORZ)
    _GUIScrollBars_SetScrollInfoPos($hWnd, $SB_HORZ, 0)
    EndFunc
    ; #FUNCTION# =========================================================================================================
    ; Name...........: _GUIScrollbars_Restore
    ; Description ...: Restores scrollbar positions on GUI restore
    ; Syntax.........: _GUIScrollbars_Restore($hWnd[, $fVert = True[, $fHorz = True]])
    ; Parameters ....: $hWnd -> GUI containing scrollbars
    ; $fVert -> True (default) = vertical scrollbar visible; False = vertical scrollbar not visible
    ; $fHorz -> True (default) = horizontal scrollbar visible; False = horzontal scrollbar not visible
    ; Requirement(s).: v3.3.6.0 or higher
    ; Return values .: Success: @error = 0
    ; Failure: @error set as follows:
    ; 1 - hWnd not a valid handle
    ; 2 - Scrollbars not generated in that GUI
    ; Remarks .......;
    ; Author ........: Melba23, based on code from rover and czardas
    ; Example........; Yes
    ;=====================================================================================================================
    Func _GUIScrollbars_Restore($hWnd, $fVert = True, $fHorz = True)
    ; Check $hWnd
    If Not IsHWnd($hWnd) Then Return SetError(1, 0, 0)
    ; Find window info
    Local $iIndex = -1
    For $i = 0 To UBound($aSB_WindowInfo) - 1
    If $hWnd = $aSB_WindowInfo[$i][0] Then $iIndex = $i
    Next
    If $iIndex = -1 Then Return SetError(2, 0, 0)
    ; Rehide unwanted scrollbars
    If Not $fVert Then
    _GUIScrollBars_ShowScrollBar($hWnd, $SB_VERT, False)
    EndIf
    If Not $fHorz Then
    _GUIScrollBars_ShowScrollBar($hWnd, $SB_HORZ, False)
    EndIf
    ; Reset visible scrollbars to position on minimize
    If $fVert Then
    _GUIScrollBars_SetScrollInfoPos($hWnd, $SB_VERT, $aSB_WindowInfo[$iIndex][8])
    EndIf
    If $fHorz Then
    _GUIScrollBars_SetScrollInfoPos($hWnd, $SB_HORZ, $aSB_WindowInfo[$iIndex][9])
    EndIf
    EndFunc
    ; #INTERNAL_USE_ONLY#============================================================================================================
    ; Name...........: _Scrollbars_WM_VSCROLL
    ; Description ...: GUIRegisterMsg procedure for vertical scrollbar
    ; Syntax ........: _Scrollbars_WM_VSCROLL($hWnd, $iMsg, $wParam, $lParam)
    ; Return values .: None
    ; Author ........: Taken from AutoIt Help file
    ; Remarks .......: This function is used internally by _Scrollbars_Generate
    ; ===============================================================================================================================
    Func _Scrollbars_WM_VSCROLL($hWnd, $iMsg, $wParam, $lParam)
    #forceref $iMsg, $wParam, $lParam
    Local $nScrollCode = BitAND($wParam, 0x0000FFFF)
    Local $iIndex = -1, $yChar, $yPos
    Local $Min, $Max, $Page, $Pos, $TrackPos
    For $x = 0 To UBound($aSB_WindowInfo) - 1
    If $aSB_WindowInfo[$x][0] = $hWnd Then
    $iIndex = $x
    $yChar = $aSB_WindowInfo[$iIndex][3]
    ExitLoop
    EndIf
    Next
    If $iIndex = -1 Then Return 0
    Local $tSCROLLINFO = _GUIScrollBars_GetScrollInfoEx($hWnd, $SB_VERT)
    $Min = DllStructGetData($tSCROLLINFO, "nMin")
    $Max = DllStructGetData($tSCROLLINFO, "nMax")
    $Page = DllStructGetData($tSCROLLINFO, "nPage")
    $yPos = DllStructGetData($tSCROLLINFO, "nPos")
    $Pos = $yPos
    $TrackPos = DllStructGetData($tSCROLLINFO, "nTrackPos")
    Switch $nScrollCode
    Case $SB_TOP
    DllStructSetData($tSCROLLINFO, "nPos", $Min)
    Case $SB_BOTTOM
    DllStructSetData($tSCROLLINFO, "nPos", $Max)
    Case $SB_LINEUP
    DllStructSetData($tSCROLLINFO, "nPos", $Pos - 1)
    Case $SB_LINEDOWN
    DllStructSetData($tSCROLLINFO, "nPos", $Pos + 1)
    Case $SB_PAGEUP
    DllStructSetData($tSCROLLINFO, "nPos", $Pos - $Page)
    Case $SB_PAGEDOWN
    DllStructSetData($tSCROLLINFO, "nPos", $Pos + $Page)
    Case $SB_THUMBTRACK
    DllStructSetData($tSCROLLINFO, "nPos", $TrackPos)
    EndSwitch
    DllStructSetData($tSCROLLINFO, "fMask", $SIF_POS)
    _GUIScrollBars_SetScrollInfo($hWnd, $SB_VERT, $tSCROLLINFO)
    _GUIScrollBars_GetScrollInfo($hWnd, $SB_VERT, $tSCROLLINFO)
    $Pos = DllStructGetData($tSCROLLINFO, "nPos")
    If ($Pos <> $yPos) Then
    _GUIScrollBars_ScrollWindow($hWnd, 0, $yChar * ($yPos - $Pos))
    $yPos = $Pos
    EndIf
    Return $GUI_RUNDEFMSG
    EndFunc ;==>_Scrollbars_WM_VSCROLL
    ; #INTERNAL_USE_ONLY#============================================================================================================
    ; Name...........: _Scrollbars_WM_HSCROLL
    ; Description ...: GUIRegisterMsg procedure for horizontal scrollbar
    ; Syntax ........: _Scrollbars_WM_HSCROLL($hWnd, $Msg, $wParam, $lParam)
    ; Return values .: None
    ; Author ........: Taken from AutoIt Help file
    ; Remarks .......: This function is used internally by _Scrollbars_Generate
    ; ===============================================================================================================================
    Func _Scrollbars_WM_HSCROLL($hWnd, $iMsg, $wParam, $lParam)
    #forceref $iMsg, $lParam
    Local $nScrollCode = BitAND($wParam, 0x0000FFFF)
    Local $iIndex = -1, $xChar, $xPos
    Local $Page, $Pos, $TrackPos
    For $x = 0 To UBound($aSB_WindowInfo) - 1
    If $aSB_WindowInfo[$x][0] = $hWnd Then
    $iIndex = $x
    $xChar = $aSB_WindowInfo[$iIndex][2]
    ExitLoop
    EndIf
    Next
    If $iIndex = -1 Then Return 0
    Local $tSCROLLINFO = _GUIScrollBars_GetScrollInfoEx($hWnd, $SB_HORZ)
    $Page = DllStructGetData($tSCROLLINFO, "nPage")
    $xPos = DllStructGetData($tSCROLLINFO, "nPos")
    $Pos = $xPos
    $TrackPos = DllStructGetData($tSCROLLINFO, "nTrackPos")
    Switch $nScrollCode
    Case $SB_LINELEFT
    DllStructSetData($tSCROLLINFO, "nPos", $Pos - 1)
    Case $SB_LINERIGHT
    DllStructSetData($tSCROLLINFO, "nPos", $Pos + 1)
    Case $SB_PAGELEFT
    DllStructSetData($tSCROLLINFO, "nPos", $Pos - $Page)
    Case $SB_PAGERIGHT
    DllStructSetData($tSCROLLINFO, "nPos", $Pos + $Page)
    Case $SB_THUMBTRACK
    DllStructSetData($tSCROLLINFO, "nPos", $TrackPos)
    EndSwitch
    DllStructSetData($tSCROLLINFO, "fMask", $SIF_POS)
    _GUIScrollBars_SetScrollInfo($hWnd, $SB_HORZ, $tSCROLLINFO)
    _GUIScrollBars_GetScrollInfo($hWnd, $SB_HORZ, $tSCROLLINFO)
    $Pos = DllStructGetData($tSCROLLINFO, "nPos")
    If ($Pos <> $xPos) Then _GUIScrollBars_ScrollWindow($hWnd, $xChar * ($xPos - $Pos), 0)
    Return $GUI_RUNDEFMSG
    EndFunc ;==>_Scrollbars_WM_HSCROLL
    ; #INTERNAL_USE_ONLY#============================================================================================================
    ; Name...........: _Scrollbars_WM_MOUSEWHEEL
    ; Description ...: GUIRegisterMsg procedure for vertical mouse wheel scroll
    ; Syntax ........: _Scrollbars_WM_MOUSEWHEEL($hWnd, $iMsg, $wParam, $lParam)
    ; Return values .: None
    ; Author ........: Based on code from MrCreator & Malkey
    ; Remarks .......: This function is used internally by _Scrollbars_Generate
    ; ===============================================================================================================================
    Func _Scrollbars_WM_MOUSEWHEEL($hWnd, $iMsg, $wParam, $lParam)
    #forceref $hWnd, $iMsg, $lParam
    Local $iDirn, $iDelta = BitShift($wParam, 16) ; Mouse wheel movement
    If BitAND($wParam, 0x0000FFFF) Then ; If Ctrl or Shft pressed move Horz scrollbar
    $iDirn = $SB_LINERIGHT
    If $iDelta > 0 Then $iDirn = $SB_LINELEFT
    For $i = 1 To 7
    _SendMessage($hWnd, $WM_HSCROLL, $iDirn)
    Next
    Else ; Move Vert scrollbar
    $iDirn = $SB_LINEDOWN
    If $iDelta > 0 Then $iDirn = $SB_LINEUP
    _SendMessage($hWnd, $WM_VSCROLL, $iDirn)
    EndIf
    Return $GUI_RUNDEFMSG
    EndFunc ;==>_Scrollbars_WM_MOUSEWHEEL
    ; #INTERNAL_USE_ONLY#============================================================================================================
    ; Name...........: _Scrollbars_WM_MOUSEHWHEEL
    ; Description ...: GUIRegisterMsg procedure for horizontal mouse wheel scroll
    ; Syntax ........: _Scrollbars_WM_MOUSEWHEEL($hWnd, $iMsg, $wParam, $lParam)
    ; Return values .: None
    ; Author ........: Based on code from MSDN, MrCreator & Malkey
    ; Remarks .......: This function is used internally by _Scrollbars_Generate
    ; ===============================================================================================================================
    Func _Scrollbars_WM_MOUSEHWHEEL($hWnd, $iMsg, $wParam, $lParam)
    #forceref $hWnd, $iMsg, $lParam
    Local $iDirn = $SB_LINERIGHT
    If BitShift($wParam, 16) > 0 Then $iDirn = $SB_LINELEFT ; Mouse wheel movement
    For $i = 1 To 7
    _SendMessage($hWnd, $WM_HSCROLL, $iDirn)
    Next
    Return $GUI_RUNDEFMSG
    EndFunc ;==>_Scrollbars_WM_MOUSEHWHEEL

    [/autoit]

    Wer kann mir helfen, dass nun auch noch die Events auf die Buttons ohne Doppelklick klappen?
    Veronesi

    PS: Sorry für die Formatierung des Skriptes. Windows 8 scheint die Tabs hier im Forum immer zu ignorieren.
    Also einfach mal Ctrl + T für Tidy benutzen :)

  • Scroll GUI mit MouseDrag

    • veronesi
    • 31. März 2013 um 15:39

    Doch, das ginge schon.
    Ich kann eine GUIRegisterMsg auf die beiden Events machen und darin die Zeit stoppen.
    Doch wie kann ich das GUI automatisch mit dem Finger "mitscrollen"?

  • Scroll GUI mit MouseDrag

    • veronesi
    • 31. März 2013 um 13:31

    Hallo Zusammen

    Für ein neues Projekt habe ich die tolle Scrollbar UDF von hier verwendet: Link
    Dann z.B. dieses Beispiel-Skript:

    [autoit]


    #include <GUIConstantsEx.au3>
    #include "GUIScrollbars_Ex.au3"
    ; Create GUI with red background
    $hGUI = GUICreate("Test", 500, 500)
    GUISetBkColor(0xFF0000, $hGUI)
    ; Create a 1000x1000 green label
    GUICtrlCreateLabel("", 0, 0, 1000, 1000)
    GUICtrlSetBkColor(-1, 0x00FF00)
    GUISetState()
    ; Generate scrollbars - Yes, this is all you need to do!!!!!!!!!!!!!!!!!!!!
    _GUIScrollbars_Generate($hGUI, 1000, 1000)
    While 1
    Switch GUIGetMsg()
    Case $GUI_EVENT_CLOSE
    Exit
    EndSwitch
    WEnd

    [/autoit]

    Das funktioniert soweit alles einwandfrei, so wie es soll.
    Nun die grosse Frage: Ich möchte, dass man auf dieser GUI umherscrollen kann, wie unter Windows 8. Also dass man mit dem Finger oder dem Touchpen auf dem Touchscreen herumfahren kann und dabei die GUI mitscrollt.

    Also auch ähnlich wie auf allen Smartphones heute.

    Wie kann ich das bewerkstelligen?
    Erschwerend kommt hinzu, dass die GUI mit dutzenden von Bildern horizontal gescrollt werden kann. Und jedem Bild ist ein GUICtrlSetOnEvent zugeordnet.

    Ich muss also einen einfachen Klick von einem "MouseDrag" unterscheiden können.

    Vielen Dank für Eure Hilfe!
    Veronesi

  • Windows 8 mit Touch und GUI_EVENT_PrimaryDown

    • veronesi
    • 27. März 2013 um 06:46

    So, nun habe ich doch noch eine Lösung dafür gefunden.
    Es gibt (mindestens momentan) eine Konstante die nicht benannt wird. Der Wert ist 0x02CC.

    Damit können mit einer GUIRegisterMsg alle Finger-Touch und Pen-Touch Gesten abgefangen werden.
    Genau das, was ich im Moment benötige!

    [autoit]


    #include <GUIConstantsEx.au3>
    Opt("GUIOnEventMode", 1)

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

    Global $hGUI1 = GUICreate("Test", 800, 600)
    GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit", $hGUI1)
    GUISetOnEvent($GUI_EVENT_PRIMARYDOWN, "_MouseClick", $hGUI1)
    GUISetState(@SW_SHOW)

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

    Global Const $WM_GESTURENOTIFY = 0x011A ;Detect only finger, but not pen!
    Global Const $WM_TABLET_UNKNOWN = 0x02CC
    GUIRegisterMsg($WM_TABLET_UNKNOWN, "_TouchTablet")

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

    While True
    Sleep(500)
    WEnd

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

    Func _MouseClick()
    ConsoleWrite("Touch with mouse!" & @CRLF)
    EndFunc

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

    Func _TouchTablet($hWnd, $Msg, $wParam, $lParam)
    ConsoleWrite("Touch on Tablet!" & @CRLF)
    Return $GUI_RUNDEFMSG
    EndFunc

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

    Func _Exit()
    Exit
    EndFunc

    [/autoit]

    Gruss Veronesi

  • Windows 8 mit Touch und GUI_EVENT_PrimaryDown

    • veronesi
    • 24. März 2013 um 20:39

    Das folgende Skript funktioniert nun, wenn man mit dem Finger die Touchoberfläche bedient.
    Leider passiert mit einem Touchpen nichts!

    [autoit]


    #include <GUIConstantsEx.au3>
    Opt("GUIOnEventMode", 1)
    Global $hGUI1 = GUICreate("Test", 800, 600)
    GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit", $hGUI1)
    ;GUISetOnEvent($GUI_EVENT_PRIMARYDOWN, "_MouseClick", $hGUI1)
    GUISetState(@SW_SHOW)

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

    Global Const $WM_GESTURENOTIFY = 0x011A
    GUIRegisterMsg($WM_GESTURENOTIFY, "_TouchFinger")
    While True
    Sleep(500)
    WEnd

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

    Func _TouchFinger($hWnd, $Msg, $wParam, $lParam)
    ConsoleWrite("Touch with finger!" & @CRLF)
    Return $GUI_RUNDEFMSG
    EndFunc

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

    Func _Exit()
    Exit
    EndFunc

    [/autoit]


    Gruss, Veronesi

  • Windows 8 mit Touch und GUI_EVENT_PrimaryDown

    • veronesi
    • 24. März 2013 um 17:28

    OK, mit diesem Skript bekomme ich jedes Mal einen Event, wenn ich mit dem Stylus (oder Finger) auf den Titelrahmen der GUI tippe. Schon mal sehr gut! Aber eigentlich soll es auch - oder nur funktionieren, wenn ich innerhalb der GUI klicke!

    [autoit]

    #include <GUIConstantsEx.au3>
    Opt("GUIOnEventMode", 1)
    Global $hGUI1 = GUICreate("Test", 800, 600)
    GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit", $hGUI1)
    ;GUISetOnEvent($GUI_EVENT_PRIMARYDOWN, "_MouseClick", $hGUI1)
    GUISetState(@SW_SHOW)

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

    Global Const $WM_TOUCHUP = 0x0242
    GUIRegisterMsg($WM_TOUCHUP, "_Test")

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

    While True
    Sleep(500)
    WEnd

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

    Func _Test($hWnd, $Msg, $wParam, $lParam)
    MsgBox(64,"info","click")
    Return $GUI_RUNDEFMSG
    EndFunc

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

    Func _MouseClick()
    MsgBox(64,"info","click")
    EndFunc

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

    Func _Exit()
    Exit
    EndFunc

    [/autoit]

    Eine Idee?

    Gruss, Veronesi

  • Windows 8 mit Touch und GUI_EVENT_PrimaryDown

    • veronesi
    • 24. März 2013 um 15:26

    Hallo Zusammen!

    Ich habe ein Problem im Zusammenhang mit Windows 8 und einem Touchscreen.
    Und zwar möchte ich einen Event setzen, der ausgelöst wird, sobald die Maustaste bzw. der Touchbildschirm gedrückt wird.

    Ich verwende untenstehenden Code.

    [autoit]


    #include <GUIConstantsEx.au3>
    Opt("GUIOnEventMode", 1)
    Global $hGUI1 = GUICreate("Test", 800, 600)
    GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit", $hGUI1)
    GUISetOnEvent($GUI_EVENT_PRIMARYDOWN, "_MouseClick", $hGUI1)
    GUISetState(@SW_SHOW)

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

    While True
    Sleep(500)
    WEnd

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

    Func _MouseClick()
    MsgBox(64,"info","click")
    EndFunc

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

    Func _Exit()
    Exit
    EndFunc

    [/autoit]

    Der funktioniert auch einwandfrei, wenn ich mit einer "normalen" Maus klicke.
    Wennn ich jedoch auf dem Touchscreen tippe (Finger) oder mit dem Touchpen auf den Bildschirm drücke, dann passiert nichts.
    Das heisst, wenn ich einen Doppelklick auf den Bildschirm mache, erst dann wird die Funktion "_MouseClick" ausgeführt. Doch ein Doppelklick ist auf einem Touchgerät etwas schwieriger, als mit einer Maus!

    Klar, es gibt andere Codes hier im Forum, die einen Maushook setzen. Das habe ich getestet und es funktioniert sogar mit Touch. Aber dies ist halt sehr ressourcenhungrig.

    Deshalb hier meine Frage: Warum läuft der Befehl GUISetOnEvent($GUI_EVENT_PRIMARYDOWN, "_MouseClick", $hGUI1) nicht mit einem einfachen Klick auf dem Touch? Der Clou ist ja, dass die Funktion "$GUI_EVENT_Close" auf auf dem Touch mit einem einfachen Klick funktioniert!

    Gruss Veronesi

  • Singleton funktioniert nicht :(

    • veronesi
    • 28. Februar 2013 um 07:07

    Oscar

    Dann kompiliere mal dieses Script und lasse es zweimal laufen.

    [autoit]


    If WinExists(StringTrimRight(@ScriptName, 4) & "1") Then Exit MsgBox(64, "Hinweis", "Programm läuft schon")
    AutoItWinSetTitle(StringTrimRight(@ScriptName, 4) & "1")
    Sleep(20000)

    [/autoit]

    Auch ohne GUI hat jedes AutoIt Script ein (verstecktes) Fenster.

    Gruss Veronesi

  • Singleton funktioniert nicht :(

    • veronesi
    • 27. Februar 2013 um 13:53

    Warum nicht mit einem einfachen Zweizeiler?

    [autoit]


    If WinExists(StringTrimRight(@ScriptName, 4) & "1") Then Exit ;Allow only one instance of this script!
    AutoItWinSetTitle(StringTrimRight(@ScriptName, 4) & "1")

    [/autoit]

    Gruss, Veronesi

  • Listbox Einträge die in sich das '|' (pipe) Zeichen beinhalten ...

    • veronesi
    • 15. Februar 2013 um 09:49

    Du könntest z.B. mit GUIDataSeparatorChar ein anderes Trennzeichen (welches nicht vorkommt) verwenden:

    [autoit]

    #include <GUIConstantsEx.au3>
    Opt("GUIDataSeparatorChar", "¦")
    cdeListbox()
    Func cdeListbox()
    Local $msg
    GUICreate("My GUI combo") ; will create a dialog box that when displayed is centered
    $pattern = ".+\.(nsf|ntf|NSF|NTF)"
    GUICtrlCreateCombo("*.*", 10, 10) ; create first item
    GUICtrlSetData(-1, $pattern & '¦item1¦item2¦item3', 'item3') ; add other item and set a new default
    GUISetState()
    ; Run the GUI until the dialog is closed
    While 1
    $msg = GUIGetMsg()
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    WEnd
    EndFunc ;==>cdeListbox

    [/autoit]
  • Änderungen einer .ini Datei vor einer portablen App neu Includen

    • veronesi
    • 30. Januar 2013 um 08:46

    Du könntest Dein eigenes Programm zur Laufzeit neu kompilieren. Dann natürlich mit der neuen INI als Fileinstall drin.
    Aber ob das der richtige Weg ist, bleibt mal noch offen.

    Weiter kannst Du, wenn Du durchgehend das NTFS Dateisystem nutzt, die Datei in einen Alternativen Datenstrom der Exe Datei includen.
    Ich mache das gelegentlich mit Lizenzen. Aber sobald Du die Exe Datei auf einen Nicht-NTFS Datenträger kopierst (USB-Stick, externe HDD, Webserver....) dann geht der alternative Datenstrom verloren.

    Ist also keine wirklich elegante und zukunftssichere Lösung!

    Aber es stellt sich die Frage, warum Du die Datei wieder in die Exe reinbringen möchtest.
    Kannst Du Deine Einstellungen nicht in der INI-Datei lassen oder in die Registry eintragen?

    Veronesi

  • Menü lässt sich nicht über Metro (Windows 8 Kacheloberfläche) legen

    • veronesi
    • 1. Januar 2013 um 11:26

    @ _DICE_
    Und wie bekommst Du das Handle der Metro UI raus?


    Edit:
    Es geht z.B. so:

    [autoit]

    Send("{LWIN}")
    Sleep(2000)
    $hMetro = WinGetHandle("")

    [/autoit]
  • ListView Darstellungsproblem unter Windows XP

    • veronesi
    • 30. November 2012 um 14:58

    Leider nicht.
    Der Kunde hat genaue Vorstellungen, wann die Zeile umgebrochen werden darf, und wann nicht.
    Alles leider etwas komplizierter.

    Aber mal sehen. Vielleicht lässt sich mit Ersetzen doch etwas machen.

    Ich schaue mir das nächste Woche nochmals an.
    Danke für die Inputs!

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™