Sign in to follow this  
Followers 0
bourny

Disable ListBox while keeping scroolbars live

2 posts in this topic

I have a script 3.5k line script that manages the delivery of applications to my standard build using a Gui to keep the user updated with the progess of the downloads and installs etc.

I have a bug somewhere that causes autoIt to crash if I leave the listbox in editable mode. The crash only occurs if I choose to randomly click loads of times in the list box. The only way to stop this is to disable the list box but this means I loose the ability to scroll the window.

I have an extract of my script that shows only my Gui and list box with a manually populated list to emulate the gui with a scrollbar.

In the example on line 182 I have the following code which sets the styles on the listbox.

;CREATE THE LIST BOX

;-------------------

;Set the List Boxes Styles and layout as an external variable

$StandardListStyle = BitOr($WS_BORDER, $LVS_NOSORTHEADER);, $WS_DISABLED)

;$ExtendedListStyle = BitOR($LVS_EX_FLATSB, $WS_EX_LAYERED,$WS_EX_WINDOWEDGE, $WS_HSCROLL, $WS_EX_CLIENTEDGE )

$ExtendedListStyle = BitOR( $WS_EX_CLIENTEDGE, $WS_EX_LAYERED , $ws_ex_transparent)

Including the $WS_DISABLED part will fix my bug but disables the scrollbar. Removing the $WS_DISABLED fixes my scrollbar but brings back the chance of this bug occuring if the user decides to randomly click the box.

I am looking for a way to keep the list box disabled while alloowing to scroll down the long list of items. I am sure there will be a way around this thay I am not thinking of.

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GDIPlus.au3>
#include <Misc.au3>
#include <WinAPI.au3>
#include <Array.au3>
#include <GUIConstants.au3>
#Include <GuiListView.au3>
#include <Constants.au3>
#include <ListviewConstants.au3>
#include <ListboxConstants.au3>
#include <StaticConstants.au3>
#Include <GuiEdit.au3>
#Include <File.au3>
#Include <../NEW UDFs/_StringSize.au3>
#Include <date.au3>

Opt("TrayMenuMode",1)
Opt("WinDetectHiddenText", 1)
Opt("WinTitleMatchMode", 2)
Opt("SendCapslockMode", 0)
Opt("TrayIconDebug", 0)
;Opt("RunErrorsFatal", 0)
Opt("WinWaitDelay", 1000)
Opt("SendKeyDelay", 100)
Opt("TrayAutoPause", 0)

;¬¬¬¬¬¬¬¬¬¬¬
;VARIABLES > --------------------------- >
;¬¬¬¬¬¬¬¬¬¬¬

;Array Variables
Global $ArrayOfDependancies
Global $3dNetworkInstallArray
Global $MulticastArrayPositions
Global $ArrayOfMulticastApps
Global $ArrayOfNetOnlyInstalls
Global $ArrayOfLocalApps
Global $MulticastRequiredButNoPing
Global $TweakingArrays
Global $PackageMissing
Global $AllowMulticastAdlib
Global $MulticastCount
Global $LocalCount
Global $NetOnlyCount
Global $EnableCount
Global $NothingToDo
Global $NumOfMulticastsOustanding
Global $CompletedMulticasts
Global $WorkHasBeenDone
Global $MulticastDownloadsInProgress
Global $MulticastFailures
Global $MachineLandeskStatus
Global $MulticastRetryAttempts
Global $TimeOfFirstMulticastRetry = ""
Global $MiniGuiNetUpdate
Global $BaseOfNetUpdate
Global $ReinstallLandeskFailed
Global $LandeskReinstallAttempted
Global $LandeskReinstallInProgress
Global $NetMiniGuiCreated = 0
Global $TitleWording3
global $CurrentNetupdate
global $CurrentMiniUpdate
global $CurrentMiniNetUpdate
Global $EnableNetUpdate
Global $DomainServer
;---------------
;Animated Gif Variables
Global $GifSpeed
Global $Time = 31
Global $GifStop
    ;Variables belonging to First animated Gif example
    Global $Gif = "c:\MonkeyAni.gif"
    Global $i = 0, $ApX, $ApY, $ApW, $ApH, $eX, $eY
    Global $hImage, $hBitmap, $hScrDC, $hMemDC, $tSize, $pSize, $tSource, $pSource, $tBlend, $pBlend
    Global $GFC, $GFDC, $pDimensionIDs, $tDL
    Global $Pause
    Global $hGUI
    ;Variables belonging to second Gif example
    ;Const $GIF_guiHWND = 0
    ;Const $GIF_hwnd = 1
    ;Const $GIF_Num_Of_Frames = 9
    ;Const $GIF_Current_Frame = 8
    ;Global $Data_Gifs[101][14]
    ;$Data_Gifs[0][0] = 0 ;Count of how many Gifs there are in existance currently.
;---------------
;Main Gui window variables
Global $gui
Global $GuiWidth = 500
Global $GuiHeight = 500
Global $BaseOfTitleBox
Global $BaseOfMiniUpdate
Global $MiniGuiUpdateTitle
Global $NewTitle
;---------------
;Table Variables
Global $listView
Global $ColumnTitles = "Application Name|Progress"
;---------------
;Multicast Variables
Global $LocalMulticastFolder = @HomeDrive & "\Multicasts"
;---------------
;Adlib Variables
Global $EnableAdlibMulticastsTracking
;---------------
;Misc Variables
Global $PackageFailures
Global $UpdatesLocation = "c:\updates\" & @ScriptName
Global $Log = $UpdatesLocation & "\" & @ScriptName & ".log"

;Stop 2 occurances of the script running
_Singleton(@ScriptName)



CreateMainGUI()



Func CreateMainGUI($MiniUpdate = "")

    Global $gui, $background, $pic

    ;---------------
    ;CREATE MAIN GUI
    ;---------------
    $gui = GUICreate("Application Installation Manager", $GuiWidth, $GuiHeight )


    $background = GUICtrlCreatePic("C:\Binarycode.jpg", 0, 0, 600, 600,  $WS_CLIPSIBLINGS); background picture
    GUISetBkColor (0xFFFFFF)  ; will change background color
    GUISetState(@SW_SHOW)


    ;-------------------------
    ;CREATE MAIN GUI TITLE BOX
    ;-------------------------
    ;Create Title for GUI Window
    $TitleWording = "SOFTWARE DELIVERY"
    $FontSize = 20
    $FontWeight = 400
    $fontName = "VERDANA"

    ;Get the dimensions the title box should be depending on the size of the wording
    ;UDF provided by http://www.autoitscript.com/forum/index.php?showtopic=89610&view=findpost&p=644078
    $ArrayOfTitleSizes = _StringSize($TitleWording, $FontSize, $FontWeight, 0, $fontName)
    $WidthOfTitleBox = $ArrayOfTitleSizes[2]
    $HeightOfTitleBox = $ArrayOfTitleSizes[3]

    Global $BaseOfTitleBox = $HeightOfTitleBox + 20 ; Variable allows later calculation fo positioning of a new title box under the main title

    ;Work out the central point to float the title in the Main Gui Window
    $PadLeft = $GuiWidth - $WidthOfTitleBox
    $PadLeft = $PadLeft / 2

    ;Create the Title box and setup
    $Title = GUICtrlCreateLabel ( $TitleWording, $PadLeft, 20 , $WidthOfTitleBox, $HeightOfTitleBox , $SS_CENTER,$WS_EX_CLIENTEDGE)
    GUICtrlSetFont(-1, $FontSize, 500, 0, $fontName)
    GUICtrlSetBkColor ( -1, 0xFFFFFF)
    ;-------------------------------------------

    ;------------
    ;ADD LIST BOX
    ;------------
    PopulateGuiList()




EndFunc

;---------------------------------

;---------------------------------

Func PopulateGuiList()

    ;CREATE THE LIST BOX
    ;-------------------
    ;Set the List Boxes Styles and layout as an external variable
    $StandardListStyle = BitOr($WS_BORDER, $LVS_NOSORTHEADER);, $WS_DISABLED)

    ;$ExtendedListStyle = BitOR($LVS_EX_FLATSB, $WS_EX_LAYERED,$WS_EX_WINDOWEDGE, $WS_HSCROLL, $WS_EX_CLIENTEDGE )
    $ExtendedListStyle = BitOR( $WS_EX_CLIENTEDGE, $WS_EX_LAYERED , $ws_ex_transparent)

    ;Create the ListBox using the above syles
    $listview = GuiCtrlCreateListView ($ColumnTitles,10,100,300,200, $StandardListStyle, $ExtendedListStyle)
    GUICtrlSetBkColor (-1, 0xFFFFFF)
    GuiCtrlSetState(-1,$GUI_ONTOP)


    GUISetState(@SW_SHOW)

    ;POPULATE THE LIST BOX WITH THE ARRAY VALUES
    ;-------------------------------------------
    ;$NumOfRows = ubound($3dNetworkInstallArray)
    Dim $y = 0
    Dim $counter
    Dim $ControlID = 1
    Dim $Item

    ;Dim $StartID = 0
    ;Do

        ;GuiCtrlCreateListViewItem($3dNetworkInstallArray[$y][0] & "|" & $3dNetworkInstallArray[$y][2], $listview)
        ;GuiCtrlCreateListViewItem($StartID & "|" & $3dNetworkInstallArray[$y][0] & "|" & $3dNetworkInstallArray[$y][2], $listview)
        ;$3dNetworkInstallArray[$y][3] = $StartID
        ;$StartID = $StartID + 1
        ;$y = $y + 1
        ;$counter = $counter + 1

    ;Until $counter = $NumOfRows
    ;--------------------------

    GuiCtrlCreateListViewItem("Package1|location 1", $listview)
    GuiCtrlCreateListViewItem("Package1|location 1", $listview)
    GuiCtrlCreateListViewItem("Package1|location 1", $listview)
    GuiCtrlCreateListViewItem("Package1|location 1", $listview)
    GuiCtrlCreateListViewItem("Package1|location 1", $listview)
    GuiCtrlCreateListViewItem("Package1|location 1", $listview)
    GuiCtrlCreateListViewItem("Package1|location 1", $listview)
    GuiCtrlCreateListViewItem("Package1|location 1", $listview)
    GuiCtrlCreateListViewItem("Package1|location 1", $listview)
    GuiCtrlCreateListViewItem("Package1|location 1", $listview)
    GuiCtrlCreateListViewItem("Package1|location 1", $listview)
    GuiCtrlCreateListViewItem("Package1|location 1", $listview)
    GuiCtrlCreateListViewItem("Package1|location 1", $listview)
    GuiCtrlCreateListViewItem("Package1|location 1", $listview)
    GuiCtrlCreateListViewItem("Package1|location 1", $listview)
    GuiCtrlCreateListViewItem("Package1|location 1", $listview)
    GuiCtrlCreateListViewItem("Package1|location 1", $listview)
    GuiCtrlCreateListViewItem("Package1|location 1", $listview)
    GuiCtrlCreateListViewItem("Package1|location 1", $listview)
    GuiCtrlCreateListViewItem("Package1|location 1", $listview)
    GuiCtrlCreateListViewItem("Package1|location 1", $listview)
    GuiCtrlCreateListViewItem("Package1|location 1", $listview)
    GuiCtrlCreateListViewItem("Package1|location 1", $listview)
    GuiCtrlCreateListViewItem("Package1|location 1", $listview)



    ;RESIZE THE POLULATED LIST BOX TO MAKE IT LOOK NEAT
    ;--------------------------------------------------
    _GUICtrlListView_SetColumnWidth($ListView, 0,  $LVSCW_AUTOSIZE_USEHEADER)
    _GUICtrlListView_SetColumnWidth($ListView, 1,  $LVSCW_AUTOSIZE_USEHEADER)
    $iY = _GUICtrlListView_ApproximateViewHeight($listview)
    $iX = _GUICtrlListView_ApproximateViewWidth($listview) + 4

    ;Control the table growing past the size of the main GUI window if the rezize value is to big for the main gui -
    ;This will calculate if the New size is above the MainGui width and reduce it to within 10 pixels
    dim $XResizeMaxed
    dim $YExtendedDueToXMaxed
    dim $YExtendAmmount = 0
    If $iX > $GuiWidth Then
        $iX = $GuiWidth - 20
        $XResizeMaxed = 1
    EndIf

    ;Calculate the height auto resize and reduce if the Width has maxed out to avoid a unnecessary vertical scrollbar
    If $XResizeMaxed = 1 and $YExtendedDueToXMaxed <> 1 Then $YExtendAmmount = 10
    $iY = _GUICtrlListView_ApproximateViewHeight($listview) + $YExtendAmmount

    ;Work out how to keep the list box in the center of the gui window
    $DifferenceBetweenGuiAndListBoxLength = $GuiWidth - $iX
    $PadLeft = $DifferenceBetweenGuiAndListBoxLength / 2

    ;Work out how to place the listbox at the bottom half of the GUI
    $GuiHalf = $GuiHeight / 2
    If $iY < $GuiHalf Then
        ;Set the vertical Pad height to at least half way down as the List box is small
        $PadHeight = $GuiHalf

    Else
        ;List box is relativly large so calulate the best place for the List Box
        $ListBoxTotalAllowedHeight = $GuiHalf - 10
        $PadHeight = $GuiHalf
        $iY = $ListBoxTotalAllowedHeight

        ;$HeightOfListBoxFromBottomOfGui = $GuiHeight - $iY - 10
        ;$StartHeightOfListBox = $GuiHeight - $HeightOfListBoxFromBottomOfGui
        ;$PadHeight = $StartHeightOfListBox
    EndIf


    GUICtrlSetPos ( $listview,$PadLeft, $PadHeight , $iX , $iY )
    msgbox(0, "", "Paused")
    ;Sleep(20000)


