wraithdu Posted September 28, 2008 Share Posted September 28, 2008 (edited) Just got around to testing this out. Unfortunately (like so many things), it doesn't work on Vista. The GUI and controls are created, but the progress bars don't move, and the script uses about 100% CPU until I end it from the tray Really great UDF for XP though! Edited September 28, 2008 by wraithdu Link to comment Share on other sites More sharing options...
TehWhale Posted September 28, 2008 Share Posted September 28, 2008 Nice job as always Rasim. Link to comment Share on other sites More sharing options...
rasim Posted September 29, 2008 Author Share Posted September 29, 2008 Thanks guys! Link to comment Share on other sites More sharing options...
MrCreatoR Posted October 6, 2008 Share Posted October 6, 2008 @rasimVery nice UDF!Few problems i can see:* The last created progress will set the subitem for all previously created progress controls. There is loop inside the LV_NOTIFY() function, that moves all controls to the last subitem (of last created progress), there should be some sort of positions checking...* Progress_SetBarColor doesn't work, or it's shouldn't? (looking at your screens, it seems that this is not working for you as well).* If i set as subitem 0 (the first one), then i get the progress bar with the size of row item.About the _WinAPI_DestroyWindow($hProgress). You could make a function for (or from) it:Func _Progress_Delete($hWnd) Local $aTmpArr[1][1] For $i = 1 To $aProgress[0][0] If $aProgress[$i][0] <> $hWnd Then $aTmpArr[0][0] += 1 ReDim $aTmpArr[$aTmpArr[0][0]+1][2] $aTmpArr[$aTmpArr[0][0]][0] = $aProgress[$i][0] $aTmpArr[$aTmpArr[0][0]][1] = $aProgress[$i][1] EndIf Next $aProgress = $aTmpArr Local $aResult = DllCall("User32.dll", "int", "DestroyWindow", "hwnd", $hWnd) If @error Then Return SetError(1, 0, 0) Return $aResult[0] <> 0 EndFunc Spoiler Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1 AutoIt Russian Community My Work... Spoiler Projects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating ) * === My topics === * ================================================== ================================================== AutoIt is simple, subtle, elegant. © AutoIt Team Link to comment Share on other sites More sharing options...
MrCreatoR Posted October 6, 2008 Share Posted October 6, 2008 Ok, here is a fix for those (and some other) things: _ListView_Progress.zip Spoiler Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1 AutoIt Russian Community My Work... Spoiler Projects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating ) * === My topics === * ================================================== ================================================== AutoIt is simple, subtle, elegant. © AutoIt Team Link to comment Share on other sites More sharing options...
rasim Posted October 6, 2008 Author Share Posted October 6, 2008 MrCreatoRHi friend!MrCreatoR* The last created progress will set the subitem for all previously created progress controls. There is loop inside the LV_NOTIFY() function, that moves all controls to the last subitem (of last created progress), there should be some sort of positions checking...I have not understood completely, what you mean, progressbar position or value?MrCreatoR* Progress_SetBarColor doesn't work, or it's shouldn't? (looking at your screens, it seems that this is not working for you as well).Does work.HelpProgress controls cannot be painted if the "Windows XP style" is used.MrCreatoRIf i set as subitem 0 (the first one), then i get the progress bar with the size of row item.Help$iSubItem - One based index of the subitem.?MrCreatoRAbout the _WinAPI_DestroyWindow($hProgress). You could make a function for (or from) it:Thank you! Added, updated first post. Link to comment Share on other sites More sharing options...
MrCreatoR Posted October 6, 2008 Share Posted October 6, 2008 rasim I have not understood completely, what you mean, progressbar position or value?The position... невозможно отдельно задать положение прогресса в конкретной ячейке (subitem), они все будут в одной и той же (последняя задаёт положение) Just try to set 1 as last parameter in $hProgress6... $hProgress6 = _ListView_InsertProgressBar($hListView, 5, 1) There is no logic in using this parameter if it's not setting the progress position in subitem. I fixed that in my previous post. Or just create another function to set the subitem placement for all progresses, something like _Progress_SetSubItem - But i sure many scripters would like to have an ability to place progress in certain subitems. Does work.Ok thanks, i forgot about it. $iSubItem - One based index of the subitem.Then _GUICtrlListView_GetSubItemRect is not working correctly, it returning wrong rectangle for the item (first subitem, wich is 0 normaly). I fixed that to (by checking the subitem and changing the rectangle) P.S Just check your example with the UDF i posted, and then compare it with the current UDF, you will see the differents (while window resized, columns size changed, listview scrolling etc.). Spoiler Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1 AutoIt Russian Community My Work... Spoiler Projects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating ) * === My topics === * ================================================== ================================================== AutoIt is simple, subtle, elegant. © AutoIt Team Link to comment Share on other sites More sharing options...
wraithdu Posted October 6, 2008 Share Posted October 6, 2008 Nice job, both of you. I should mention though, that MrCreator's version now works on Vista 32-bit... Link to comment Share on other sites More sharing options...
rasim Posted October 7, 2008 Author Share Posted October 7, 2008 MrCreatoR The position... невозможно отдельно задать положение прогресса в конкретной ячейке (subitem), они все будут в одной и той же (последняя задаёт положение) Just try to set 1 as last parameter in $hProgress6... $hProgress6 = _ListView_InsertProgressBar($hListView, 5, 1) Now i see Fixed, updated first post. Thank you friend Давно хотел спросить, какую программу используешь для смены темы Windows, у тебя ведь XP? Link to comment Share on other sites More sharing options...
rasim Posted October 7, 2008 Author Share Posted October 7, 2008 Nice job, both of you. I should mention though, that MrCreator's version now works on Vista 32-bit...Please check my version from first post. Link to comment Share on other sites More sharing options...
MrCreatoR Posted October 7, 2008 Share Posted October 7, 2008 Fixed, updated first postBut the other issues still there - 1) Very high CPU load when scrolling and resizing the window. 2) If you set 0 as subitem, then progress created with the size of all subitems together. Btw, the _Progress_Delete function needs to be updated to (add third element [3]), it will cause a script crash when you use it and then will try to insert a new progress bar (or just use another function from the UDFs). какую программу используешь для смены темы Windows, у тебя ведь XP?Да, у меня XP. Я как то ставил себе «Vista Transformation Pack 6.0» (хотя есть уже 8), но то что на скрине это просто тема «Windows Vista Basic». Spoiler Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1 AutoIt Russian Community My Work... Spoiler Projects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating ) * === My topics === * ================================================== ================================================== AutoIt is simple, subtle, elegant. © AutoIt Team Link to comment Share on other sites More sharing options...
rasim Posted October 7, 2008 Author Share Posted October 7, 2008 But the other issues still there - 1) Very high CPU load when scrolling and resizing the window. 2) If you set 0 as subitem, then progress created with the size of all subitems together.Ok, fixed. Updated first post. Btw, the _Progress_Delete function needs to be updated to (add third element [3]), it will cause a script crash when you use it and then will try to insert a new progress bar (or just use another function from the UDFs).Damn! I need more coffee today Fixed, updated first post. Thank you friend, you are great debugger Link to comment Share on other sites More sharing options...
MrCreatoR Posted October 7, 2008 Share Posted October 7, 2008 Reduced CPU usage (little).Not as far as i can see The -12 (when checking the $iCode) message is not needed there, i am not sure what it does, but this is the main causing of high CPU load. I used these notifications: $HDN_ITEMCHANGINGA, $HDN_ITEMCHANGINGW, $HDN_ITEMCHANGEDA, $HDN_ITEMCHANGEDW, $LVN_ENDSCROLL And as for the resizing window, we can use one more message: WM_SIZE Example: expandcollapse popup#include <_ListView_Progress.au3> Global $iProgress = 0 $hGui = GUICreate("ListView with progressbar", 420, 280, -1, -1, BitOR($GUI_SS_DEFAULT_GUI, $WS_SIZEBOX)) $hListView = GUICtrlCreateListView("Files|Path|Progress", 10, 10, 400, 240, BitOR($LVS_REPORT, $WS_BORDER)) _GUICtrlListView_BeginUpdate($hListView) _GUICtrlListView_SetColumnWidth($hListView, 0, 100) _GUICtrlListView_SetColumnWidth($hListView, 1, 140) _GUICtrlListView_SetColumnWidth($hListView, 2, 150) _GUICtrlListView_AddItem($hListView, "AutoIT") _GUICtrlListView_AddItem($hListView, "Opera") _GUICtrlListView_AddItem($hListView, "Script") _GUICtrlListView_AddItem($hListView, "Work") _GUICtrlListView_AddItem($hListView, "New") _GUICtrlListView_AddItem($hListView, "Test") _GUICtrlListView_AddItem($hListView, "Image") _GUICtrlListView_AddItem($hListView, "Soft") _GUICtrlListView_AddItem($hListView, "") _GUICtrlListView_AddItem($hListView, "Info") _GUICtrlListView_AddSubItem($hListView, 0, "C:\Program Files\AutoIt3", 2) _GUICtrlListView_AddSubItem($hListView, 1, "C:\Program Files\Opera", 1) _GUICtrlListView_AddSubItem($hListView, 2, "C:\MyScript\Work", 1) _GUICtrlListView_AddSubItem($hListView, 3, "C:\New\Script", 2) _GUICtrlListView_AddSubItem($hListView, 4, "C:\Image\Image", 1) _GUICtrlListView_AddSubItem($hListView, 5, "C:\Soft\New", 1) _GUICtrlListView_AddSubItem($hListView, 6, "C:\Music\Info", 1) _GUICtrlListView_AddSubItem($hListView, 7, "C:\Video\Soft", 1) _GUICtrlListView_AddSubItem($hListView, 8, "C:\Project\Script", 1) _GUICtrlListView_AddSubItem($hListView, 8, "News", 2) _GUICtrlListView_AddSubItem($hListView, 9, "C:\Work\Script", 1) _GUICtrlListView_EndUpdate($hListView) $hProgress1 = _GUICtrlListView_ProgressCreate($hListView, 0, 1) _GUICtrlListView_ProgressSetColor($hProgress1, 0xFF0000) $hProgress2 = _GUICtrlListView_ProgressCreate($hListView, 1, 2) _GUICtrlListView_ProgressSetColor($hProgress2, 0x00FF00) $hProgress3 = _GUICtrlListView_ProgressCreate($hListView, 2, 2) _GUICtrlListView_ProgressSetColor($hProgress3, 0x0000FF) $hProgress4 = _GUICtrlListView_ProgressCreate($hListView, 3, 1) _GUICtrlListView_ProgressSetBkColor($hProgress3, 0xFF00FF) $hProgress5 = _GUICtrlListView_ProgressCreate($hListView, 4, 2) $hProgress6 = _GUICtrlListView_ProgressCreate($hListView, 5, 2) $hProgress7 = _GUICtrlListView_ProgressCreate($hListView, 6, 2) $hProgress8 = _GUICtrlListView_ProgressCreate($hListView, 7, 2) $hProgress9 = _GUICtrlListView_ProgressCreate($hListView, 8, 0) $hProgress10 = _GUICtrlListView_ProgressCreate($hListView, 9, 2) _GUICtrlListView_ProgressSetStep($hProgress10, 5) GUISetState() AdlibEnable("_Set_Progress_Proc", 500) Do Until GUIGetMsg() = $GUI_EVENT_CLOSE Func _Set_Progress_Proc() If $iProgress = 100 Then $iProgress = 0 $iProgress += 10 _GUICtrlListView_ProgressSetPos($hProgress1, $iProgress + 10) _GUICtrlListView_ProgressSetPos($hProgress4, $iProgress) _GUICtrlListView_ProgressSetPos($hProgress9, $iProgress) _GUICtrlListView_ProgressStepIt($hProgress10) EndFuncoÝ÷ ÙµöÚºÚ"µÍÚ[ÛYK[ÛÙBÚ[ÛYH ÑÕRPÛÛÝ[Ñ^]LÉÝÂÚ[ÛYH ÕÚ[ÝÜÐÛÛÝ[Ë]LÉÝÂÚ[ÛYH ÐÛÛÝ[Ë]LÉÝÂÚ[ÛYH ÔÙÜÜÐÛÛÝ[Ë]LÉÝÂÚ[ÛYH ÕÚ[TK]LÉÝÂÚ[ÛYH ÑÝZSÝY]Ë]LÉÝÂÂÛØ[ÛÛÝ ÌÍÔÕ×ÒQHHÛØ[ÛÛÝ ÌÍÔÕ×ÔÒÕÈH BÛØ[ÛÛÝ ÌÍÒÑTÕHLÌÛØ[ÛÛÝ ÌÍÒÒUSPÒSÒSÐHH ÌÍÒÑTÕHÑÛØ[ÛÛÝ ÌÍÒÒUSPÒSÒSÕÈH ÌÍÒÑTÕHÛØ[ÛÛÝ ÌÍÒÒUSPÒSÑQHH ÌÍÒÑTÕHBÑÛØ[ÛÛÝ ÌÍÒÒUSPÒSÑQÈH ÌÍÒÑTÕHBÑÛØ[ÛÛÝ ÌÍÓÑSÐÔÓH ÌÍÓÑTÕHBÛØ[ ÌÍØTÙÜÜÖÌWVÌWBÛØ[ ÌÍÚTÙ]ÝÝX][HHYBÕRTYÚÝÙÊ ÌÍÕÓWÓÕQK ][Ý×ÓÝY]×ÕÓWÓÕQI][ÝÊBÕRTYÚÝÙÊ ÌÍÕÓWÔÒVK ][Ý×ÓÝY]×ÕÓWÔÒVI][ÝÊB[ÈÓÝY]×ÕÓWÓÕQJ ÌÍÚÛ ÌÍÓÙË ÌÍÝÔ[K ÌÍÛ[JBSØØ[ ÌÍÝR ÌÍÚPÛÙK ÌÍÚBIÌÍÝRHÝXÝÜX]J ÌÍÝYÓR ÌÍÛ[JBIÌÍÚPÛÙHHÝXÝÙ]]J ÌÍÝR ][ÝÐÛÙI][ÝÊBIÌÍÚHÝXÝÙ]]J ÌÍÝR ][ÝÐÛÙI][ÝÊBBTÝÚ]Ú ÌÍÚPÛÙBBPØÙH ÌÍÒÒUSPÒSÒSÐK ÌÍÒÒUSPÒSÒSÕË ÌÍÒÒUSPÒSÑQK ÌÍÒÒUSPÒSÑQË ÌÍÓÑSÐÔÓBBQÜ ÌÍÚHHHÈ ÌÍØTÙÜÜÖÌVÌBBBBWÑÕRPÝÝY]×ÔÙÜÜÔÙ]][J ÌÍÚK ÌÍÚ ÌÍØTÙÜÜÖÉÌÍÚWVÌWK ÌÍØTÙÜÜÖÉÌÍÚWVÌJBBBS^Q[ÝÚ]ÚBT] ÌÍÑÕRWÔSQTÑÂ[[Â[ÈÓÝY]×ÕÓWÔÒVJ ÌÍÚÛ ÌÍÓÙË ÌÍÝÔ[K ÌÍÛ[JBQÜ ÌÍÚHHHÈ ÌÍØTÙÜÜÖÌVÌBBWÑÕRPÝÝY]×ÔÙÜÜÔÙ]][J ÌÍÚK ÌÍØTÙÜÜÖÉÌÍÚWVÌ×K ÌÍØTÙÜÜÖÉÌÍÚWVÌWK ÌÍØTÙÜÜÖÉÌÍÚWVÌJBS^[[ÂÏOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOBÈ[Ý[Û[YNÑÕRPÝÝY]×ÔÙÜÜÐÜX]J BÈØÜ[Û[ÙÈHÙÜÜØÛÛÛ[HÝY]ÈÛÛÛÈÞ[^ÑÕRPÝÝY]×ÔÙÜÜÐÜX]J ÌÍÜÒÛ ÌÍÜÒ][R[^Ë ÌÍÜÔÝX][R[^JBÈ[Y]ÊN ÌÍÜÒÛH[HÈHÝY]ÈÛÛÛÈ ÌÍÜÒ][R[^HÈÙY[^ÙH][H]ÚXÚHÙÜÜØÚÝ[H[ÙYÈ ÌÍÜÔÝX][R[^HÓÜ[Û[HÈÙY[^ÙHÝX][HÚHÙÜÜØÚÝ[HXÙYÈ ÙY][ÈKÂÈ][YJÊN]ÈHY[YY ÛÛÛQ HÙH]ÈÙÜÜØÛÛÛÈ]Z[Y[ ÊN]]Ò]ËL[XÝBÈÝJÊNÜ[X[[[Ý[ÙÙÜÜØÛÛÛÈÈ KLLÛÎMÝXÙHÚ]X[H[[Ý[ÙÙÜÜØÛÛÛËÈÈ]]ÜÊNÚ[X[ KËHÚ[JKÚÙÂÏOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOB[ÈÑÕRPÝÝY]×ÔÙÜÜÐÜX]J ÌÍÚÛ ÌÍÚR][R[^ ÌÍÚTÝX][R[^HJBRYÝÒÛ ÌÍÚÛ H[ ÌÍÚÛHÕRPÝÙ][J ÌÍÚÛ BBSØØ[ ÌÍÚTÝ[HHÕÚ[TWÑÙ]Ú[ÝÓÛÊ ÌÍÚÛ ÌÍÑÕÓÔÕSJBÕÚ[TWÔÙ]Ú[ÝÓÛÊ ÌÍÚÛ]Ô ÌÍÚTÝ[K ÌÍÕÔ×ÐÓTÒSSK ÌÍÚTÝ[JBSØØ[ ÌÍØTXÝHÑÕRPÝÝY]×ÑÙ]ÝX][TXÝ ÌÍÚÛ ÌÍÚR][R[^ ÌÍÚTÝX][R[^ BRY ÌÍÚTÙ]ÝÝX][H[ ÌÍÚTÝX][R[^H[BIÌÍØTXÝHÑÕRPÝÝY]×ÑÙ]][TXÝ ÌÍÚÛ ÌÍÚR][R[^BBBBNÓØØ[ ÌÍØS^XÝHÑÕRPÝÝY]×ÑÙ]ÝX][TXÝ ÌÍÚÛ ÌÍÚR][R[^ ÌÍÚTÝX][R[^ ÌJBBNÒYÐ^J ÌÍØS^XÝ H[ ÌÍØTXÝÌHH ÌÍØS^XÝÌHH ÌÍØTXÝÌBQ[YB ÌÍØTÙÜÜÖÌVÌH ÏHBQ[H ÌÍØTÙÜÜÖÉÌÍØTÙÜÜÖÌVÌH ÈWVÍBBIÌÍØTÙÜÜÖÉÌÍØTÙÜÜÖÌVÌWVÌHHÕÚ[TWÐÜX]UÚ[ÝÑ^ ][ÝÛØÝ×ÜÙÜÜÌÌ][ÝË ][ÝÉ][ÝË]Ô ÌÍÕÔ×ÐÒS ÌÍÕÔ×ÕTÒPJKÂBIÌÍØTXÝÌK ÌÍØTXÝÌWK ÌÍØTXÝÌHH ÌÍØTXÝÌK ÌÍØTXÝÌ×HH ÌÍØTXÝÌWK ÌÍÚÛ BB ÌÍØTÙÜÜÖÉÌÍØTÙÜÜÖÌVÌWVÌWHH ÌÍÚR][R[^ ÌÍØTÙÜÜÖÉÌÍØTÙÜÜÖÌVÌWVÌHH ÌÍÚTÝX][R[^ ÌÍØTÙÜÜÖÉÌÍØTÙÜÜÖÌVÌWVÌ×HH ÌÍÚÛB] ÌÍØTÙÜÜÖÉÌÍØTÙÜÜÖÌVÌWVÌB[[Â[ÈÑÕRPÝÝY]×ÔÙÜÜÑ[]J ÌÍÚÛ BSØØ[ ÌÍØUÌWVÌWBBQÜ ÌÍÚHHHÈ ÌÍØTÙÜÜÖÌVÌBBRY ÌÍØTÙÜÜÖÉÌÍÚWVÌH ÉÝÈ ÌÍÚÛ[BBIÌÍØUÌVÌH ÏHBBBTQ[H ÌÍØUÉÌÍØUÌVÌJÌWVÍBBBBBBIÌÍØUÉÌÍØUÌVÌWVÌHH ÌÍØTÙÜÜÖÉÌÍÚWVÌBBBIÌÍØUÉÌÍØUÌVÌWVÌWHH ÌÍØTÙÜÜÖÉÌÍÚWVÌWBBBIÌÍØUÉÌÍØUÌVÌWVÌHH ÌÍØTÙÜÜÖÉÌÍÚWVÌBBBIÌÍØUÉÌÍØUÌVÌWVÌ×HH ÌÍØTÙÜÜÖÉÌÍÚWVÌ×BBQ[YS^BIÌÍØTÙÜÜÈH ÌÍØUBSØØ[ ÌÍØTÝ[HØ[ ][ÝÕÙÌ ][ÝË ][ÝÚ[ ][ÝË ][ÝÑÝÞUÚ[ÝÉ][ÝË ][ÝÚÛ ][ÝË ÌÍÚÛ BRYÜ[]Ù]ÜK BBT] ÌÍØTÝ[ÌH ÉÝÈ[[Â[ÈÑÕRPÝÝY]×ÔÙÜÜÔÙ]ÛÛÜ ÌÍÚÛ ÌÍÚPÛÛÜBT]ÔÙ[YÜØYÙJ ÌÍÚÛ ÌÍÔWÔÑUTÓÓÔ ÌÍÚPÛÛÜ B[[Â[ÈÑÕRPÝÝY]×ÔÙÜÜÔÙ]ÐÛÛÜ ÌÍÚÛ ÌÍÚPÛÛÜBT]ÔÙ[YÜØYÙJ ÌÍÚÛ ÌÍÔWÔÑUÐÓÓÔ ÌÍÚPÛÛÜB[[Â[ÈÑÕRPÝÝY]×ÔÙÜÜÔÙ]][J ÌÍÚTÙÒY ÌÍÓÚÛ ÌÍÚR][R[^ ÌÍÚTÝX][R[^ BSØØ[ ÌÍØTXÝHÑÕRPÝÝY]×ÑÙ]ÝX][TXÝ ÌÍÓÚÛ ÌÍÚR][R[^ ÌÍÚTÝX][R[^ BBRY ÌÍÚTÙ]ÝÝX][H[ ÌÍÚTÝX][R[^H[BIÌÍØTXÝHÑÕRPÝÝY]×ÑÙ]][TXÝ ÌÍÓÚÛ ÌÍÚR][R[^BBBBNÓØØ[ ÌÍØS^XÝHÑÕRPÝÝY]×ÑÙ]ÝX][TXÝ ÌÍÓÚÛ ÌÍÚR][R[^ ÌÍÚTÝX][R[^ ÌJBBNÒYÐ^J ÌÍØS^XÝ H[ ÌÍØTXÝÌHH ÌÍØS^XÝÌHH ÌÍØTXÝÌBQ[YBRY ÌÍÚTÙÒY ÝÈ ÌÍØTÙÜÜÖÌVÌH[]Ù]ÜK BBRY ÌÍØTXÝÌWH È[]S Ú[Ù]Ý]J ÌÍØTÙÜÜÖÉÌÍÚTÙÒYVÌJKH[BWÕÚ[TWÔÚÝÕÚ[ÝÊ ÌÍØTÙÜÜÖÉÌÍÚTÙÒYVÌK ÌÍÔÕ×ÒQJBQ[ÙRY ÌÍØTXÝÌWH ÝÏH[]S Ú[Ù]Ý]J ÌÍØTÙÜÜÖÉÌÍÚTÙÒYVÌJKHH[BWÕÚ[TWÔÚÝÕÚ[ÝÊ ÌÍØTÙÜÜÖÉÌÍÚTÙÒYVÌK ÌÍÔÕ×ÔÒÕÊBQ[YBWÕÚ[TWÓ[ÝUÚ[ÝÊ ÌÍØTÙÜÜÖÉÌÍÚTÙÒYVÌK ÌÍØTXÝÌK ÌÍØTXÝÌWK ÌÍØTXÝÌHH ÌÍØTXÝÌK ÌÍØTXÝÌ×HH ÌÍØTXÝÌWKYJBWÕÚ[TWÔY]ÕÚ[ÝÊ ÌÍØTÙÜÜÖÉÌÍÚTÙÒYVÌK ÌÍÔ×ÒSSQUJB[[Â[ÈÑÕRPÝÝY]×ÔÙÜÜÔÙ]ÜÊ ÌÍÚÛ ÌÍÚTÜÊBT]ÔÙ[YÜØYÙJ ÌÍÚÛ ÌÍÔWÔÑUÔË ÌÍÚTÜË B[[Â[ÈÑÕRPÝÝY]×ÔÙÜÜÔÙ]Ý ÌÍÚÛ ÌÍÚTÝLL BT]ÔÙ[YÜØYÙJ ÌÍÚÛ ÌÍÔWÔÑUÕT ÌÍÚTÝ B[[Â[ÈÑÕRPÝÝY]×ÔÙÜÜÔÝ] ÌÍÚÛ BT]ÔÙ[YÜØYÙJ ÌÍÚÛ ÌÍÔWÔÕTU B[[ Attached all together: ListView_Progress.zip Spoiler Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1 AutoIt Russian Community My Work... Spoiler Projects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating ) * === My topics === * ================================================== ================================================== AutoIt is simple, subtle, elegant. © AutoIt Team Link to comment Share on other sites More sharing options...
wraithdu Posted October 7, 2008 Share Posted October 7, 2008 (edited) Updates - MrCreatoR's version works well on Vista. Good performance and smooth resizing (except for the the normal flicker). rasim's works on Vista now (progress bars move), but CPU usage is still high, resizing suffers as well, and there is a 2-3 second delay to exit the example script. Edited October 7, 2008 by wraithdu Link to comment Share on other sites More sharing options...
rasim Posted October 8, 2008 Author Share Posted October 8, 2008 Not as far as i can see The -12 (when checking the $iCode) message is not needed there, i am not sure what it does, but this is the main causing of high CPU load.Yes, I know about this. But your solution has have a problem: if GUI has have a several ListView controls and user will change columns size of the ListView which has not have progressbars, that your method will cause moving for ListView with progressbars. I was search in the Google and found a solution I used these notifications: $HDN_ITEMCHANGINGA, $HDN_ITEMCHANGINGW, $HDN_ITEMCHANGEDA, $HDN_ITEMCHANGEDW, $LVN_ENDSCROLLThis notifications gets the Header control, not a ListView control. Example: expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <ListViewConstants.au3> #include <HeaderConstants.au3> $GUI = GUICreate("Drag ListView columns!", 420, 240) $ListView = GUICtrlCreateListView("Column1|Column2", 20, 20, 380, 200, $LVS_NOSORTHEADER) $hHeader = GUICtrlSendMsg($ListView, $LVM_GETHEADER, 0, 0) ;Retrieve the header control handle GUICtrlCreateListViewItem("Item 1|SubItem 1", $ListView) GUICtrlCreateListViewItem("Item 2|SubItem 2", $ListView) GUICtrlSendMsg($ListView, $LVM_SETCOLUMNWIDTH, 0, 80) GUICtrlSendMsg($ListView, $LVM_SETCOLUMNWIDTH, 1, 80) GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") GUISetState() Do Until GUIGetMsg() = $GUI_EVENT_CLOSE Func WM_NOTIFY($hWndGUI, $MsgID, $wParam, $lParam) Local $tNMHEADER, $hWndFrom, $iCode, $iItem, $iButton $tNMHEADER = DllStructCreate("hwnd hwndFrom;int idFrom;int code;int iItem;int iButton;ptr pitem", $lParam) $hWndFrom = DllStructGetData($tNMHEADER, "hwndFrom") $iCode = DllStructGetData($tNMHEADER, "code") $iItem = DllStructGetData($tNMHEADER, "iItem") $iButton = DllStructGetData($tNMHEADER, "iButton") Switch $hWndFrom Case $hHeader Switch $iCode Case $HDN_ITEMCHANGED, $HDN_ITEMCHANGEDW ConsoleWrite("Changed item index: " & $iItem & @LF) EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc And as for the resizing window, we can use one more message: WM_SIZE Thanks for this. And now i has update UDF and first post. Need testers Link to comment Share on other sites More sharing options...
MrCreatoR Posted October 8, 2008 Share Posted October 8, 2008 your solution has have a problem: if GUI has have a several ListView controls and user will change columns size of the ListView which has not have progressbars, that your method will cause moving for ListView with progressbarsThe solution is very simple; replace the $hLV inside _ListView_WM_NOTIFY function with $aProgress[$i][3]. The problem is solved This notifications gets the Header control, not a ListView controlI know, but they needed to check if the columns width changed, so we can fit the progress correctly Need testersTested! Bugs found - You need the lines with rectangle checking and progress window hidding... .... If $aRect[1] < 20 And BitAND(WinGetState($aProgress[$iProgId][0]), 2) Then _WinAPI_ShowWindow($aProgress[$iProgId][0], $SW_HIDE) ElseIf $aRect[1] >= 20 And BitAND(WinGetState($aProgress[$iProgId][0]), 2) = 0 Then _WinAPI_ShowWindow($aProgress[$iProgId][0], $SW_SHOW) EndIf .... Otherwise when you scroll up/down you will see the progresses above the listview control. P.S Why you are using the callbacks? to catch the scroll events i used $LVN_ENDSCROLL notification Here is the version that works with more than one ListView controls (many stuff fixed (after looking at your last update ), please check it): ListView_Progress_1.2.zip Spoiler Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1 AutoIt Russian Community My Work... Spoiler Projects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating ) * === My topics === * ================================================== ================================================== AutoIt is simple, subtle, elegant. © AutoIt Team Link to comment Share on other sites More sharing options...
ludocus Posted October 8, 2008 Share Posted October 8, 2008 cool!! very nice! Link to comment Share on other sites More sharing options...
rasim Posted October 9, 2008 Author Share Posted October 9, 2008 name='MrCreatoR' date='Oct 8 2008, 05:27 PM' post='588901' The solution is very simple; replace the $hLV inside _ListView_WM_NOTIFY function with $aProgress[$i][3]. The problem is solved Nice idea! name='MrCreatoR' date='Oct 8 2008, 05:27 PM' post='588901' I know, but they needed to check if the columns width changed, so we can fit the progress correctly Yes, for check of this notice enough these constants: $HDN_ITEMCHANGED, $HDN_ITEMCHANGEDW name='MrCreatoR' date='Oct 8 2008, 05:27 PM' post='588901' Tested! Bugs found - You need the lines with rectangle checking and progress window hidding... Now this don't need name='MrCreatoR' date='Oct 8 2008, 05:27 PM' post='588901' Why you are using the callbacks? to catch the scroll events i used $LVN_ENDSCROLL notification Yes!!! I have forgotten about this. Thank you for this Now UDF looks finished(?) Updated first post. Enjoy! Link to comment Share on other sites More sharing options...
wraithdu Posted October 9, 2008 Share Posted October 9, 2008 Almost there! CPU usage is good now. But if you resize the window vertically smaller to show the vertical scrollbar, then scroll down, the progress bars are drawn on top of the column headers at the tops of the listviews. Link to comment Share on other sites More sharing options...
MrCreatoR Posted October 9, 2008 Share Posted October 9, 2008 Now this don't needSee next post:if you resize the window vertically smaller to show the vertical scrollbar, then scroll down, the progress bars are drawn on top of the column headers at the tops of the listviews.And this is not all, there is few more bugs (sorry, have no time right now to point them out).P.SOnly a little tip: You don't have to update the code in first post with every change found, wait a little, maybe someone will find another bug... so you will not have to update so often. Spoiler Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1 AutoIt Russian Community My Work... Spoiler Projects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating ) * === My topics === * ================================================== ================================================== AutoIt is simple, subtle, elegant. © AutoIt Team 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