Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Edit Subitems In Owner Drawn List

Edit Subitems In Owner Drawn List

Scheduled Pinned Locked Moved C / C++ / MFC
announcement
7 Posts 4 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    DanYELL
    wrote on last edited by
    #1

    I cant use SetItemText() for an owner drawn list control. I try using HWND hWnd1 = ::GetDlgItem (m_hWnd,IDC_LIST_1095C); LVITEM lvi; lvi.iSubItem = 3; lvi.pszText = (LPTSTR) "123"; ::SendMessage(hWnd1, LVM_SETITEMTEXT, 0, (LPARAM)&lvi); But it doesnt update the text in the list. Im missing something and I cant figure out what Im missing. Please any response any one can give me will be greatly appreciated.

    L L B 3 Replies Last reply
    0
    • D DanYELL

      I cant use SetItemText() for an owner drawn list control. I try using HWND hWnd1 = ::GetDlgItem (m_hWnd,IDC_LIST_1095C); LVITEM lvi; lvi.iSubItem = 3; lvi.pszText = (LPTSTR) "123"; ::SendMessage(hWnd1, LVM_SETITEMTEXT, 0, (LPARAM)&lvi); But it doesnt update the text in the list. Im missing something and I cant figure out what Im missing. Please any response any one can give me will be greatly appreciated.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Are you capturing all messags related to the update?

      D 1 Reply Last reply
      0
      • L Lost User

        Are you capturing all messags related to the update?

        D Offline
        D Offline
        DanYELL
        wrote on last edited by
        #3

        I dont know what that means.

        L L 2 Replies Last reply
        0
        • D DanYELL

          I cant use SetItemText() for an owner drawn list control. I try using HWND hWnd1 = ::GetDlgItem (m_hWnd,IDC_LIST_1095C); LVITEM lvi; lvi.iSubItem = 3; lvi.pszText = (LPTSTR) "123"; ::SendMessage(hWnd1, LVM_SETITEMTEXT, 0, (LPARAM)&lvi); But it doesnt update the text in the list. Im missing something and I cant figure out what Im missing. Please any response any one can give me will be greatly appreciated.

          L Offline
          L Offline
          leon de boer
          wrote on last edited by
          #4

          Have you checked the handle hWnd1 in the debugger since you have done zero error checking before you dispatch the message to it? Next you haven't zero lvi half it's fields will have rubbish in them, well at least in release mode. Is the subitem index right, don't forget it is a one-based index ? Finally try calling an update after the message to force a redraw, I can't tell if it's needed or not because this is owner draw and depends what you have done.

          In vino veritas

          1 Reply Last reply
          0
          • D DanYELL

            I dont know what that means.

            L Offline
            L Offline
            leon de boer
            wrote on last edited by
            #5

            It's owner draw ... have you hooked the draw messages you are supposed to. We can't see what you are doing or not doing in the draw parts which are your responsibility.

            In vino veritas

            1 Reply Last reply
            0
            • D DanYELL

              I dont know what that means.

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              Seriously? You have created an owner drawn control and you don't check all the messages that the control receives?

              1 Reply Last reply
              0
              • D DanYELL

                I cant use SetItemText() for an owner drawn list control. I try using HWND hWnd1 = ::GetDlgItem (m_hWnd,IDC_LIST_1095C); LVITEM lvi; lvi.iSubItem = 3; lvi.pszText = (LPTSTR) "123"; ::SendMessage(hWnd1, LVM_SETITEMTEXT, 0, (LPARAM)&lvi); But it doesnt update the text in the list. Im missing something and I cant figure out what Im missing. Please any response any one can give me will be greatly appreciated.

                B Offline
                B Offline
                Bram van Kampen
                wrote on last edited by
                #7

                You must be desperate, seeing that you reverted to the SDK! Been there too, more than once! Did you set the item(s) specifically as 'Owner Draw' in the Resource Editor! If you did not, all the above quoted messages will end up in the 'Bit and Byte Bin', in the nearest toilet! Hope this is helpful, :)

                Bram van Kampen

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups