1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

C - Win32 problem writing in ListBox

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

  1. keyboarder

    keyboarder New Member

    Aug 31, 2010
    Likes Received:
    Trophy Points:
    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
    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,

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

Share This Page