EndFunc

;-------------a--------------------

Share this post


Link to post
Share on other sites



bourny,

You could use a child GUI to hold the ListView (not ListBox - there is a big difference!) and then use my GUIScrollBars_Ex UDF to scroll the GUI rather than the ListView. Here is your script roughly modified to show the proof of concept - look for the <<<<<<<<<<<<< lines:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GDIPlus.au3>
#include <Misc.au3>
#include <WinAPI.au3>
#include <Array.au3>
#include <GUIConstants.au3>
#Include <GuiListView.au3>
#include <Constants.au3>
#include <ListviewConstants.au3>
#include <ListboxConstants.au3>
#include <StaticConstants.au3>
#Include <GuiEdit.au3>
#Include <File.au3>
#Include <StringSize.au3>
#Include <date.au3>

#Include <GUIScrollbars_Ex.au3> ; <<<<<<<<<<<<<<<<<<<<

Opt("TrayMenuMode",1)
Opt("WinDetectHiddenText", 1)
Opt("WinTitleMatchMode", 2)
Opt("SendCapslockMode", 0)
Opt("TrayIconDebug", 0)
;Opt("RunErrorsFatal", 0)
Opt("WinWaitDelay", 1000)
Opt("SendKeyDelay", 100)
Opt("TrayAutoPause", 0)

;¬¬¬¬¬¬¬¬¬¬¬
;VARIABLES > --------------------------- >
;¬¬¬¬¬¬¬¬¬¬¬

;Array Variables
Global $ArrayOfDependancies
Global $3dNetworkInstallArray
Global $MulticastArrayPositions
Global $ArrayOfMulticastApps
Global $ArrayOfNetOnlyInstalls
Global $ArrayOfLocalApps
Global $MulticastRequiredButNoPing
Global $TweakingArrays
Global $PackageMissing
Global $AllowMulticastAdlib
Global $MulticastCount
Global $LocalCount
Global $NetOnlyCount
Global $EnableCount
Global $NothingToDo
Global $NumOfMulticastsOustanding
Global $CompletedMulticasts
Global $WorkHasBeenDone
Global $MulticastDownloadsInProgress
Global $MulticastFailures
Global $MachineLandeskStatus
Global $MulticastRetryAttempts
Global $TimeOfFirstMulticastRetry = ""
Global $MiniGuiNetUpdate
Global $BaseOfNetUpdate
Global $ReinstallLandeskFailed
Global $LandeskReinstallAttempted
Global $LandeskReinstallInProgress
Global $NetMiniGuiCreated = 0
Global $TitleWording3
global $CurrentNetupdate
global $CurrentMiniUpdate
global $CurrentMiniNetUpdate
Global $EnableNetUpdate
Global $DomainServer
;---------------
;Animated Gif Variables
Global $GifSpeed
Global $Time = 31
Global $GifStop
    ;Variables belonging to First animated Gif example
    Global $Gif = "c:\MonkeyAni.gif"
    Global $i = 0, $ApX, $ApY, $ApW, $ApH, $eX, $eY
    Global $hImage, $hBitmap, $hScrDC, $hMemDC, $tSize, $pSize, $tSource, $pSource, $tBlend, $pBlend
    Global $GFC, $GFDC, $pDimensionIDs, $tDL
    Global $Pause
    Global $hGUI
    ;Variables belonging to second Gif example
    ;Const $GIF_guiHWND = 0
    ;Const $GIF_hwnd = 1
    ;Const $GIF_Num_Of_Frames = 9
    ;Const $GIF_Current_Frame = 8
    ;Global $Data_Gifs[101][14]
    ;$Data_Gifs[0][0] = 0 ;Count of how many Gifs there are in existance currently.
