Hi There,
the answer you gave me yesterday helped me a lil out of my problem, but I havn't found a way to get a information which boxes are checked. So I searched for a way to save all checked boxes into a mySQL DB. Right now I'm running your ocx in my AccessXP.
nice would be something like:
for each checkedBox in ExplorerTreeView
somecode
next
THX alot in advance, and sorry for my crappy english
MfG Johannes
Checking the checkboxes in front of the icon
Re: Checking the checkboxes in front of the icon
I finally should complete version 2.0 - this is just another situation where it would help much, because version 2.0 allows just what you've written.Johannes wrote:Hi There,
the answer you gave me yesterday helped me a lil out of my problem, but I havn't found a way to get a information which boxes are checked. So I searched for a way to save all checked boxes into a mySQL DB. Right now I'm running your ocx in my AccessXP.
nice would be something like:
for each checkedBox in ExplorerTreeView
somecode
next
However, here's the solution for version 1.x:
Code: Select all
Dim hItem As Long
' ExplorerTreeView methods that return an item handle, return 0
' to identify the root item (only if ShowRoot = False) and -1 to
' "identify" a non-existent item.
hItem = ExTvw1.GetFirstItem ' can return 0
If hItem = 0 Then hItem = -1 ' we'll handle 0 and -1 the same way
While hItem <> -1
If ExTvw1.ItemStateIconIndex(hItem) = 2 Then
' checked, so write the display name to the debug window
Debug.Print ExTvw1.ItemHandleToDisplayName(hItem)
End If
' get the next item to check
hItem = findNextItemToProcess(hItem) ' won't return 0
Wend
Private Function findNextItemToProcess(ByVal hBaseItem As Long)
Dim hDummy As Long
Dim ret As Long
' ExplorerTreeView methods that return an item handle, return 0
' to identify the root item (only if ShowRoot = False) and -1 to
' "identify" a non-existent item.
ret = ExTvw1.ItemGetFirstSubItem(hBaseItem) ' won't return 0
If ret = -1 Then
' the item doesn't have sub-items - try its successor
ret = ExTvw1.ItemGetNextItem(hBaseItem) ' won't return 0
If ret = -1 Then
' there is no successor - try the parent item's successor
' and if we again don't have success, go upwards until
' we find an item with a successor
ret = hBaseItem
hDummy = -1
Do
ret = ExTvw1.ItemGetParentItem(ret) ' can return 0
If (ret <> 0) And (ret <> -1) Then
hDummy = ExTvw1.ItemGetNextItem(ret) ' no 0...
Else
' this is a bit rude, but it improves performance,
' because we don't have to check <ret> again in
' the Loop While statement
Exit Do
End If
Loop While hDummy = -1
' at this point hDummy is either a valid handle or -1
ret = hDummy
End If
End If
findNextItemToProcess = ret
End Function
TiKu
Crunching for Fab36_Folding-Division at Folding@Home. Join Fab36/Fab30! - Folding@Home and BOINC
Boycott DRM! Boycott HDCP!
Boycott DRM! Boycott HDCP!
THX alot, that's working for me over here.
But there seems to be a bug:
if you expand a folder and deexpand it after that, you can't check the box of this folder to check all those subfolders. So once expanded you loose the "parent" ability of a folder.
btw, can your Treeview return the full path with the code you posted?
THX alot again,
MfG Johannes
But there seems to be a bug:
if you expand a folder and deexpand it after that, you can't check the box of this folder to check all those subfolders. So once expanded you loose the "parent" ability of a folder.
btw, can your Treeview return the full path with the code you posted?
THX alot again,
MfG Johannes
That's how the Windows native treeview (SysTreeView32) works. You'll have to check the subfolders yourself in the ItemStateIconChanged event. The TechDemo sample does this.Johannes wrote:But there seems to be a bug:
if you expand a folder and deexpand it after that, you can't check the box of this folder to check all those subfolders. So once expanded you loose the "parent" ability of a folder.
However, I just noticed that this event isn't raised if the state image was changed using the mouse. It's just raised on changes that are done via the keyboard. I'll fix this bug.
Yes, to get the filesystem path of an item, use ItemHandleToFSPath. To get the tree-path (i. e. the path that the item has in the treeview control) use ItemHandleToTreePath.Johannes wrote:btw, can your Treeview return the full path with the code you posted?
Crunching for Fab36_Folding-Division at Folding@Home. Join Fab36/Fab30! - Folding@Home and BOINC
Boycott DRM! Boycott HDCP!
Boycott DRM! Boycott HDCP!
Wow...great. Really nice job on this thingy man 
I created a VB 6.0 file with this ocx, and I didn't needed to register this ocx. Is this right?
So it works here on Access XP but not that good as I want it too...and on VB it works great (where it was designed for...I know
)
Would be nice if you can give a list of all Instructions for your TreeView, as I don't want to extract them all from your ocx (if you open it in a editor you can see some of them
)
THX alot...
MfG Johannes
btw: Dresden ist gar nicht soooo weit weg von hier

I created a VB 6.0 file with this ocx, and I didn't needed to register this ocx. Is this right?
So it works here on Access XP but not that good as I want it too...and on VB it works great (where it was designed for...I know

Would be nice if you can give a list of all Instructions for your TreeView, as I don't want to extract them all from your ocx (if you open it in a editor you can see some of them

THX alot...
MfG Johannes
btw: Dresden ist gar nicht soooo weit weg von hier

Thanks.Anonymous wrote:Wow...great. Really nice job on this thingy man
I created a VB 6.0 file with this ocx, and I didn't needed to register this ocx. Is this right?

Could you give me some more details about what's buggy on Access XP? If it's easy to fix, then why not make the control more compatible with other containers?Anonymous wrote:So it works here on Access XP but not that good as I want it too...and on VB it works great (where it was designed for...I know)
What do you mean? A list of all properties, methods and events? The VB object catalog (just hit F2 in the IDE) gives you such a list. AFAIR Access has something similiar. If you really need a more detailed list, I could write one - but not before March, because I don't have the time before.Anonymous wrote:Would be nice if you can give a list of all Instructions for your TreeView, as I don't want to extract them all from your ocx (if you open it in a editor you can see some of them)
Or do you mean a list of all API methods I'm using? Well, I'm using about 200 of them and many COM interfaces. Do you really need a list?;) If you wonder how I've implemented specific things, feel free to ask me. The control is closed source, but not closed knowledge.
Genau genommen komme ich aus einem Dorf bei Döbeln (Nähe Riesa) und studiere hier "nur". Woher kommen Sie denn?btw: Dresden ist gar nicht soooo weit weg von hier
Crunching for Fab36_Folding-Division at Folding@Home. Join Fab36/Fab30! - Folding@Home and BOINC
Boycott DRM! Boycott HDCP!
Boycott DRM! Boycott HDCP!
Well...I tried on 2 machines where this ocx wasn't registred (one Win2k and one WinXP). It was able tu runn there without any problems. But I tried a Win98 machine also and there was the registration problem.TiKu wrote:Thanks.You must register the control. VB6 did it for you when you integrated the control into your project.

Well, when you try around with the registration status of this ocx sometimes you can't access it in MSAccess any more. Also you can't insert it in the Form and so on. Unfortunaly I wasn't able to reproduce it, so that I can say "Hey...thats it". But the failure had been 2 times since monday.TiKu wrote: Could you give me some more details about what's buggy on Access XP? If it's easy to fix, then why not make the control more compatible with other containers?
Yes...that was it...just a small hit on F2 and everything seems to be more clearly. I'm not interested in those APIs...thx anyway.TiKu wrote: What do you mean? A list of all properties, methods and events? The VB object catalog (just hit F2 in the IDE) gives you such a list. AFAIR Access has something similiar. If you really need a more detailed list, I could write one - but not before March, because I don't have the time before.
Or do you mean a list of all API methods I'm using? Well, I'm using about 200 of them and many COM interfaces. Do you really need a list?;) If you wonder how I've implemented specific things, feel free to ask me. The control is closed source, but not closed knowledge.
Ich bin zwar aus NRW, nähe DDorf, aber dafür das dieses Forum ja die Welt ansprechen soll ist das scho nicht sooo weit weg.TiKu wrote: Genau genommen komme ich aus einem Dorf bei Döbeln (Nähe Riesa) und studiere hier "nur". Woher kommen Sie denn?
MfG Johannes
I just noticed a small mistake in the code I posted:
GetFirstItem can't return 0. So the 2nd line isn't required.
Code: Select all
hItem = ExTvw1.GetFirstItem ' can return 0
If hItem = 0 Then hItem = -1 ' we'll handle 0 and -1 the same way
Crunching for Fab36_Folding-Division at Folding@Home. Join Fab36/Fab30! - Folding@Home and BOINC
Boycott DRM! Boycott HDCP!
Boycott DRM! Boycott HDCP!