Jump to content
PascalT

Window is freezing when I scroll fast and then switch the window

Recommended Posts

PascalT

Hello everyone,

 

just as a little note: this is my first post so please let me know if I've done somethign wrong.

I've written a programm that should read an ini-file to checkwhich software is assigned to a specific PC. The software deployment software in our company uses this ini-file and i want to make this file graphical. In my example code below I'm creating all the arrays myself, in the main programm these arrays are filled in a step earlier (the complete code has arround 2500 lines of code and some of that is company intern stuff so I can't paste the complete code, thats why I've created this little snippet that you can see below.).

 

So now we finally get to the problem I have. If I run this script and scroll up and down for a bit (only when I scroll a little bit faster) and then switch to a different window, for example Outlook, my whole PC freezes and I can't do anything. I can't even press CTRL+ALT+DEL to open up the Task-Manager. After a little while the PC unfreezes and I can exit the program. This problem also occures on other PCs. When I use the arrow buttons below and above the scrollbars to scroll through the window it works completly fine. The more lines I add to the array the longer and faster everything freezes. For creating the scrollbars im using the UDF from @Melba23 (which is really helpfull).

 

Short explanation to the code below:

There are some german definitions for the variables because I live in germany so my code is normally written in german.

$aSections: In the complete code this array is filled by using INIReadSectionNames and it is way bigger than that (arround 800 entries).

$aAusnahmen: This array is filled with special sections names where the normal process of installing something (I want to use the Inputs for that later on) doesn't fit so I will add another process.

$aZugewieseneSoftware (engl.: assigned software): This array is filled with the before collected Section Names and a 0 if the software isn't assigned through the ini-file and a 1 if the software is assigned through the ini-file. This array is created automatically in an earlier step that i haven't included in this snippet.

 

I really hope that you can help me with my problem. If you have any questions let me know and I will answer them ASAP.

 

Regards,

Pascal

 

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <ComboConstants.au3>
#include <Array.au3>
#include <GuiComboBox.au3>
#include <EditConstants.au3>
#include <GUIScrollbars_EX.au3>
#include <ColorConstants.au3>

#Region Array definition
; This array is normally filled with Software-Names thats why it is getting sorted later on
Dim $aSections[101]
$aSections[1] = "Test1"
$aSections[2] = "Test2"
$aSections[3] = "Test3"
$aSections[4] = "Test4"
$aSections[5] = "Test5"
$aSections[6] = "Test6"
$aSections[7] = "Test7"
$aSections[8] = "Test8"
$aSections[9] = "Test9"
$aSections[10] = "Test10"
$aSections[11] = "Test11"
$aSections[12] = "Test12"
$aSections[13] = "Test13"
$aSections[14] = "Test14"
$aSections[15] = "Test15"
$aSections[16] = "Test16"
$aSections[17] = "Test17"
$aSections[18] = "Test18"
$aSections[19] = "Test19"
$aSections[20] = "Test20"
$aSections[21] = "Test21"
$aSections[22] = "Test22"
$aSections[23] = "Test23"
$aSections[24] = "Test24"
$aSections[25] = "Test25"
$aSections[26] = "Test26"
$aSections[27] = "Test27"
$aSections[28] = "Test28"
$aSections[29] = "Test29"
$aSections[30] = "Test30"
$aSections[31] = "Test31"
$aSections[32] = "Test32"
$aSections[33] = "Test33"
$aSections[34] = "Test34"
$aSections[35] = "Test35"
$aSections[36] = "Test36"
$aSections[37] = "Test37"
$aSections[38] = "Test38"
$aSections[39] = "Test39"
$aSections[40] = "Test40"
$aSections[41] = "Test41"
$aSections[42] = "Test42"
$aSections[43] = "Test43"
$aSections[44] = "Test44"
$aSections[45] = "Test45"
$aSections[46] = "Test46"
$aSections[47] = "Test47"
$aSections[48] = "Test48"
$aSections[49] = "Test49"
$aSections[50] = "Test50"
$aSections[51] = "Test51"
$aSections[52] = "Test52"
$aSections[53] = "Test53"
$aSections[54] = "Test54"
$aSections[55] = "Test55"
$aSections[56] = "Test56"
$aSections[57] = "Test57"
$aSections[58] = "Test58"
$aSections[59] = "Test59"
$aSections[60] = "Test60"
$aSections[61] = "Test61"
$aSections[62] = "Test62"
$aSections[63] = "Test63"
$aSections[64] = "Test64"
$aSections[65] = "Test65"
$aSections[66] = "Test66"
$aSections[67] = "Test67"
$aSections[68] = "Test68"
$aSections[69] = "Test69"
$aSections[70] = "Test70"
$aSections[71] = "Test71"
$aSections[72] = "Test72"
$aSections[73] = "Test73"
$aSections[74] = "Test74"
$aSections[75] = "Test75"
$aSections[76] = "Test76"
$aSections[77] = "Test77"
$aSections[78] = "Test78"
$aSections[79] = "Test79"
$aSections[80] = "Test80"
$aSections[81] = "Test81"
$aSections[82] = "Test82"
$aSections[83] = "Test83"
$aSections[84] = "Test84"
$aSections[85] = "Test85"
$aSections[86] = "Test86"
$aSections[87] = "Test87"
$aSections[88] = "Test88"
$aSections[89] = "Test89"
$aSections[90] = "Test90"
$aSections[91] = "Test91"
$aSections[92] = "Test92"
$aSections[93] = "Test93"
$aSections[94] = "Test94"
$aSections[95] = "Test95"
$aSections[96] = "Test96"
$aSections[97] = "Test97"
$aSections[98] = "Test98"
$aSections[99] = "Test99"
$aSections[100] = "Test100"



