Rahul Rohela Posted July 3, 2006 Share Posted July 3, 2006 Hi, Is it possible to increase limit of treeview item from 4072 Items.. Please suggest.... expandcollapse popupTraySetState ( 2 ) #include <GUIConstants.au3> #include <GuiListView.au3> #include <File.au3> #Include <GuiTreeView.au3> #include <Math.au3> Opt ("MustDeclareVars", 1) Dim $ListTxt, $LogFilePath, $NavGUI, $PCList, $Context_menu, $ScanContext, $ScanSelect, $Finaldiaplay, $Open, $Scan, $Exit, $LogCheckBox, $LogCheckBox2 Dim $LogFileLoc, $logButton, $LogFile, $LogFileDiffrent, $Status, $Count_Live, $fileOpen, $i1, $FileRead, $msg, $CountWS, $Count, $PingWS, $var, $AutoProtectvalue Dim $HotFixKey, $year, $month, $date, $rev, $file, $FileCopy, $TreeViewItem, $HotFixTree, $Y, $RegVal, $SAVTree, $HotfixTop, $Context_Tree, $Context_Tree_Copy Dim $Context_Tree_Delete, $Txt, $Context_Tree_Collaps, $h_item, $setTxt, $MathVal Global Const $MIM_APPLYTOSUBMENUS = 0x80000000 Global Const $MIM_BACKGROUND = 0x00000002 $NavGUI = GUICreate("SAV and Hotfix Scan", 600,600,-1,-1) $PCList = GUICtrlCreateListView("PC list to Scan",-1,-1,200,470,$WS_TABSTOP+$WS_BORDER) _GUICtrlListViewSetColumnWidth ($PCList, 0, 196) $Context_menu = GUICtrlCreateContextMenu($PCList) $ScanContext = GUICtrlCreateMenuitem("Scan All",$Context_menu) GUICtrlCreateMenuitem("",$Context_menu) $ScanSelect = GUICtrlCreateMenuitem("Scan Selected",$Context_menu) ;$Finaldiaplay = GUICtrlCreateEdit("",204,-1,395,470,$ES_AUTOVSCROLL+$WS_VSCROLL+$ES_READONLY+$WS_HSCROLL) ;Local $EM_SetLimitText = 197 ;Local $MaxSize = 2000000 ;GUICtrlSendMsg($Finaldiaplay, $EM_SetLimitText, $MaxSize, 0) ;GUICtrlSetBKColor($Finaldiaplay,0XFFFFFF) ;***********************Tree view******************* $Finaldiaplay = GUICtrlCreateTreeView(204,-1,395,470,BitOr($TVS_HASBUTTONS, $TVS_HASLINES, $TVS_LINESATROOT, $TVS_DISABLEDRAGDROP, $TVS_SHOWSELALWAYS), $WS_EX_CLIENTEDGE) Local $EM_SetLimitText = 197 Local $MaxSize = 2000000 GUICtrlSendMsg($Finaldiaplay, $EM_SetLimitText, $MaxSize, 0) GUICtrlSetBKColor($Finaldiaplay,0XFFFFFF) $Context_Tree = GUICtrlCreateContextMenu($Finaldiaplay) $Context_Tree_Copy = GUICtrlCreateMenuitem("Copy",$Context_Tree) GUICtrlCreateMenuitem("",$Context_Tree) $Context_Tree_Collaps = GUICtrlCreateMenuitem("Collaps All",$Context_Tree) GUICtrlCreateMenuitem("",$Context_Tree) $Context_Tree_Delete = GUICtrlCreateMenuitem("Delete Selected",$Context_Tree) $Open = GUICtrlCreateButton("Open",14,474,40,22,BitOr(0x0001,0x8000)) $Scan = GUICtrlCreateButton("Scan",78,474,40,22,BitOr(0x0001,0x8000)) $Exit = GUICtrlCreateButton("Exit",140,474,40,22,BitOr(0x0001,0x8000)) $LogCheckBox = GUICtrlCreateCheckbox("Overwrite log file.",250,476,100,22,$BS_AUTORADIOBUTTON) GUICtrlSetState($LogCheckBox,$GUI_CHECKED) $LogCheckBox2 = GUICtrlCreateCheckbox("Append to log file.",450,476,105,22,$BS_AUTORADIOBUTTON) GUICtrlCreateLabel("LogFile Location:",4,510,85,22) $LogFileLoc = GUICtrlCreateInput (@ScriptDir,100,508,225,22,$ES_READONLY+$ES_AUTOHSCROLL) $logButton = GUICtrlCreateButton("....",330,508,25,22,BitOr(0x0001,0x8000)) GUICtrlCreateLabel("LogFile Name:",365,510,85,22) $LogFile = GUICtrlCreateInput ("NavHotfix.txt",455,508,130,22) $LogFileDiffrent = GUICtrlCreateCheckbox("Create different log file for each workstation (File name will be same as workstation name).",5,540,445,22,$BS_AUTORADIOBUTTON) $Status = GUICtrlCreateLabel("",2,570,596,22,BitOR($SS_SUNKEN, $SS_CENTER) ) For $aa = 0 To 6000 ;GUICtrlCreateListViewItem("item" & Mod($aa, 100) + 1, $listview) GUICtrlCreateTreeViewItem("item" & $aa,$Finaldiaplay) Next GUISetState (@SW_SHOW) ;_TxtFileReadSatrt() While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop Select Case $msg = $Exit ExitLoop EndSelect Wend Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted July 3, 2006 Moderators Share Posted July 3, 2006 randallac was working on something like this I believe. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
randallc Posted July 3, 2006 Share Posted July 3, 2006 Hi, I haven't used it, but, as with listview, this seems to work on first look; "_GUICtrlTreeViewInsertItem($treeview, "RootItem" & $i)" from helpfile with 5000; expandcollapse popup#include <GuiTreeView.au3> Opt("MustDeclareVars", 1) Dim $h_GUI, $Msg, $treeview Dim $h_root1, $h_root2, $h_root3 Dim $n_btn_insert $h_GUI = GUICreate("TreeView UDF Sample", 220, 250) $treeview = GUICtrlCreateTreeView(10, 10, 200, 200, -1, $WS_EX_CLIENTEDGE) GUICtrlSetImage(-1, "shell32.dll", 3, 4) GUICtrlSetImage(-1, "shell32.dll", 4, 2) $h_root1 = _GUICtrlTreeViewInsertItem($treeview, "RootItem1") _GUICtrlTreeViewInsertItem($treeview, "SubItem1", $h_root1) _GUICtrlTreeViewInsertItem($treeview, "SubItem2", $h_root1) $h_root2 = _GUICtrlTreeViewInsertItem($treeview, "RootItem2") $h_root3 = _GUICtrlTreeViewInsertItem($treeview, "RootItem3") _GUICtrlTreeViewInsertItem($treeview, "SubItem3", $h_root3) _GUICtrlTreeViewInsertItem($treeview, "SubItem4", $h_root3) $n_btn_insert = GUICtrlCreateButton("Insert Items", 10, 220, 200, 20) GUISetState() While 1 $Msg = GUIGetMsg() Switch $Msg Case $GUI_EVENT_CLOSE ExitLoop Case $n_btn_insert GUICtrlSetCursor($treeview, 1) For $i = 3 To 5000 _GUICtrlTreeViewInsertItem($treeview, "RootItem" & $i) ToolTip((500 - $i) & " items are created...") Next ToolTip("") GUICtrlSetCursor($treeview, 2) EndSwitch WEnd ExitRandallc ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
Rahul Rohela Posted July 3, 2006 Author Share Posted July 3, 2006 Hi, I haven't used it, but, as with listview, this seems to work on first look; "_GUICtrlTreeViewInsertItem($treeview, "RootItem" & $i)" from helpfile with 5000; expandcollapse popup#include <GuiTreeView.au3> Opt("MustDeclareVars", 1) Dim $h_GUI, $Msg, $treeview Dim $h_root1, $h_root2, $h_root3 Dim $n_btn_insert $h_GUI = GUICreate("TreeView UDF Sample", 220, 250) $treeview = GUICtrlCreateTreeView(10, 10, 200, 200, -1, $WS_EX_CLIENTEDGE) GUICtrlSetImage(-1, "shell32.dll", 3, 4) GUICtrlSetImage(-1, "shell32.dll", 4, 2) $h_root1 = _GUICtrlTreeViewInsertItem($treeview, "RootItem1") _GUICtrlTreeViewInsertItem($treeview, "SubItem1", $h_root1) _GUICtrlTreeViewInsertItem($treeview, "SubItem2", $h_root1) $h_root2 = _GUICtrlTreeViewInsertItem($treeview, "RootItem2") $h_root3 = _GUICtrlTreeViewInsertItem($treeview, "RootItem3") _GUICtrlTreeViewInsertItem($treeview, "SubItem3", $h_root3) _GUICtrlTreeViewInsertItem($treeview, "SubItem4", $h_root3) $n_btn_insert = GUICtrlCreateButton("Insert Items", 10, 220, 200, 20) GUISetState() While 1 $Msg = GUIGetMsg() Switch $Msg Case $GUI_EVENT_CLOSE ExitLoop Case $n_btn_insert GUICtrlSetCursor($treeview, 1) For $i = 3 To 5000 _GUICtrlTreeViewInsertItem($treeview, "RootItem" & $i) ToolTip((500 - $i) & " items are created...") Next ToolTip("") GUICtrlSetCursor($treeview, 2) EndSwitch WEnd ExitRandallc Thx "_GUICtrlTreeViewInsertItem($treeview, "RootItem" & $i)" solved TreeViewitem limit problem.. now its working fine & accepting more than 7000 items.. IS this a BUG with GUICtrlCreateTreeViewItem??? Link to comment Share on other sites More sharing options...
randallc Posted July 3, 2006 Share Posted July 3, 2006 Thx "_GUICtrlTreeViewInsertItem($treeview, "RootItem" & $i)" solved TreeViewitem limit problem.. now its working fine & accepting more than 7000 items.. IS this a BUG with GUICtrlCreateTreeViewItem???I don't think so; GUICtrlCreateTreeViewItem is a fully fledged handle [limited number available at any one time], which can do other things.. I think the inserted items may have some limitations..? 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...
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