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. CListBox subclassing

CListBox subclassing

Scheduled Pinned Locked Moved C / C++ / MFC
regexhelpquestion
4 Posts 2 Posters 0 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.
  • J Offline
    J Offline
    Johan Pretorius
    wrote on last edited by
    #1

    I cant get the damn list box to change the ownerdraw property when i subclass it. Part of the code :

    CWnd * wnd = NULL;
        while (wnd = FindWindowEx(this->m_hWnd,(wnd == NULL ? NULL : wnd->m_hWnd),"ListBox",NULL))
        {
            MyListBox * temp = new MyListBox();
            temp->SubclassWindow(wnd->m_hWnd);
            temp->ModifyStyle(0,LBS_OWNERDRAWFIXED);
            TempControlAdd((CWnd*)temp); //for cleanup later
            temp = NULL;
        }

    Thanks for the Help.


    Artificial Intelligence is no match for Natural Stupidity
    No one can understand the truth until he drinks of coffee's frothy goodness. ~Sheik Abd-al-Kadir
    I can't always be wrong ... or can I?

    O J 2 Replies Last reply
    0
    • J Johan Pretorius

      I cant get the damn list box to change the ownerdraw property when i subclass it. Part of the code :

      CWnd * wnd = NULL;
          while (wnd = FindWindowEx(this->m_hWnd,(wnd == NULL ? NULL : wnd->m_hWnd),"ListBox",NULL))
          {
              MyListBox * temp = new MyListBox();
              temp->SubclassWindow(wnd->m_hWnd);
              temp->ModifyStyle(0,LBS_OWNERDRAWFIXED);
              TempControlAdd((CWnd*)temp); //for cleanup later
              temp = NULL;
          }

      Thanks for the Help.


      Artificial Intelligence is no match for Natural Stupidity
      No one can understand the truth until he drinks of coffee's frothy goodness. ~Sheik Abd-al-Kadir
      I can't always be wrong ... or can I?

      O Offline
      O Offline
      Optimus Chaos
      wrote on last edited by
      #2

      Hi there, I think the LBS_OWNERDRAW* styles can be set only upon creation of the listbox control.

      J 1 Reply Last reply
      0
      • O Optimus Chaos

        Hi there, I think the LBS_OWNERDRAW* styles can be set only upon creation of the listbox control.

        J Offline
        J Offline
        Johan Pretorius
        wrote on last edited by
        #3

        Thanks for the help.


        Artificial Intelligence is no match for Natural Stupidity
        No one can understand the truth until he drinks of coffee's frothy goodness. ~Sheik Abd-al-Kadir
        I can't always be wrong ... or can I?

        1 Reply Last reply
        0
        • J Johan Pretorius

          I cant get the damn list box to change the ownerdraw property when i subclass it. Part of the code :

          CWnd * wnd = NULL;
              while (wnd = FindWindowEx(this->m_hWnd,(wnd == NULL ? NULL : wnd->m_hWnd),"ListBox",NULL))
              {
                  MyListBox * temp = new MyListBox();
                  temp->SubclassWindow(wnd->m_hWnd);
                  temp->ModifyStyle(0,LBS_OWNERDRAWFIXED);
                  TempControlAdd((CWnd*)temp); //for cleanup later
                  temp = NULL;
              }

          Thanks for the Help.


          Artificial Intelligence is no match for Natural Stupidity
          No one can understand the truth until he drinks of coffee's frothy goodness. ~Sheik Abd-al-Kadir
          I can't always be wrong ... or can I?

          J Offline
          J Offline
          Johan Pretorius
          wrote on last edited by
          #4

          If anybody need a solution here is one[^]


          Artificial Intelligence is no match for Natural Stupidity
          No one can understand the truth until he drinks of coffee's frothy goodness. ~Sheik Abd-al-Kadir
          I can't always be wrong ... or can I?

          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