Dim $aAusnahmen[5]
$aAusnahmen[0] = "Test20"
$aAusnahmen[1] = "Test35"
$aAusnahmen[2] = "Test54"
$aAusnahmen[3] = "Test60"
$aAusnahmen[4] = "Test70"

Dim $aZugewieseneSoftware[101] [2]
$aZugewieseneSoftware[1] [0] = "Test1"
$aZugewieseneSoftware[2] [0] = "Test2"
$aZugewieseneSoftware[3] [0] = "Test3"
$aZugewieseneSoftware[4] [0] = "Test4"
$aZugewieseneSoftware[5] [0] = "Test5"
$aZugewieseneSoftware[6] [0] = "Test6"
$aZugewieseneSoftware[7] [0] = "Test7"
$aZugewieseneSoftware[8] [0] = "Test8"
$aZugewieseneSoftware[9] [0] = "Test9"
$aZugewieseneSoftware[10] [0] = "Test10"
$aZugewieseneSoftware[11] [0] = "Test11"
$aZugewieseneSoftware[12] [0] = "Test12"
$aZugewieseneSoftware[13] [0] = "Test13"
$aZugewieseneSoftware[14] [0] = "Test14"
$aZugewieseneSoftware[15] [0] = "Test15"
$aZugewieseneSoftware[16] [0] = "Test16"
$aZugewieseneSoftware[17] [0] = "Test17"
$aZugewieseneSoftware[18] [0] = "Test18"
$aZugewieseneSoftware[19] [0] = "Test19"
$aZugewieseneSoftware[20] [0] = "Test20"
$aZugewieseneSoftware[21] [0] = "Test21"
$aZugewieseneSoftware[22] [0] = "Test22"
$aZugewieseneSoftware[23] [0] = "Test23"
$aZugewieseneSoftware[24] [0] = "Test24"
$aZugewieseneSoftware[25] [0] = "Test25"
$aZugewieseneSoftware[26] [0] = "Test26"
$aZugewieseneSoftware[27] [0] = "Test27"
$aZugewieseneSoftware[28] [0] = "Test28"
$aZugewieseneSoftware[29] [0] = "Test29"
$aZugewieseneSoftware[30] [0] = "Test30"
$aZugewieseneSoftware[31] [0] = "Test31"
$aZugewieseneSoftware[32] [0] = "Test32"
$aZugewieseneSoftware[33] [0] = "Test33"
$aZugewieseneSoftware[34] [0] = "Test34"
$aZugewieseneSoftware[35] [0] = "Test35"
$aZugewieseneSoftware[36] [0] = "Test36"
$aZugewieseneSoftware[37] [0] = "Test37"
$aZugewieseneSoftware[38] [0] = "Test38"
$aZugewieseneSoftware[39] [0] = "Test39"
$aZugewieseneSoftware[40] [0] = "Test40"
$aZugewieseneSoftware[41] [0] = "Test41"
$aZugewieseneSoftware[42] [0] = "Test42"
$aZugewieseneSoftware[43] [0] = "Test43"
$aZugewieseneSoftware[44] [0] = "Test44"
$aZugewieseneSoftware[45] [0] = "Test45"
$aZugewieseneSoftware[46] [0] = "Test46"
$aZugewieseneSoftware[47] [0] = "Test47"
$aZugewieseneSoftware[48] [0] = "Test48"
$aZugewieseneSoftware[49] [0] = "Test49"
$aZugewieseneSoftware[50] [0] = "Test50"
$aZugewieseneSoftware[51] [0] = "Test51"
$aZugewieseneSoftware[52] [0] = "Test52"
$aZugewieseneSoftware[53] [0] = "Test53"
$aZugewieseneSoftware[54] [0] = "Test54"
$aZugewieseneSoftware[55] [0] = "Test55"
$aZugewieseneSoftware[56] [0] = "Test56"
$aZugewieseneSoftware[57] [0] = "Test57"
$aZugewieseneSoftware[58] [0] = "Test58"
$aZugewieseneSoftware[59] [0] = "Test59"
$aZugewieseneSoftware[60] [0] = "Test60"
$aZugewieseneSoftware[61] [0] = "Test61"
$aZugewieseneSoftware[62] [0] = "Test62"
$aZugewieseneSoftware[63] [0] = "Test63"
$aZugewieseneSoftware[64] [0] = "Test64"
$aZugewieseneSoftware[65] [0] = "Test65"
$aZugewieseneSoftware[66] [0] = "Test66"
$aZugewieseneSoftware[67] [0] = "Test67"
$aZugewieseneSoftware[68] [0] = "Test68"
$aZugewieseneSoftware[69] [0] = "Test69"
$aZugewieseneSoftware[70] [0] = "Test70"
$aZugewieseneSoftware[71] [0] = "Test71"
$aZugewieseneSoftware[72] [0] = "Test72"
$aZugewieseneSoftware[73] [0] = "Test73"
$aZugewieseneSoftware[74] [0] = "Test74"
$aZugewieseneSoftware[75] [0] = "Test75"
$aZugewieseneSoftware[76] [0] = "Test76"
$aZugewieseneSoftware[77] [0] = "Test77"
$aZugewieseneSoftware[78] [0] = "Test78"
$aZugewieseneSoftware[79] [0] = "Test79"
$aZugewieseneSoftware[80] [0] = "Test80"
$aZugewieseneSoftware[81] [0] = "Test81"
$aZugewieseneSoftware[82] [0] = "Test82"
$aZugewieseneSoftware[83] [0] = "Test83"
$aZugewieseneSoftware[84] [0] = "Test84"
$aZugewieseneSoftware[85] [0] = "Test85"
$aZugewieseneSoftware[86] [0] = "Test86"
$aZugewieseneSoftware[87] [0] = "Test87"
$aZugewieseneSoftware[88] [0] = "Test88"
$aZugewieseneSoftware[89] [0] = "Test89"
$aZugewieseneSoftware[90] [0] = "Test90"
$aZugewieseneSoftware[91] [0] = "Test91"
$aZugewieseneSoftware[92] [0] = "Test92"
$aZugewieseneSoftware[93] [0] = "Test93"
$aZugewieseneSoftware[94] [0] = "Test94"
$aZugewieseneSoftware[95] [0] = "Test95"
$aZugewieseneSoftware[96] [0] = "Test96"
$aZugewieseneSoftware[97] [0] = "Test97"
$aZugewieseneSoftware[98] [0] = "Test98"
$aZugewieseneSoftware[99] [0] = "Test99"
$aZugewieseneSoftware[100] [0] = "Test100"

