Hi guys,

This is my first posting here, i am trying to learn to program a win32 GUI in code blocks 12.11, but here is the problem,

I have got 2x list boxes on a dialog box window(IDC_LIST1 > Personal Project Notes) and (IDC_LIST2 > Shared Project Notes),see attached pic,
Name:  dialogbox.jpg
Views: 104
Size:  99.1 KB,

The (personal project notes) auto populates on the dialog been created, i can also get the (Shared project notes) to populate from a folder(by clicking button),see attached pic,
Name:  dialogbox populated.jpg
Views: 101
Size:  99.5 KB,

The problem arises when i click the button(update personal) after clicking the(update shared ), it loads the contents of (shared project notes) into the(personal project notes) list box, even after using the clear button too, this still populates (the personal project notes) when clicking the (update personal)button, see attached pic,
Name:  dialogbox wrong.jpg
Views: 105
Size:  99.0 KB,
please could someone help me resolve this problem, has i have been banging my head against a wall for days now,

This is the code i have been currently experimenting with, please excuse the messy code, as most of it is from examples that i have converted to suit my GUI.
Code:
BOOL CALLBACK DlgProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam){
    switch(Message){
        case WM_INITDIALOG:
        CheckRadioButton(HWND (hwnd),IDRADIO, IDRADIO2, IDRADIO);
        {
        DlgDirList(HWND (ID_PROJECT_PROJECT_NOTES), pbuffer, IDC_LISTP, 0, DDL_EXCLUSIVE);
        HWND hListBox = GetDlgItem(hwnd, IDC_LISTP);
        SendMessage(hListBox, LB_DIR, 0, (LPARAM)("*.txt*"));
        }
    break;
        case WM_COMMAND:
            switch(LOWORD(wParam)){
                case ID_UPDATEP:{
                SendDlgItemMessage(HWND(hwnd), IDC_LISTP, LB_RESETCONTENT, 0, 0);
                DlgDirList(HWND (ID_PROJECT_PROJECT_NOTES), pbuffer, IDC_LISTP, 0, DDL_EXCLUSIVE);
                HWND hListBox = GetDlgItem(hwnd, IDC_LISTP);
                SendMessage(hListBox, LB_DIR, 0, (LPARAM)("*.txt"));

                }
                break;
                case ID_UPDATES:{
                SendDlgItemMessage(HWND(hwnd), IDC_LISTS, LB_RESETCONTENT, 0, 0);
                DlgDirList(HWND (ID_PROJECT_PROJECT_NOTES), sbuffer, IDC_LISTS, 0, DDL_EXCLUSIVE);
                HWND hList = GetDlgItem(hwnd, IDC_LISTS);
                SendMessage(hList, LB_DIR, 0, (LPARAM)("*.txt"));

                }
                break;
                case IDCLEAR:
                SendDlgItemMessage(HWND(hwnd), IDC_LISTP, LB_RESETCONTENT, 0, 0);
                SendDlgItemMessage(HWND(hwnd), IDC_LISTS, LB_RESETCONTENT, 0, 0);

                    break;
                case IDCREATE:{
                DialogBox(GetModuleHandle(NULL), MAKEINTRESOURCE(IDPAD), NULL, DlgProc);
                }
                    break;

                case IDOK:
                EndDialog(hwnd, IDOK);
                break;
                case IDCANCEL:
                EndDialog(hwnd, IDCANCEL);
                break;
            }
            break;

        case WM_CLOSE:
            EndDialog(hwnd, 0);
        break;
        default:

            return FALSE;
    }
    return TRUE;
}