;---------------
;Main Gui window variables
Global $gui
Global $GuiWidth = 500
Global $GuiHeight = 500
Global $BaseOfTitleBox
Global $BaseOfMiniUpdate
Global $MiniGuiUpdateTitle
Global $NewTitle
;---------------
;Table Variables
Global $listView
Global $ColumnTitles = "Application Name|Progress"
;---------------
;Multicast Variables
Global $LocalMulticastFolder = @HomeDrive & "\Multicasts"
;---------------
;Adlib Variables
Global $EnableAdlibMulticastsTracking
;---------------
;Misc Variables
Global $PackageFailures
Global $UpdatesLocation = "c:\updates\" & @ScriptName
Global $Log = $UpdatesLocation & "\" & @ScriptName & ".log"

;Stop 2 occurances of the script running
_Singleton(@ScriptName)



CreateMainGUI()



Func CreateMainGUI($MiniUpdate = "")

    Global $gui, $background, $pic

    ;---------------
    ;CREATE MAIN GUI
    ;---------------
    $gui = GUICreate("Application Installation Manager", $GuiWidth, $GuiHeight )


    $background = GUICtrlCreatePic("C:\Binarycode.jpg", 0, 0, 600, 600,  $WS_CLIPSIBLINGS); background picture
    GUISetBkColor (0xFFFFFF)  ; will change background color
    GUISetState(@SW_SHOW)


    ;-------------------------
    ;CREATE MAIN GUI TITLE BOX
    ;-------------------------
    ;Create Title for GUI Window
    $TitleWording = "SOFTWARE DELIVERY"
    $FontSize = 20
    $FontWeight = 400
    $fontName = "VERDANA"

    ;Get the dimensions the title box should be depending on the size of the wording
    ;UDF provided by http://www.autoitscript.com/forum/index....p?showtopic=89610&view=findpos
    $ArrayOfTitleSizes = _StringSize($TitleWording, $FontSize, $FontWeight, 0, $fontName)
    $WidthOfTitleBox = $ArrayOfTitleSizes[2]
    $HeightOfTitleBox = $ArrayOfTitleSizes[3]

    Global $BaseOfTitleBox = $HeightOfTitleBox + 20 ; Variable allows later calculation fo positioning of a new title box under the main title

    ;Work out the central point to float the title in the Main Gui Window
    $PadLeft = $GuiWidth - $WidthOfTitleBox
    $PadLeft = $PadLeft / 2

    ;Create the Title box and setup
    $Title = GUICtrlCreateLabel ( $TitleWording, $PadLeft, 20 , $WidthOfTitleBox, $HeightOfTitleBox , $SS_CENTER,$WS_EX_CLIENTEDGE)
    GUICtrlSetFont(-1, $FontSize, 500, 0, $fontName)
    GUICtrlSetBkColor ( -1, 0xFFFFFF)
    ;-------------------------------------------

    ;------------
    ;ADD LIST BOX
    ;------------

    PopulateGuiList()


    GUISetState(@SW_SHOW)


EndFunc

;---------------------------------

;---------------------------------