$aZugewieseneSoftware[1] [1] = "1"
$aZugewieseneSoftware[2] [1] = "1"
$aZugewieseneSoftware[3] [1] = "1"
$aZugewieseneSoftware[4] [1] = "0"
$aZugewieseneSoftware[5] [1] = "1"
$aZugewieseneSoftware[6] [1] = "1"
$aZugewieseneSoftware[7] [1] = "0"
$aZugewieseneSoftware[8] [1] = "1"
$aZugewieseneSoftware[9] [1] = "1"
$aZugewieseneSoftware[10] [1] = "0"
$aZugewieseneSoftware[11] [1] = "0"
$aZugewieseneSoftware[12] [1] = "0"
$aZugewieseneSoftware[13] [1] = "1"
$aZugewieseneSoftware[14] [1] = "0"
$aZugewieseneSoftware[15] [1] = "1"
$aZugewieseneSoftware[16] [1] = "1"
$aZugewieseneSoftware[17] [1] = "1"
$aZugewieseneSoftware[18] [1] = "0"
$aZugewieseneSoftware[19] [1] = "1"
$aZugewieseneSoftware[20] [1] = "0"
$aZugewieseneSoftware[21] [1] = "0"
$aZugewieseneSoftware[22] [1] = "0"
$aZugewieseneSoftware[23] [1] = "1"
$aZugewieseneSoftware[24] [1] = "0"
$aZugewieseneSoftware[25] [1] = "1"
$aZugewieseneSoftware[26] [1] = "1"
$aZugewieseneSoftware[27] [1] = "1"
$aZugewieseneSoftware[28] [1] = "0"
$aZugewieseneSoftware[29] [1] = "0"
$aZugewieseneSoftware[30] [1] = "0"
$aZugewieseneSoftware[31] [1] = "0"
$aZugewieseneSoftware[32] [1] = "0"
$aZugewieseneSoftware[33] [1] = "0"
$aZugewieseneSoftware[34] [1] = "1"
$aZugewieseneSoftware[35] [1] = "1"
$aZugewieseneSoftware[36] [1] = "0"
$aZugewieseneSoftware[37] [1] = "0"
$aZugewieseneSoftware[38] [1] = "0"
$aZugewieseneSoftware[39] [1] = "1"
$aZugewieseneSoftware[40] [1] = "1"
$aZugewieseneSoftware[41] [1] = "1"
$aZugewieseneSoftware[42] [1] = "1"
$aZugewieseneSoftware[43] [1] = "0"
$aZugewieseneSoftware[44] [1] = "0"
$aZugewieseneSoftware[45] [1] = "1"
$aZugewieseneSoftware[46] [1] = "1"
$aZugewieseneSoftware[47] [1] = "1"
$aZugewieseneSoftware[48] [1] = "1"
$aZugewieseneSoftware[49] [1] = "0"
$aZugewieseneSoftware[50] [1] = "0"
$aZugewieseneSoftware[51] [1] = "0"
$aZugewieseneSoftware[52] [1] = "1"
$aZugewieseneSoftware[53] [1] = "1"
$aZugewieseneSoftware[54] [1] = "1"
$aZugewieseneSoftware[55] [1] = "1"
$aZugewieseneSoftware[56] [1] = "0"
$aZugewieseneSoftware[57] [1] = "0"
$aZugewieseneSoftware[58] [1] = "1"
$aZugewieseneSoftware[59] [1] = "1"
$aZugewieseneSoftware[60] [1] = "1"
$aZugewieseneSoftware[61] [1] = "0"
$aZugewieseneSoftware[62] [1] = "1"
$aZugewieseneSoftware[63] [1] = "1"
$aZugewieseneSoftware[64] [1] = "0"
$aZugewieseneSoftware[65] [1] = "0"
$aZugewieseneSoftware[66] [1] = "0"
$aZugewieseneSoftware[67] [1] = "0"
$aZugewieseneSoftware[68] [1] = "1"
$aZugewieseneSoftware[69] [1] = "1"
$aZugewieseneSoftware[70] [1] = "1"
$aZugewieseneSoftware[71] [1] = "0"
$aZugewieseneSoftware[72] [1] = "1"
$aZugewieseneSoftware[73] [1] = "0"
$aZugewieseneSoftware[74] [1] = "1"
$aZugewieseneSoftware[75] [1] = "0"
$aZugewieseneSoftware[76] [1] = "0"
$aZugewieseneSoftware[77] [1] = "0"
$aZugewieseneSoftware[78] [1] = "0"
$aZugewieseneSoftware[79] [1] = "1"
$aZugewieseneSoftware[80] [1] = "1"
$aZugewieseneSoftware[81] [1] = "0"
$aZugewieseneSoftware[82] [1] = "0"
$aZugewieseneSoftware[83] [1] = "0"
$aZugewieseneSoftware[84] [1] = "1"
$aZugewieseneSoftware[85] [1] = "0"
$aZugewieseneSoftware[86] [1] = "1"
$aZugewieseneSoftware[87] [1] = "0"
$aZugewieseneSoftware[88] [1] = "1"
$aZugewieseneSoftware[89] [1] = "0"
$aZugewieseneSoftware[90] [1] = "1"
$aZugewieseneSoftware[91] [1] = "0"
$aZugewieseneSoftware[92] [1] = "1"
$aZugewieseneSoftware[93] [1] = "1"
$aZugewieseneSoftware[94] [1] = "0"
$aZugewieseneSoftware[95] [1] = "0"
$aZugewieseneSoftware[96] [1] = "0"
$aZugewieseneSoftware[97] [1] = "1"
$aZugewieseneSoftware[98] [1] = "1"
$aZugewieseneSoftware[99] [1] = "1"
$aZugewieseneSoftware[100] [1] = "1"
#EndRegion
$aSectionsSortiert = $aSections
_ArraySort($aSectionsSortiert)

Dim $Button_Software[1]
Dim $Label_Software[1]
Dim $SpacerHorz[1]
$iLabelHoehe = 15
$iButtonHoehe = 15
$iSpacerHoehe = 0


$gHoehe = 90 + UBound($aSections) * 45.8
If $gHoehe >= 600 Then
    $gHoehe2 = 600
Else
    $gHoehe2 = $gHoehe
EndIf
$BWB_Softwareverwaltung = GUICreate("BWB-GUI | Softwareverwaltung", 630, $gHoehe2)
$iLabelHoehe = 35
$iButtonHoehe = 35
$iSpacerHoehe = 20
GUISetFont(12, 400, 0, "Calibri")
$NeuenPC_MitAnpassungen = GUICtrlCreateButton("Edited copy of devices", 16, 5, 243, 25) ; This Button has no function in the shorted down version
$Button_Ausfuehren = GUICtrlCreateButton("Save!", 528, 5, 75, 25) ; This Button has no function in the shorted down version

For $i = 1 To (UBound($aSectionsSortiert) -1)
;~ For $i = 1 To 50
    $iSpacerHoehe += 45
    Redim $Label_Software[Ubound($Label_Software) +1]
    Redim $Button_Software[Ubound($Button_Software) +1]
    Redim $SpacerHorz[Ubound($SpacerHorz) +1]
    $Label_Software[$i] = GUICtrlCreateLabel($aSectionsSortiert[$i], 16, $iLabelHoehe, 447, 23)
    $SpacerHorz[$i] = GUICtrlCreateLabel("", 0, $iSpacerHoehe, 850, 2, $SS_ETCHEDHORZ)

    $sAusnahmen = _ArrayToString($aAusnahmen, ",")
    If Not StringRegExp($sAusnahmen, "(?i)\b(" & $aSectionsSortiert[$i] & ")\b") Then
        If $aZugewieseneSoftware[$i] [1] = 1 Then
            $Button_Software[$i] = GUICtrlCreateInput("1", 528, $iButtonHoehe, 75, 23, BitOR($GUI_SS_DEFAULT_INPUT,$ES_NUMBER))
            GUICtrlSetColor(-1, $COLOR_GREEN)
        Else
            $Button_Software[$i] = GUICtrlCreateInput("0", 528, $iButtonHoehe, 75, 23, BitOR($GUI_SS_DEFAULT_INPUT,$ES_NUMBER))
            GUICtrlSetColor(-1, $COLOR_RED)
        EndIf
    EndIf
    $iLabelHoehe = $iSpacerHoehe + 5
    $iButtonHoehe = $iLabelHoehe + 5
