ptrex Posted October 9, 2008 Share Posted October 9, 2008 @rasim / MrCreatoR,This is a very nice concept your are showing both.Interesting to see how both of you are challenging each other. I have got an other challenging question. Could this concept be used to add other controls to a listView ?Like for instance adding Hyperlinks to the rows in a certain column. Since a Listview does not support anything else but plain text.This is an example of a Hyperlink / Email control control (Thanks to ProgAndy)Syslink - Hypelink Control and Syslink - Email Controlexpandcollapse popup#include <WinAPI.au3> #include <WindowsConstants.au3> Global Const $WC_LINK = "SysLink" Global Const $WC_LINKA = $WC_LINK Global Const $WC_LINKW = $WC_LINK $Parent = GUICreate("SysLink demo") $g_hLink = _WinAPI_CreateWindowEx(0,$WC_LINK, _ 'For more information, <A HREF="http://www.microsoft.com" ID="LInkIDURL+ID">click here</A> or ' & _ '<A href="http://www.microsoft.com">here</a> or ' & _ '<A href="mailto:xxx.yyyy@mycompany.com&subject=Syslink Demo&body=%0A%0AFrom AutoIT%0A%0A&cc=cc@address.com&bcc=bcc@address.com">E-mail Me</a> or, ' & _ '<A ID="idInfo">here</A>. And at last <a>here</a>', _ BitOR($WS_VISIBLE , $WS_CHILD , $WS_TABSTOP), _ 10,10, 350,60, $Parent) GUICtrlCreateButton("hi",10,80,80,30) GUISetState() GUIRegisterMsg($WM_NOTIFY,"MY_LINK_NOTIFY") While GUIGetMsg() <> -3 Sleep(1) WEnd ;~ // g_hLink is the handle of the SysLink control. Func MY_LINK_NOTIFY($hWnd, $Msg, $wParam, $lParam) Local Const $tagNMLINK = $tagNMHDR & ";" & "UINT mask; int iLink; UINT state; UINT stateMask; WCHAR szID[48]; WCHAR szUrl[2083];" Local $NMHDR = DllStructCreate($tagNMHDR,$lParam) Local $hwndFrom = DllStructGetData($NMHDR,"hwndFrom"); Switch $hwndFrom Case $g_hLink switch DllStructGetData($NMHDR,"code") case $NM_CLICK ContinueCase case $NM_RETURN $NMHDR = DllStructCreate($tagNMLINK,$lParam) Local $iLink = DllStructGetData($NMHDR,"iLink") Local $szURL = DllStructGetData($NMHDR,"szURL") Local $szID = DllStructGetData($NMHDR,"szID") if $szURL <> "" Then Local $ShouldOpen = MsgBox(4, 'Open URL?',"Should the URL be opened? "& @CRLF & $szURL & _ @CRLF & "If available, the Next Line Contains szID:" &@CRLF & $szID ) If $ShouldOpen = 6 Then ShellExecute($szURL, "", "", "open",@SW_SHOW); ElseIf $szID <> "" Then MsgBox(0, 'Link Clicked',"The Link has no URL, but the following szID: " & @CRLF & $szID) Else MsgBox(0, 'Link Clicked',"The Link has no URL, and no szID: " & @CRLF & $szID) EndIf EndSwitch EndSwitch EndFuncWould there be a way of combining this in your UDF ?An other method would be to create an Custum Drawn ListView control. But that seem far more complex ?!Thanks for sharing this so far.Regards,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...
rasim Posted October 9, 2008 Author Share Posted October 9, 2008 See 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.After yesterday's beer my head bursts Fixed.And this is not all, there is few more bugs (sorry, have no time right now to point them out).Ok, I wait.ptrexCould this concept be used to add other controls to a listView ?Hi! Your question very interesting. I try to realize this later Link to comment Share on other sites More sharing options...
ptrex Posted October 9, 2008 Share Posted October 9, 2008 @rasim Thanks for showing the interest. I think it would be come in very handy indead !! regards 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...
MrCreatoR Posted October 10, 2008 Share Posted October 10, 2008 Could this concept be used to add other controls to a listView ?Yes!I posted ListView_SysLink UDF as new Topic. Please check it out. And thanks for the idea! 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...
Armand Posted October 13, 2008 Share Posted October 13, 2008 Great Great Great Concept !!! I've created a Treeview like listview, i mean - it has (+) which opens subtimes for each entry in the listview [like treeview] but it's too much of a costume made so i can't provide a UDF for it... Just... another idea for ya [u]My Au3 Scripts:[/u]____________(E)Lephant, A Share download manager (RS/MU etc)Http1.1 Console, The Ez Way!Internet Reconnection Automation Suite & A Macro Recording Tool.SK's Alarm Clock, Playing '.MP3 & .Wav' Files._________________Is GOD a mistake of the Humanity Or the Humanity is a mistake of GOD ?! Link to comment Share on other sites More sharing options...
Triblade Posted January 18, 2009 Share Posted January 18, 2009 Feature request: Is there any way to get text on top of the progressbar? My active project(s): A-maze-ing generator (generates a maze) My archived project(s): Pong3 (Multi-pinger) Link to comment Share on other sites More sharing options...
Gideon Posted May 18, 2010 Share Posted May 18, 2010 (edited) Hmm.. it's a bummer if you use groups If you read the UDF of guilistview.au3 you will see, most things return to _GUICtrlListView_SetItemEx($hWnd, ByRef $tItem) So I think I have to make a $tagLVITEM structure, I don't know how, but I will respond to you all, when I have it:P Edit: hmm... oke, can't, but then I have to make 100 images:'), hope this wouldn't make it slow:') Edited May 18, 2010 by Gideon Many times you need to think like hobby-bob:') Link to comment Share on other sites More sharing options...
marko29 Posted January 11, 2011 Share Posted January 11, 2011 AdlibRegister("_Progress", 500) Needs to replace AdlibEnable("_Progress", 500) Its new function name, old one is gone Link to comment Share on other sites More sharing options...
Trolleule Posted October 10, 2014 Share Posted October 10, 2014 (edited) I like this UDF, but what about using it with Ownerdraw. I don't get it work. Have someone the ability to implement the feature??? Look at my attachments, tt can directly be used. Try to comment out GUIRegisterMsg($WM_DRAWITEM, "WM_DRAWITEM") and you will se how smooth it works and then activate it again. The ListView is not drawed properly anymore. Example.au3ListView_Progress_ohneProc.au3 Edited October 10, 2014 by Trolleule Link to comment Share on other sites More sharing options...
LarsJ Posted October 12, 2014 Share Posted October 12, 2014 I have just seen this UDF. Nice.Trolleule, I don't know if owner drawn (WM_DRAWITEM) listview items is a good idea. The main problem is that you end up in a situation, where you are executing too much code. I've quickly looked through your code. Especially the for loop you use to handle the columns is spending a lot of time. Since there is already code to update the progressbars, you should not add too much extra code.If you need colors, you're probably better helped by using NM_CUSTOMDRAW notifications. This seems to be easier to implement with a smaller amount of code. And you don't need to implement for loops for the columns yourself. Take a look at this example. But I don't know how good it'll work with progressbars. Controls, File Explorer, ROT objects, UI Automation, Windows Message MonitorCompiled code: Accessing AutoIt variables, DotNet.au3 UDF, Using C# and VB codeShell menus: The Context menu, The Favorites menu. Shell related: Control Panel, System Image ListsGraphics related: Rubik's Cube, OpenGL without external libraries, Navigating in an image, Non-rectangular selectionsListView controls: Colors and fonts, Multi-line header, Multi-line items, Checkboxes and icons, Incremental searchListView controls: Virtual ListViews, Editing cells, Data display functions 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