Func PopulateGuiList()

    ;CREATE THE LIST BOX
    ;-------------------
    ; Create a child GUI for the ListView
    $hListGUI = GUICreate("ListView GUI", 300, 200, 10, 100, $WS_POPUP, $WS_EX_MDICHILD, $gui) ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    GUISetState()

    ;Set the List Boxes Styles and layout as an external variable
    $StandardListStyle = BitOr($WS_BORDER, $LVS_NOSORTHEADER);, $WS_DISABLED)

    ;$ExtendedListStyle = BitOR($LVS_EX_FLATSB, $WS_EX_LAYERED,$WS_EX_WINDOWEDGE, $WS_HSCROLL, $WS_EX_CLIENTEDGE )
    $ExtendedListStyle = BitOR( $WS_EX_CLIENTEDGE, $WS_EX_LAYERED , $ws_ex_transparent)

    ;Create the ListBox using the above syles
    $listview = GuiCtrlCreateListView ($ColumnTitles,0,0,300,200, $StandardListStyle, $ExtendedListStyle)
    GUICtrlSetBkColor (-1, 0xFFFFFF)
    ;GuiCtrlSetState(-1,$GUI_ONTOP)


    ;POPULATE THE LIST BOX WITH THE ARRAY VALUES
    ;-------------------------------------------
    ;$NumOfRows = ubound($3dNetworkInstallArray)
    Dim $y = 0
    Dim $counter
    Dim $ControlID = 1
    Dim $Item

    ;Dim $StartID = 0
    ;Do

        ;GuiCtrlCreateListViewItem($3dNetworkInstallArray[$y][0] & "|" & $3dNetworkInstallArray[$y][2], $listview)
        ;GuiCtrlCreateListViewItem($StartID & "|" & $3dNetworkInstallArray[$y][0] & "|" & $3dNetworkInstallArray[$y][2], $listview)
        ;$3dNetworkInstallArray[$y][3] = $StartID
        ;$StartID = $StartID + 1
        ;$y = $y + 1
        ;$counter = $counter + 1

    ;Until $counter = $NumOfRows
    ;--------------------------

    For $i = 1 To 50
        GuiCtrlCreateListViewItem("Package " & $i & "|Location " & $i, $listview)
    Next


    ;RESIZE THE POLULATED LIST BOX TO MAKE IT LOOK NEAT
    ;--------------------------------------------------
    _GUICtrlListView_SetColumnWidth($ListView, 0,  $LVSCW_AUTOSIZE_USEHEADER)
    _GUICtrlListView_SetColumnWidth($ListView, 1,  $LVSCW_AUTOSIZE_USEHEADER)
    $iY = _GUICtrlListView_ApproximateViewHeight($listview)
    $iX = _GUICtrlListView_ApproximateViewWidth($listview) + 4

    #cs

    ;Control the table growing past the size of the main GUI window if the rezize value is to big for the main gui -
    ;This will calculate if the New size is above the MainGui width and reduce it to within 10 pixels
    dim $XResizeMaxed
    dim $YExtendedDueToXMaxed
    dim $YExtendAmmount = 0
    If $iX > $GuiWidth Then
        $iX = $GuiWidth - 20
        $XResizeMaxed = 1
    EndIf

    ;Calculate the height auto resize and reduce if the Width has maxed out to avoid a unnecessary vertical scrollbar
    If $XResizeMaxed = 1 and $YExtendedDueToXMaxed <> 1 Then $YExtendAmmount = 10
    $iY = _GUICtrlListView_ApproximateViewHeight($listview) + $YExtendAmmount

    ;Work out how to keep the list box in the center of the gui window
    $DifferenceBetweenGuiAndListBoxLength = $GuiWidth - $iX
    $PadLeft = $DifferenceBetweenGuiAndListBoxLength / 2

    ;Work out how to place the listbox at the bottom half of the GUI
    $GuiHalf = $GuiHeight / 2
    If $iY < $GuiHalf Then
        ;Set the vertical Pad height to at least half way down as the List box is small
        $PadHeight = $GuiHalf

    Else
        ;List box is relativly large so calulate the best place for the List Box
        $ListBoxTotalAllowedHeight = $GuiHalf - 10
        $PadHeight = $GuiHalf
        $iY = $ListBoxTotalAllowedHeight

        ;$HeightOfListBoxFromBottomOfGui = $GuiHeight - $iY - 10
        ;$StartHeightOfListBox = $GuiHeight - $HeightOfListBoxFromBottomOfGui
        ;$PadHeight = $StartHeightOfListBox
    EndIf
    #ce

    ; Resize the ListView
    GUICtrlSetPos ( $listview, 0, 0, $iX + 20 , $iY + 20)
    ; Disable it
    GUICtrlSetState($ListView, $GUI_DISABLE)
    ; Get scrollbars in the GUI - yes this is all you need to do !!!!
    _GUIScrollbars_Generate($hListGUI, 0, $iY + 20) ; Use whatever value you set for the ListView <<<<<<<<<<<<<<<<<<<<<<<<<<<<<

    GUISwitch($gui) ; Switch back to main GUI

    msgbox(0, "", "Paused")


EndFunc

;-------------a--------------------

I hope that solves your immediate problem - although I feel you should really look to find out why you get the crash. :)

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
Sign in to follow this  
Followers 0