Next

If $gHoehe >= 600 Then
    _GUiScrollBars_Generate($BWB_Softwareverwaltung, 870, $gHoehe)
    _GUIScrollBars_ShowScrollBar($BWB_Softwareverwaltung, $SB_HORZ, False)
EndIf
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
        Switch $nMsg
            Case $GUI_EVENT_CLOSE
                Exit
            Case $NeuenPC_MitAnpassungen
                ;//
            Case $Button_Ausfuehren
                ;//
        EndSwitch
WEnd

 

Share this post


Link to post
Share on other sites
Melba23

PascalT,

Welcome to the AutoIt forums.

I have tried scrolling the GUI really quickly for a good time and I have no problems when I switch windows to any other one. Unless someone else can reproduce it, it looks like it might be a problem in your environment, sorry.

M23

P.S. And a couple of points about your script:

1. It is much easier to declare those arrays in loops:

#Region Array definition
; This array is normally filled with Software-Names thats why it is getting sorted later on
Global $aSections[101]
For $i = 1 To 100
    $aSections[$i] = "Test" & $i
Next

Global $aAusnahmen[5]
$aAusnahmen[0] = "Test20"
$aAusnahmen[1] = "Test35"
$aAusnahmen[2] = "Test54"
$aAusnahmen[3] = "Test60"
$aAusnahmen[4] = "Test70"

