Results 1 to 13 of 13

Thread: [RESOLVED] LVGROUP Type doesn't release it's previous values??

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2023
    Posts
    724

    Resolved [RESOLVED] LVGROUP Type doesn't release it's previous values??

    I'm trying to use Internet History in one LV Group and in second LV Group are the system drives populated.
    So good so far but I'm not able to set neither Header text or iTitleImage Image for that second group. Even if the icon and name are from resources. Icon becomes 0 and the string becomes null...I'm confused.
    I have tried to empty the LVGROUP Type before setting new info but this doesn't work. I have tried with following but nothing works..
    Code:
       vbaCopyBytesZero ByVal 0, lpLVGRP, lpLVGRP
       FillMemory lpLVGRP, ByVal LenB(lpLVGRP), ByVal 0
    Code:
    Public Function EnumLVItem(ByVal pidlRoot As Long, ucLV As ucBrowseForFolderList, Optional iCount As Integer, Optional ByVal iGroupId As Integer = -1) As Long
      Dim pidlParent As Long
      Dim pidlEnum As Long
      Dim pidlChild As Long
      Dim pidlCombine As Long
      Dim pISI As IShellItem
      Dim pISI2 As IShellItem2
      Dim pISI_child As IShellItem
      Dim pISIA As IShellItemArray
      Dim pIPAI As IParentAndItem
      Dim pISM As IShellMenu
      Dim pISF As IShellFolder2
      Dim pEIDL As IEnumIDList
      Static BHID_StorageEnum As UUID
      Dim pIESHI As IEnumShellItems
      Dim hr As Long
      Dim lpName As Long
      Dim lpNameRoot As Long
      Dim sName As String
      Dim sNameRoot As String
      Dim sTypeName As String
      Dim sExt As String
      
      Dim hIcon As Long
      Dim hNode As Long
      Dim iIconIndex As Long
      Dim iRootIcon As Integer
      Dim dwAttribs As Long
      Dim hWndIL As Long
      Dim i As Integer
      
    '  hWndIL = ObjPtr(GetIImageList2(SHIL_SMALL))
    '
    '  Call SendMessage(g_hWndTV, TVM_SETIMAGELIST, ByVal TVSIL_NORMAL, ByVal hWndIL)
     
      iCount = 0
      
      hr = SHCreateItemFromIDList(pidlRoot, IID_IShellItem, pISI)
      
      'IIDFromString StrPtr("{4621A4E3-F0D6-4773-8A9C-46E77B174840}"), BHID_StorageEnum
      'BHID_EnumItems
      hr = pISI.BindToHandler(0, BHID_EnumItems, IID__IEnumShellItems, pIESHI)
      'hr = pISI.BindToHandler(0, BHID_SFObject, IID__IShellFolder, pISF)
      
      'pISF.EnumObjects 0, SHCONTF_FOLDERS Or SHCONTF_NONFOLDERS Or SHCONTF_STORAGE, pEIDL
      'Do While pEIDL.Next(1, pidlEnum, 0) = S_OK
      On Error GoTo err_out
      
       sNameRoot = ""
       lpNameRoot = 0
    '  pidlRoot = 0
      
      Do While pIESHI.Next(1, pISI_child, 0) = S_OK
           DoEvents
           Set pIPAI = pISI_child
           Set pISI2 = pISI_child
    
           pIPAI.GetParentAndItem pidlParent, pISF, pidlChild
           
           pISI_child.GetDisplayName SIGDN_NORMALDISPLAY, lpName
    
           pidlEnum = GetPIDLFromObject(pISI_child)
           
           iIconIndex = GetItemIconIndex(pidlEnum, False)
           
             'GetIShellLibrary pidlEnum  <---- HOW TO JUMP OVER THE AUTOMATION ERROR?
           sNameRoot = ""
           lpNameRoot = 0
             
           SHGetNameFromIDList pidlRoot, SIGDN_NORMALDISPLAY, lpNameRoot
           
           sNameRoot = StrConv(SysAllocString(lpNameRoot), vbFromUnicode)
          
           iRootIcon = GetItemIconIndex(pidlRoot, False)
           
           ucLV.AddGroup iGroupId, sNameRoot, iRootIcon, "Bibliotekets Mappar - Fälls ut eller fälls in via pilikonen i högra hörnet."
           
           SHGetNameFromIDList pidlEnum, SIGDN_NORMALDISPLAY, lpName
           
           sName = StrConv(SysAllocString(lpName), vbFromUnicode)
          
           ucLV.AddItems iCount, sName, iIconIndex, iGroupId, pidlEnum
           
           CoTaskMemFree pidlEnum
    '        'CoTaskMemFree pidlChild
            CoTaskMemFree pidlCombine
            CoTaskMemFree lpName
            CoTaskMemFree lpNameRoot
            Set pISF = Nothing
            Set pISI_child = Nothing
            Set pIPAI = Nothing
            iCount = iCount + 1
             SHUpdateImageW StrPtr(sName), iIconIndex, &H2, iIconIndex
            iIconIndex = Shell_GetCachedImageIndexW(lpName, iIconIndex, 0&)
            lpNameRoot = 0
            pidlRoot = 0
            lpName = 0
            sNameRoot = 0
      Loop
    err_out:
       Debug.Print Err.Number & " , " & Err.Description
    End Function
    
    Public Function EnumLVItem(ByVal pidlRoot As Long, ucLV As ucBrowseForFolderList, Optional iCount As Integer, Optional ByVal iGroupId As Integer = -1) As Long
      Dim pidlParent As Long
      Dim pidlEnum As Long
      Dim pidlChild As Long
      Dim pidlCombine As Long
      Dim pISI As IShellItem
      Dim pISI2 As IShellItem2
      Dim pISI_child As IShellItem
      Dim pISIA As IShellItemArray
      Dim pIPAI As IParentAndItem
      Dim pISM As IShellMenu
      Dim pISF As IShellFolder2
      Dim pEIDL As IEnumIDList
      Static BHID_StorageEnum As UUID
      Dim pIESHI As IEnumShellItems
      Dim hr As Long
      Dim lpName As Long
      Dim lpNameRoot As Long
      Dim sName As String
      Dim sNameRoot As String
      Dim sTypeName As String
      Dim sExt As String
      
      Dim hIcon As Long
      Dim hNode As Long
      Dim iIconIndex As Long
      Dim iRootIcon As Integer
      Dim dwAttribs As Long
      Dim hWndIL As Long
      Dim i As Integer
      
    '  hWndIL = ObjPtr(GetIImageList2(SHIL_SMALL))
    '
    '  Call SendMessage(g_hWndTV, TVM_SETIMAGELIST, ByVal TVSIL_NORMAL, ByVal hWndIL)
     
      iCount = 0
      
      hr = SHCreateItemFromIDList(pidlRoot, IID_IShellItem, pISI)
      
      'IIDFromString StrPtr("{4621A4E3-F0D6-4773-8A9C-46E77B174840}"), BHID_StorageEnum
      'BHID_EnumItems
      hr = pISI.BindToHandler(0, BHID_EnumItems, IID__IEnumShellItems, pIESHI)
      'hr = pISI.BindToHandler(0, BHID_SFObject, IID__IShellFolder, pISF)
      
      'pISF.EnumObjects 0, SHCONTF_FOLDERS Or SHCONTF_NONFOLDERS Or SHCONTF_STORAGE, pEIDL
      'Do While pEIDL.Next(1, pidlEnum, 0) = S_OK
      On Error GoTo err_out
      
       sNameRoot = ""
       lpNameRoot = 0
      
      Do While pIESHI.Next(1, pISI_child, 0) = S_OK
           DoEvents
           Set pIPAI = pISI_child
           Set pISI2 = pISI_child
    
           pIPAI.GetParentAndItem pidlParent, pISF, pidlChild
           
           pISI_child.GetDisplayName SIGDN_NORMALDISPLAY, lpName
    
           pidlEnum = GetPIDLFromObject(pISI_child)
           
           iIconIndex = GetItemIconIndex(pidlEnum, False)
           
             'GetIShellLibrary pidlEnum  <---- HOW TO JUMP OVER THE AUTOMATION ERROR?
           sNameRoot = ""
           lpNameRoot = 0
             
           SHGetNameFromIDList pidlRoot, SIGDN_NORMALDISPLAY, lpNameRoot
           
           sNameRoot = StrConv(SysAllocString(lpNameRoot), vbFromUnicode)
          
           iRootIcon = GetItemIconIndex(pidlRoot, False)
           
           ucLV.AddGroup iGroupId, sNameRoot, iRootIcon, "Bibliotekets Mappar - Fälls ut eller fälls in via pilikonen i högra hörnet."
           
           SHGetNameFromIDList pidlEnum, SIGDN_NORMALDISPLAY, lpName
           
           sName = StrConv(SysAllocString(lpName), vbFromUnicode)
          
           ucLV.AddItems iCount, sName, iIconIndex, iGroupId, pidlEnum
           
           CoTaskMemFree pidlEnum
    '        'CoTaskMemFree pidlChild
            CoTaskMemFree pidlCombine
            CoTaskMemFree lpName
            CoTaskMemFree lpNameRoot
            Set pISF = Nothing
            Set pISI_child = Nothing
            Set pIPAI = Nothing
            iCount = iCount + 1
             SHUpdateImageW StrPtr(sName), iIconIndex, &H2, iIconIndex
            iIconIndex = Shell_GetCachedImageIndexW(lpName, iIconIndex, 0&)
            lpNameRoot = 0
            pidlRoot = 0
            lpName = 0
            sNameRoot = 0
      Loop
    err_out:
       Debug.Print Err.Number & " , " & Err.Description
    End Function
    So what I lack or missing is "This Computer" string and it's associated icon which I have in store but I'm not able to put it into the LVGROUP Type.
    Attached Images Attached Images  
    Last edited by nebeln; Nov 24th, 2023 at 07:40 PM.

  2. #2

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2023
    Posts
    724

    Re: LVGROUP Type doesn't release it's previous values??

    Oh I did forget to add this code snippet which starts all this.

    Code:
    Private Sub Command4_Click()
      Dim pidl As Long
      Dim pidl2 As Long
      Dim i As Integer
      Dim c As Integer
      
      ucBrowseForFolderList1.LargeImageList = ObjPtr(GetIImageList2(SHIL_EXTRALARGE))
      ucBrowseForFolderList1.SmallImageList = ObjPtr(GetIImageList2(SHIL_SMALL))
      ucBrowseForFolderList1.GroupHeaderImageList = ObjPtr(GetIImageList2(SHIL_SYSSMALL))
        
     ucBrowseForFolderList1.Clear
     
      ucBrowseForFolderList1.GroupView = True
        
      pidl = m_cShell32.GetPIDLFromSpecialFolder(CSIDL_HISTORY)
       
      Form1.Caption = ucBrowseForFolderList1.IsGroupViewEnabled
      m_cShell32.EnumLVItem pidl, ucBrowseForFolderList1, i, 0
     
      CoTaskMemFree pidl
      pidl = 0
     
      pidl2 = m_cShell32.GetPIDLFromSpecialFolder(CSIDL_DRIVES)
      m_cShell32.EnumLVItem pidl2, ucBrowseForFolderList1, i, 1
    
    End Sub

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2023
    Posts
    724

    Re: LVGROUP Type doesn't release it's previous values??

    The issue is solved...I changed the GroupId index to EnumId index and WHOLAA and it's all came clear

    Code:
    Public Function EnumLVItem(ByVal pidlRoot As Long, ucLV As ucBrowseForFolderList, Optional iCount As Integer, Optional ByVal iGroupId As Integer = -1) As Long
      Dim pidlParent As Long
      Dim pidlEnum As Long
      Dim pidlChild As Long
      Dim pidlCombine As Long
      Dim pISI As IShellItem
      Dim pISI2 As IShellItem2
      Dim pISI_child As IShellItem
      Dim pISIA As IShellItemArray
      Dim pIPAI As IParentAndItem
      Dim pISM As IShellMenu
      Dim pISF As IShellFolder2
      Dim pEIDL As IEnumIDList
      Static BHID_StorageEnum As UUID
      Dim pIESHI As IEnumShellItems
      Dim hr As Long
      Dim lpName As Long
      Dim lpNameRoot As Long
      Dim sName As String
      Dim sNameRoot As String
      Dim sTypeName As String
      Dim sExt As String
      
      Dim hIcon As Long
      Dim hNode As Long
      Dim iIconIndex As Long
      Dim iRootIcon As Integer
      Dim dwAttribs As Long
      Dim hWndIL As Long
      Dim i As Integer
      
    '  hWndIL = ObjPtr(GetIImageList2(SHIL_SMALL))
    '
    '  Call SendMessage(g_hWndTV, TVM_SETIMAGELIST, ByVal TVSIL_NORMAL, ByVal hWndIL)
     
      iCount = 0
      
      hr = SHCreateItemFromIDList(pidlRoot, IID_IShellItem, pISI)
      
      'IIDFromString StrPtr("{4621A4E3-F0D6-4773-8A9C-46E77B174840}"), BHID_StorageEnum
      'BHID_EnumItems
      hr = pISI.BindToHandler(0, BHID_EnumItems, IID__IEnumShellItems, pIESHI)
      'hr = pISI.BindToHandler(0, BHID_SFObject, IID__IShellFolder, pISF)
      
      'pISF.EnumObjects 0, SHCONTF_FOLDERS Or SHCONTF_NONFOLDERS Or SHCONTF_STORAGE, pEIDL
      'Do While pEIDL.Next(1, pidlEnum, 0) = S_OK
      On Error GoTo err_out
      
       sNameRoot = ""
       lpNameRoot = 0
      
      Do While pIESHI.Next(1, pISI_child, 0) = S_OK
           Set pIPAI = pISI_child
           Set pISI2 = pISI_child
    
           pIPAI.GetParentAndItem pidlParent, pISF, pidlChild
           
           pISI_child.GetDisplayName SIGDN_NORMALDISPLAY, lpName
    
           pidlEnum = GetPIDLFromObject(pISI_child)
           
           iIconIndex = GetItemIconIndex(pidlEnum, False)
           
             'GetIShellLibrary pidlEnum  <---- HOW TO JUMP OVER THE AUTOMATION ERROR?
            SHGetNameFromIDList pidlRoot, SIGDN_NORMALDISPLAY, lpNameRoot
            sNameRoot = StrConv(SysAllocString(lpNameRoot), vbFromUnicode)
            iRootIcon = GetItemIconIndex(pidlRoot, False)
            sNameRoot = StrConv(SysAllocString(lpNameRoot), vbFromUnicode)
            ucLV.AddGroup iCount, sNameRoot, iRootIcon, "Bibliotekets Mappar - Fälls ut eller fälls in via pilikonen i högra hörnet."
          
           SHGetNameFromIDList pidlEnum, SIGDN_NORMALDISPLAY, lpName
           
           sName = StrConv(SysAllocString(lpName), vbFromUnicode)
          
           ucLV.AddItems iCount, sName, iIconIndex, iGroupId, pidlEnum
          
           CoTaskMemFree pidlEnum
    '        'CoTaskMemFree pidlChild
            CoTaskMemFree pidlCombine
            CoTaskMemFree lpName
            CoTaskMemFree lpNameRoot
            Set pISF = Nothing
            Set pISI_child = Nothing
            Set pIPAI = Nothing
            iCount = iCount + 1
             SHUpdateImageW StrPtr(sName), iIconIndex, &H2, iIconIndex
            iIconIndex = Shell_GetCachedImageIndexW(lpName, iIconIndex, 0&)
            lpNameRoot = 0
            pidlRoot = 0
            lpName = 0
            sNameRoot = 0
      Loop
    err_out:
       Debug.Print Err.Number & " , " & Err.Description
    End Function
    Attached Images Attached Images  

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2023
    Posts
    724

    Re: LVGROUP Type doesn't release it's previous values??

    And as I wanted it to be...struggle and perseverance in what you do is the key
    Attached Images Attached Images  

  5. #5
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    5,548

    Re: [RESOLVED] LVGROUP Type doesn't release it's previous values??

    Just a heads up this is the 2nd thread you've mistakenly posted in the CodeBank in the past couple days, which is for code samples/full projects only. Besides the wrong topic, as a practical matter you're more likely to get answers in the proper 'VB6 and earlier' forum.

  6. #6

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2023
    Posts
    724

    Re: [RESOLVED] LVGROUP Type doesn't release it's previous values??

    Oh, sorry, can they be moved? Have been a little bit tired.

  7. #7
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    5,548

    Re: [RESOLVED] LVGROUP Type doesn't release it's previous values??

    The mods can move it; you can use the 'Report post' function (the little warning symbol next to 'rate this post' at the bottom of your post). That will take you to form asking why you're reporting it, just say posted in the wrong forum and should be in (for this thread) VB6 and earlier. It's not a penalty or anything, just flags it so they see it.

  8. #8
    Super Moderator FunkyDexter's Avatar
    Join Date
    Apr 2005
    Location
    An obscure body in the SK system. The inhabitants call it Earth
    Posts
    7,900

    Re: [RESOLVED] LVGROUP Type doesn't release it's previous values??

    the mods can move it;
    qed
    The best argument against democracy is a five minute conversation with the average voter - Winston Churchill

    Hadoop actually sounds more like the way they greet each other in Yorkshire - Inferrd

  9. #9

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2023
    Posts
    724

    Re: [RESOLVED] LVGROUP Type doesn't release it's previous values??

    I thought this matter was resolved...but no no no...I have bought an older compter for som few money from 2013 and it runs on Win10 Pro Swedish...on a clean disk I installed VB6 and made all configs same as on my laptop which is my primary "dev place" and it runs Win11 Home Edition Swe. I just took my exteranal USB drive and pluged it into this older Win 10 Pro machine and started up the same project and immidiately I run into troubles...instant crashes and/or object not set...a bit confused now

  10. #10

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2023
    Posts
    724

    Re: [RESOLVED] LVGROUP Type doesn't release it's previous values??

    Finally I got it trough and there are some differences in win 10 to Win 11. The above posts are from my Win 11 laptop and the current screenshot is from my Win 10 machine.

    Here is the code I need to twek to make it work - it's a slightly bit difference.

    Hence I'm still not satisfyed due to same indexing as with Win11 I got the CSIDL_HISTORY first and content of My Computer next even if I first enum My Computer...it becomes vice-versa in comparison to Win 11 due to something I don't for know for now.

    Code:
    Private Sub Command4_Click()
      Dim pidl1 As Long
      Dim pidl2 As Long
      Dim i As Integer
      Dim c As Integer
      
      ucBrowseForFolderList1.LargeImageList = ObjPtr(GetIImageList2(SHIL_EXTRALARGE))
      ucBrowseForFolderList1.SmallImageList = ObjPtr(GetIImageList2(SHIL_SMALL))
      ucBrowseForFolderList1.GroupHeaderImageList = ObjPtr(GetIImageList2(SHIL_SYSSMALL))
        
      ucBrowseForFolderList1.Clear
     
      ucBrowseForFolderList1.GroupView = True
        
      pidl1 = m_cShell32.GetPIDLFromSpecialFolder(CSIDL_DRIVES)
      m_cShell32.EnumLVItem pidl1, ucBrowseForFolderList1, i, i
      
      pidl2 = m_cShell32.GetPIDLFromSpecialFolder(CSIDL_HISTORY)
    
      Form1.Caption = ucBrowseForFolderList1.IsGroupViewEnabled
    
      m_cShell32.EnumLVItem pidl2, ucBrowseForFolderList1, i, i
     
      CoTaskMemFree pidl1
      pidl1 = 0
    
      CoTaskMemFree pidl2
      pidl2 = 0
    End Sub
    
    
    Public Function EnumLVItem(ByVal pidlRoot As Long, ucLV As ucBrowseForFolderList, Optional iCount As Integer, Optional ByVal iGroupId As Integer = -1) As Long
      Dim pidlParent As Long
      Dim pidlEnum As Long
      Dim pidlChild As Long
      Dim pidlCombine As Long
      Dim pISI As IShellItem
      Dim pISI2 As IShellItem2
      Dim pISI_child As IShellItem
      Dim pISIA As IShellItemArray
      Dim pIPAI As IParentAndItem
      Dim pISM As IShellMenu
      Dim pISF As IShellFolder2
      Dim pEIDL As IEnumIDList
      Static BHID_StorageEnum As UUID
      Dim pIESHI As IEnumShellItems
      Dim hr As Long
      Dim lpName As Long
      Dim lpNameRoot As Long
      Dim sName As String
      Dim sNameRoot As String
      Dim sTypeName As String
      Dim sExt As String
      
      Dim hIcon As Long
      Dim hNode As Long
      Dim iIconIndex As Long
      Dim iRootIcon As Integer
      Dim dwAttribs As Long
      Dim hWndIL As Long
      Dim i As Integer
      
    '  hWndIL = ObjPtr(GetIImageList2(SHIL_SMALL))
    '
    '  Call SendMessage(g_hWndTV, TVM_SETIMAGELIST, ByVal TVSIL_NORMAL, ByVal hWndIL)
     
      iCount = 0
      
      hr = SHCreateItemFromIDList(pidlRoot, IID_IShellItem, pISI)
      
      'IIDFromString StrPtr("{4621A4E3-F0D6-4773-8A9C-46E77B174840}"), BHID_StorageEnum
      'BHID_EnumItems
      hr = pISI.BindToHandler(0, BHID_EnumItems, IID__IEnumShellItems, pIESHI)
      'hr = pISI.BindToHandler(0, BHID_SFObject, IID__IShellFolder, pISF)
      
      'pISF.EnumObjects 0, SHCONTF_FOLDERS Or SHCONTF_NONFOLDERS Or SHCONTF_STORAGE, pEIDL
      'Do While pEIDL.Next(1, pidlEnum, 0) = S_OK
      On Error GoTo err_out
      
      Do While pIESHI.Next(1, pISI_child, 0) = S_OK
           Set pIPAI = pISI_child
           Set pISI2 = pISI_child
           
           pIPAI.GetParentAndItem pidlParent, pISF, pidlChild
           
           pISI_child.GetDisplayName SIGDN_NORMALDISPLAY, lpName
    
           
             'GetIShellLibrary pidlEnum  <---- HOW TO JUMP OVER THE AUTOMATION ERROR?
           SHGetNameFromIDList pidlRoot, SIGDN_NORMALDISPLAY, lpNameRoot
           sNameRoot = StrConv(SysAllocString(lpNameRoot), vbFromUnicode)
           iRootIcon = GetItemIconIndex(pidlRoot, False)
           sNameRoot = StrConv(SysAllocString(lpNameRoot), vbFromUnicode)
           
           ucLV.AddGroup iCount, sNameRoot, iRootIcon, "Bibliotekets Mappar - Fälls ut eller fälls in via pilikonen i högra hörnet."
          
           pidlEnum = GetPIDLFromObject(pISI_child)
           
           pidlCombine = ILCombine(pidlParent, pidlChild)
           
           SHGetNameFromIDList pidlCombine, SIGDN_NORMALDISPLAY, lpName
                  
           sName = StrConv(SysAllocString(lpName), vbFromUnicode)
           
           iIconIndex = GetItemIconIndex(pidlCombine, False)
           
           ucLV.AddItems iCount, sName, iIconIndex, iGroupId, pidlEnum
          
           iCount = iCount + 1
           CoTaskMemFree pidlEnum
           CoTaskMemFree pidlChild
           CoTaskMemFree pidlCombine
           CoTaskMemFree lpName
           CoTaskMemFree lpNameRoot
           Set pISF = Nothing
           Set pISI_child = Nothing
           Set pIPAI = Nothing
           
           SHUpdateImageW StrPtr(sName), iIconIndex, &H2, iIconIndex
           'iIconIndex = Shell_GetCachedImageIndexW(lpName, iIconIndex, 0&)
           lpNameRoot = 0
           pidlRoot = 0
           lpName = 0
           sNameRoot = 0
      Loop
    err_out:
       Debug.Print Err.Number & " , " & Err.Description
    End Function
    Attached Images Attached Images  

  11. #11
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    5,548

    Re: [RESOLVED] LVGROUP Type doesn't release it's previous values??

    You can sort the groups yourself with LVM_INSERTGROUPSORTED or LVM_SORTGROUPS.

  12. #12

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2023
    Posts
    724

    Re: [RESOLVED] LVGROUP Type doesn't release it's previous values??

    Aha, I had forgotten about the latter one. The first one I knew but it seemed so complicated with an sorting Type and a Callback sorting routine.

  13. #13

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2023
    Posts
    724

    Re: [RESOLVED] LVGROUP Type doesn't release it's previous values??

    Something like this...It was not complicated after all. Probably not correct but it did the deed
    Code:
    lr = SendMessage(m_hWndLV, LVM_SORTGROUPS, AddressOf LVGroupCompare, lpGRPCMP)
    
    Public Function LVGroupCompare(ByVal lParam1 As Long, ByVal lParam2 As Long, ByRef lParam3 As Long) As Long
      If lParam1 >= lParam2 Then
        LVGroupCompare = lParam2
      End If
      If lParam2 <= lParam1 Then
        LVGroupCompare = lParam1
      End If
    End Function
    Attached Images Attached Images  

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width