CoffeeKid Posted December 15, 2004 Share Posted December 15, 2004 How can I see if a TreeView is still loading data? I was looking at ControlCommand to see if there was command like "IsLoading" or something like that. Only thing i can see was "IsEnabled" and "IsVisible". They both return 1. Stupid of me to even check of course it enabled and visible... IT'S LOADING!. #include <File.au3> Dim $s Dim $i Do ; check enabled $s = ControlCommand ( "MyRules", "text", "TTreeView1", "IsEnabled", "" ) _FileWriteLog ( "C:\Temp\test_treeview.txt", "IsEnabled = " & $s ) if $s <> 1 then MsgBox( 1, "TreeView Check", "TreeView is not enabled" ) ; check visible $s = ControlCommand ( "MyRules", "text", "TTreeView1", "IsVisible", "" ) _FileWriteLog ( "C:\Temp\test_treeview.txt", "IsVisible = " & $s ) if $s <> 1 then MsgBox( 1, "TreeView Check", "TreeView is not Visible") Sleep( 2000 ) Until $i = 1 Any Ideas? Link to comment Share on other sites More sharing options...
this-is-me Posted December 15, 2004 Share Posted December 15, 2004 Nope. There are no commands currently that can provide the functionality you desire. Who else would I be? Link to comment Share on other sites More sharing options...
Valik Posted December 16, 2004 Share Posted December 16, 2004 Theres no way to know this. A tree view isn't in a state of "loading". Each item is added one at a time. Internally, this would be done in a loop. Only the internal code of the application knows how many items need loaded. That internal data isn't available to the outside (Hence it being called internal, obviously). Link to comment Share on other sites More sharing options...
kanumi Posted December 16, 2004 Share Posted December 16, 2004 If the number of entries in the list does not change for a specified time, often one can assume the loading may be finished. But i could not find a way to know the number of entries in the list with the AutoIT version 102 i currently have to use. At least with help of DLLCall from the current AutoIT Beta it should be possible to get that information. Link to comment Share on other sites More sharing options...
this-is-me Posted December 16, 2004 Share Posted December 16, 2004 You can't get there from here. Who else would I be? Link to comment Share on other sites More sharing options...
kanumi Posted December 16, 2004 Share Posted December 16, 2004 Isn't it possible this way? $hwnd = ControlGethandle("TheWindow","","ListBox1") Global $LB_GETCOUNT = 0x018B $lbcount = dllcall("user32.dll","int","SendMessage","hWnd",$hwnd,"int",$LB_GETCOUNT,"int", 0,"int", 0) Link to comment Share on other sites More sharing options...
Valik Posted December 16, 2004 Share Posted December 16, 2004 Sure, if the control you're talking about is a ListBox, but not when we're talking about a TreeView. Link to comment Share on other sites More sharing options...
CoffeeKid Posted December 16, 2004 Author Share Posted December 16, 2004 Isn't it possible this way?$hwnd = ControlGethandle("TheWindow","","ListBox1") Global $LB_GETCOUNT = 0x018B $lbcount = dllcall("user32.dll","int","SendMessage","hWnd",$hwnd,"int",$LB_GETCOUNT,"int", 0,"int", 0)<{POST_SNAPBACK}>Since this is a tree view I would need to use TVM_GETCOUNT. Found the api on MSDN but not the value of TVM_GETCOUNT. Link to comment Share on other sites More sharing options...
kanumi Posted December 17, 2004 Share Posted December 17, 2004 Sure, if the control you're talking about is a ListBox, but not when we're talking about a TreeView.<{POST_SNAPBACK}> I mixed that up with something else i was looking for. here is the value from MS-SDK-header file:#define TV_FIRST 0x1100 // TreeView messages #define TVM_GETCOUNT (TV_FIRST + 5)So this should do it:$TVM_GETCOUNT = 0x1105 Link to comment Share on other sites More sharing options...
CoffeeKid Posted December 17, 2004 Author Share Posted December 17, 2004 Gettin' no luv from this either. I keep getting <null> from the dllcall. 2004-12-17 08:25:02 : $TVM_GETCOUNT_dllcall = 2004-12-17 08:25:04 : $TVM_GETCOUNT_dllcall = #include <File.au3> Dim $s Dim $i Dim $hwnd Dim $tvmcount ;Dim $TVM_GETCOUNT = 0x1100 + 5 Dim $TVM_GETCOUNT = 0x1105 WinWaitActive ( "Ad Rate Rules" ) Do ;wait until i really have the handle $hwnd = ControlGetHandle("Ad Rate Rules","","TTreeView1") Until $hwnd <> "" MsgBox(1,"",$hwnd) Do $tvmcount = DllCall("user32.dll","int","SendMessage","hWnd",$hwnd,"int",$TVM_GETCOUNT,"int", 0,"int", 0) _FileWriteLog ( "C:\Temp\test_treeview.txt", "$TVM_GETCOUNT_dllcall = " & $tvmcount ) Sleep( 2000 ) Until $i = 1 Could it be that Valik and this-is-me are right?!?! Next thing your going to tell me the Easter bunny isn't real either. Link to comment Share on other sites More sharing options...
this-is-me Posted December 17, 2004 Share Posted December 17, 2004 You're right. The Easter Bunny isn't real. Neither is Santa Claus. Who else would I be? Link to comment Share on other sites More sharing options...
Valik Posted December 17, 2004 Share Posted December 17, 2004 DllCall returns an array. Link to comment Share on other sites More sharing options...
kanumi Posted December 17, 2004 Share Posted December 17, 2004 I can not see why it should not work, if Santa Claus has almost reached the chimney.Link to TVM_GETCOUNT Search Microsoft with GoogleThe AutoIt Help for the current Beta describes the return values:If the function call fails then @error is set to 1. Otherwise an array is returned that contains the function return value and a copy of all the parameters (including parameters that the function may have modified).$return[0]= function return value$return[1] = param1$return[2] = param2...$return[n] = paramn Link to comment Share on other sites More sharing options...
CoffeeKid Posted December 17, 2004 Author Share Posted December 17, 2004 It worked! Guess I need to RTFM :"> _FileWriteLog ( "C:\tv.txt", "$TVM_GETCOUNT_dllcall_[0] = " & $tvmcount[0] ) 2004-12-17 15:01:27 : $TVM_GETCOUNT_dllcall_[0] = 405 2004-12-17 15:02:18 : $TVM_GETCOUNT_dllcall_[0] = 721 Thanks everybody! Easter Bunny and Santa are real, 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