ptrex Posted October 25, 2005 Share Posted October 25, 2005 When loading data in a ListView, the screen flickers like hell, when loading and refreshing. Especialy when loading a few thousand lines. Is there a solution for it, like should I buld in a sleep() somewhere to prevent this. Or is the a kind of refreshrate which can be set, to get rid of the annoynig flickering if the ListView on the GUI. Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New Link to comment Share on other sites More sharing options...
GaryFrost Posted October 25, 2005 Share Posted October 25, 2005 (edited) put the lock at the top of the function and unlock at the bottom Func _ReduceMemory() Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', -1) Return $ai_Return[0] EndFunc ;==>_ReduceMemory Func _LockAndWait() GUISetState(@SW_LOCK) GUISetCursor(15, 1) EndFunc ;==>_LockAndWait Func _ResetLockWait() GUISetState(@SW_UNLOCK) GUISetCursor(2, 1) _ReduceMemory() EndFunc ;==>_ResetLockWait Edited October 25, 2005 by gafrost SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
ptrex Posted October 25, 2005 Author Share Posted October 25, 2005 (edited) @gafrost Againg a hit !! I installed the function and it runs like a charm. The more I start using AutoIT the more I realize what is possible, and how litle I know. Is this also not a good suggestion to have this as a kind of parameter, build into the ListView control, to set the LOCK on or off. Just a thought. Edited October 25, 2005 by ptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New Link to comment Share on other sites More sharing options...
jpm Posted October 25, 2005 Share Posted October 25, 2005 put the lock at the top of the function and unlock at the bottomFunc _ReduceMemory() Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', -1) Return $ai_Return[0] EndFunc ;==>_ReduceMemory Func _LockAndWait() GUISetState(@SW_LOCK) GUISetCursor(15, 1) EndFunc ;==>_LockAndWait Func _ResetLockWait() GUISetState(@SW_UNLOCK) GUISetCursor(2, 1) _ReduceMemory() EndFunc ;==>_ResetLockWaitCuriosity,Why _ReduceMemory is needed? Link to comment Share on other sites More sharing options...
GaryFrost Posted October 25, 2005 Share Posted October 25, 2005 I was on the way out the door to go to work, it's not needed, just a quick snippet from one of my projects Gary SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
BigDaddyO Posted October 25, 2005 Share Posted October 25, 2005 Quick Question... Is there any way this could work to freeze the desktop? I have a couple scripts that would be great to run without the user seeing some obnoxious windows opening/closing. Mike Link to comment Share on other sites More sharing options...
Gene Posted October 29, 2005 Share Posted October 29, 2005 put the lock at the top of the function and unlock at the bottomFunc _ReduceMemory() Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', -1) Return $ai_Return[0] EndFunc ;==>_ReduceMemory Func _LockAndWait() GUISetState(@SW_LOCK) GUISetCursor(15, 1) EndFunc ;==>_LockAndWait Func _ResetLockWait() GUISetState(@SW_UNLOCK) GUISetCursor(2, 1) _ReduceMemory() EndFunc ;==>_ResetLockWaitI have a ListView that flickers too, so the functions above looked good to me. When I put them in, the ListView quit working I comment them and it works.Would you look at my code below and point out the cause if it is there, it's not the whole script, just the UDF where i build the listView.expandcollapse popupFunc _LockAndWait() GUISetState(@SW_LOCK) GUISetCursor(15, 1) EndFunc ;==>_LockAndWait Func _ResetLockWait() GUISetState(@SW_UNLOCK) GUISetCursor(2, 1) EndFunc ;==>_ResetLockWait Func _BuildListView() _LockAndWait() $listview = GUICtrlCreateListView("Name|Activity|Trial|Time", 8, 75, 250, 270, BitOR($GUI_SS_DEFAULT_LISTVIEW, $LVS_SORTASCENDING)) $sListData = "" $sListName = "" $sListName = $sCurrName $aVar1 = IniReadSectionNames($sDataPath & $sListName & ".ini") For $i1 = 1 To $aVar1[0] If $aVar1[$i1] <> "Name" And $aVar1[$i1] <> "Style_Location" And $aVar1[$i1] <> "DefaultActivity" And $aVar1[0] > 3 Then $sActivity = $aVar1[$i1] & "|" $aVar2 = IniReadSection($sDataPath & $sListName & ".ini", $aVar1[$i1]) ;MsgBox(0,"Information 537","$aVar1[$i] " & $aVar1[$i1] & " - " & $i1) If @error Then MsgBox(4096, "Error 1417", "Error occured, unable to read the section (The INI file may not exist or the section may not exist) or if the section was empty, or no standard format data could be found.") Else If $aVar2[0][0] > 1 Then For $i2 = 1 To $aVar2[0][0] ;MsgBox(0,"Information 543","$aVar2[$i2] " & $aVar2[$i2][0] & " - " & $i2) If StringLeft($aVar2[$i2][0], 7) <> "Trial00" Then $sListData = $sListName & "|" & $sActivity & StringRight($aVar2[$i2][0], 2) & "|" & StringLeft($aVar2[$i2][1], 6) GUICtrlCreateListViewItem($sListData, $listview) ;MsgBox(4096, "Information 547", "$sListData: " & $sListData) $sListData = "" EndIf Next EndIf EndIf ElseIf $aVar1[0] = 3 Then GUICtrlCreateListViewItem(" | | | ", $listview) EndIf ;MsgBox(4096, "", $aVar1[$i]) Next _ResetLockWait() EndFunc;==>_BuildListView [font="Verdana"]Thanks for the response.Gene[/font]Yes, I know the punctuation is not right... Link to comment Share on other sites More sharing options...
jpm Posted October 29, 2005 Share Posted October 29, 2005 Quick Question...Is there any way this could work to freeze the desktop? I have a couple scripts that would be great to run without the user seeing some obnoxious windows opening/closing.MikeI am not sure. the function is intended for only one window of any running applicationIt is reset by any other call to this lock mechanism. So if any application do the same it will unlock your's Link to comment Share on other sites More sharing options...
randallc Posted October 29, 2005 Share Posted October 29, 2005 Hi, @Gene, Can you post a small script as example which calls your funcs (the I can run your funcs and watch for errors?) Best, Randall ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
Gene Posted October 29, 2005 Share Posted October 29, 2005 Hi,@Gene,Can you post a small script as example which calls your funcs (the I can run your funcs and watch for errors?)Best, RandallI'm using ListView in only one script, it is 1500+ lines, and would still require some appropriate INI files.Of the functions in my post, only _BuildListView() is mine, I copied the other two {lock & unlock} from a previous post by gafrost._BuildListView() is self contained except for the $sCurrName var which is Global. _BuildListView() works except when I include the lock and unlock functions. Since the ListView is built by getting the appropriate section names from $sCurrName & ".INI" file, then gets the keys, then writes the List Items, I'm not surprised at a little flicker. If it could be gotten rid of easily that would be good.I could cobble up a small script like you mention, but since _BuildListView() works on its own, I don't think that would be very useful. [font="Verdana"]Thanks for the response.Gene[/font]Yes, I know the punctuation is not right... Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now