Global $aZugewieseneSoftware[101] [2]
For $i = 1 To 100
    $aZugewieseneSoftware[$i] [0] = "Test" & $i
    $aZugewieseneSoftware[$i] [1] = Random(1, 1, 1)
Next

#EndRegion

2. And if you tell my UDF that you do not want a horizontal scrollbar, you do not get one:

If $gHoehe >= 600 Then
    _GUiScrollBars_Generate($BWB_Softwareverwaltung, 0, $gHoehe)
    ;_GUiScrollBars_Generate($BWB_Softwareverwaltung, 870, $gHoehe)
    ;_GUIScrollBars_ShowScrollBar($BWB_Softwareverwaltung, $SB_HORZ, False)
EndIf

 


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
JLogan3o13

I was also unable to duplicate the behavior on Windows 7 or Windows 10. Scrolling up and down quickly and then changing to another window did not produce any discernible slowness.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
PascalT

Thanks for your fast answers.

 

@Melba23:

1. Yes this would've been way easier but as this is an example script and I was in a hurry I haven't really thought of this. I've now changed it to doing it in loops.

2. Thanks for this tip. I will change it in my scripts.

 

To both of you:

Like I've said both arrays are way bigger in my main script. I've just checked and both arrays have 283 values in it. After changing the size of the test arrays my PC instantly freezes after scrolling for a bit and then changing windows. I've attached the edited script below. Hope that you are now able to reproduce this behavior.

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <ComboConstants.au3>
#include <Array.au3>
#include <GuiComboBox.au3>
#include <EditConstants.au3>
#include <GUIScrollbars_EX.au3>
#include <ColorConstants.au3>

