C - Win32 problem writing in ListBox

Discussion in 'Win32' started by keyboarder, Aug 31, 2010.

  1. keyboarder

    keyboarder New Member

    Joined:
    Aug 31, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Hi all,


    I have a generic WndProc() func running and I have a Dialog Box with a ListBox in it.
    I enter a Menu Item to open the Dialog Box and enter a specific function I created to fill the ListBox
    Code:
    BOOL CALLBACK FillListBox(HWND hWnd, UINT messg, WPARAM wParam, LPARAM lParam);
    The problem i'm facing, is the fact that while I have the Dialog Box opened, it keeps revisiting the WndProc() function and coming back to the FillListBox() in an infinit cycle, causing it to fill the ListBox numerous times.

    Is there a better way to treat the ListBox in the Dialog Box, or a way to only enter the FillListBox() function once?

    Thanks in advance,

    keyboarder
    P.S. I tried creating a modal and non-modal Dialog Box and it still cycles.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice