/************** This file holds the dialog box window procedures. It will hold the functionality of all dialog boxes. About, Help, Adding New Members....so on. **************/ #include "WinTree.h" // WinTree1.h is 'ifndef' so wont be multipled defind // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // ++++++++++++++++++ BEGIN ABOUTDLGPROC PROCEDURE +++++++++++++++++++++++++++ // This is the dialog box procedure for the about statement. BOOL CALLBACK AboutDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { switch (message) { case WM_INITDIALOG : return TRUE; case WM_COMMAND : switch (LOWORD (wParam)) { case IDOK : case IDCANCEL : EndDialog (hDlg, 0) ; return TRUE ; } // End iner 'switch' break ; } // End outer 'switch' return FALSE ; } // End "AboutDlgProc"... // --------------------- END ABOUTDLGPROC PROCEDURE -------------------------- // --------------------------------------------------------------------------- // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // ++++++++++++++++++ BEGIN EDITDLGPROC PROCEDURE +++++++++++++++++++++++++++ // This is the dialog box procedure for the edit node menue option. BOOL CALLBACK EditDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { int len, i ; TCHAR *szBuffer; TCHAR tcNodeKey ; TreeData *pTD; HWND hwndParent ; switch (message) { case WM_INITDIALOG : // 272 or 0x110 return TRUE; case WM_COMMAND : switch (LOWORD (wParam)) { case IDC_BUTTONRETRIVE : len = GetWindowTextLength(GetDlgItem(hDlg, IDC_EDIT2)); if(len > 0) { szBuffer = (TCHAR*)GlobalAlloc(GPTR, len + 1); GetDlgItemText(hDlg, IDC_EDIT2, szBuffer, len + 1); //... do stuff with text ... tcNodeKey = *szBuffer ; hwndParent = GetParent (hDlg); SendMessage(hwndParent, 1025, tcNodeKey, 0) ; GlobalFree((HANDLE)szBuffer); } return TRUE ; case IDC_BUTTONSAVE : hwndParent = GetParent (hDlg); SendMessage(hwndParent, 1026, 0, 0) ; return TRUE ; case IDOK : // 1 or 0x1 case IDCANCEL : // 2 or 0x2 EndDialog (hDlg, 0) ; return TRUE ; } // End iner 'switch' break ; } // End outer 'switch' return FALSE ; } // --------------------- END EDITDLGPROC PROCEDURE -------------------------- // ---------------------------------------------------------------------------