#Region Array definition
; This array is normally filled with Software-Names thats why it is getting sorted later on
Dim $aSections[284]
For $i = 0 To 283
    $aSections[$i] = "Test" & $i
Next



Dim $aAusnahmen[5]
$aAusnahmen[0] = "Test20"
$aAusnahmen[1] = "Test35"
$aAusnahmen[2] = "Test54"
$aAusnahmen[3] = "Test60"
$aAusnahmen[4] = "Test70"

Dim $aZugewieseneSoftware[284] [2]
For $i = 0 To 283
    $aZugewieseneSoftware[$i] [0] = "Test" & $i
    $aZugewieseneSoftware[$i] [1] = Random(1,1,1)
Next
#EndRegion
$aSectionsSortiert = $aSections
_ArraySort($aSectionsSortiert)

Dim $Button_Software[1]
Dim $Label_Software[1]
Dim $SpacerHorz[1]
$iLabelHoehe = 15
$iButtonHoehe = 15
$iSpacerHoehe = 0


$gHoehe = 90 + UBound($aSections) * 45.8
If $gHoehe >= 600 Then
    $gHoehe2 = 600
Else
    $gHoehe2 = $gHoehe
EndIf
$BWB_Softwareverwaltung = GUICreate("BWB-GUI | Softwareverwaltung", 630, $gHoehe2)
$iLabelHoehe = 35
$iButtonHoehe = 35
$iSpacerHoehe = 20
GUISetFont(12, 400, 0, "Calibri")
$NeuenPC_MitAnpassungen = GUICtrlCreateButton("Edited copy of devices", 16, 5, 243, 25) ; This Button has no function in the shorted down version
$Button_Ausfuehren = GUICtrlCreateButton("Save!", 528, 5, 75, 25) ; This Button has no function in the shorted down version

For $i = 1 To (UBound($aSectionsSortiert) -1)
;~ For $i = 1 To 50
    $iSpacerHoehe += 45
    Redim $Label_Software[Ubound($Label_Software) +1]
    Redim $Button_Software[Ubound($Button_Software) +1]
    Redim $SpacerHorz[Ubound($SpacerHorz) +1]
    $Label_Software[$i] = GUICtrlCreateLabel($aSectionsSortiert[$i], 16, $iLabelHoehe, 447, 23)
    $SpacerHorz[$i] = GUICtrlCreateLabel("", 0, $iSpacerHoehe, 850, 2, $SS_ETCHEDHORZ)

    $sAusnahmen = _ArrayToString($aAusnahmen, ",")
    If Not StringRegExp($sAusnahmen, "(?i)\b(" & $aSectionsSortiert[$i] & ")\b") Then
        If $aZugewieseneSoftware[$i] [1] = 1 Then
            $Button_Software[$i] = GUICtrlCreateInput("1", 528, $iButtonHoehe, 75, 23, BitOR($GUI_SS_DEFAULT_INPUT,$ES_NUMBER))
            GUICtrlSetColor(-1, $COLOR_GREEN)
        Else
            $Button_Software[$i] = GUICtrlCreateInput("0", 528, $iButtonHoehe, 75, 23, BitOR($GUI_SS_DEFAULT_INPUT,$ES_NUMBER))
            GUICtrlSetColor(-1, $COLOR_RED)
        EndIf
    EndIf
    $iLabelHoehe = $iSpacerHoehe + 5
    $iButtonHoehe = $iLabelHoehe + 5
Next

If $gHoehe >= 600 Then
    _GUiScrollBars_Generate($BWB_Softwareverwaltung, 0, $gHoehe)
EndIf
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
        Switch $nMsg
            Case $GUI_EVENT_CLOSE
                Exit
            Case $NeuenPC_MitAnpassungen
                ;//
            Case $Button_Ausfuehren
                ;//
        EndSwitch
WEnd

 

Share this post


Link to post
Share on other sites
Melba23

PascalT,

Sorry, still no freezing for me. I even increased the array sizes to over 1000 without encountering any problems. Sounds very much like it is a problem at your end.

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
Bilgus
Posted (edited)

Got something for you to try

Go to the autoit3/include/ 'directory' and open GuiScrollBars.au3  NO NOT THE INCLUDE YOU HAVE IN YOUR FILE GuiScrollBars_Ex.au3

Find this function and replace it with this one:

Func _GUIScrollBars_ScrollWindow($hWnd, $iXAmount, $iYAmount)
    Local Const $RDW_UPDATENOW = 0x0100, $RDW_INVALIDATE = 0x0001;
    If Not IsHWnd($hWnd) Then Return SetError(-2, -1, False)
    Local $aResult = DllCall("user32.dll", "bool", "ScrollWindow", "hwnd", $hWnd, "int", $iXAmount, "int", $iYAmount, "ptr", 0, "ptr", 0)
    If @error Then Return SetError(@error, @extended, False)
    _WinAPI_RedrawWindow($hWnd,0,0,BitOr($RDW_UPDATENOW,$RDW_INVALIDATE))
    Return $aResult[0]
EndFunc   ;==>_GUIScrollBars_ScrollWindow

 

Edited by Bilgus

Share this post


Link to post
Share on other sites
Bilgus
Posted (edited)

I guess it isn't too bad to fix it within GuiScrollbars_ex.au3 

Around line #627

$Pos = DllStructGetData($tSCROLLINFO, "nPos")
    If ($Pos <> $yPos) Then
        _GUIScrollBars_ScrollWindow($hWnd, 0, $yChar * ($yPos - $Pos))
        $yPos = $Pos
    EndIf
    
;Replace With
    $Pos = DllStructGetData($tSCROLLINFO, "nPos")
    If ($Pos <> $yPos) Then
        _GUIScrollBars_ScrollWindow($hWnd, 0, $yChar * ($yPos - $Pos))
        _WinAPI_UpdateWindow ($hWnd)
        ;_WinAPI_RedrawWindow($hWnd,0,0,BitOr($RDW_UPDATENOW, $RDW_INVALIDATE))
        $yPos = $Pos
    EndIf

Around line # 683

$Pos = DllStructGetData($tSCROLLINFO, "nPos")
    If ($Pos <> $xPos) Then _GUIScrollBars_ScrollWindow($hWnd, $xChar * ($xPos - $Pos), 0)
    
    ;Replace with
    
    $Pos = DllStructGetData($tSCROLLINFO, "nPos")
    If ($Pos <> $xPos) Then
        _GUIScrollBars_ScrollWindow($hWnd, $xChar * ($xPos - $Pos), 0)
        _WinAPI_UpdateWindow ($hWnd)
        ;_WinAPI_RedrawWindow($hWnd,0,0,BitOr($RDW_UPDATENOW, $RDW_INVALIDATE))
    EndIf

 

Edited by Bilgus
_WinAPI_UpdateWindow ($hWnd) Seems to work just as well

Share this post


Link to post
Share on other sites
Melba23

Bilgus,

Can you actually reproduce and solve the problem or is this just a suggestion you think might work? If the former I might amend the UDF.

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
Bilgus

I had the same issue prior to this and fixed it

Undoing my changes I got the same stuttering / hanging as in his example

Now it does still stutter a bit after setting it to repaint but nothing to the point of it being unusable (as it is now)

The MS example does this as well

https://msdn.microsoft.com/en-us/library/windows/desktop/hh298421(v=vs.85).aspx

// If the position has changed, scroll window and update it.
        if (si.nPos != yPos)
        {                    
            ScrollWindow(hwnd, 0, yChar * (yPos - si.nPos), NULL, NULL);
            UpdateWindow (hwnd);
        }

I was reading up on ScrollWindowEX since ScrollWindow is depreciated but it didn't help at all and only managed to add more variables to the dll call

Share this post


Link to post
Share on other sites
Bilgus

ScrollWindowEx might be useful if you are only invalidating a small portion of the window rather than the whole thing but MEH.

Share this post


Link to post
Share on other sites
Melba23

Bilgus,

Thanks for the clarification.

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×