+ case IDC_BELL_WAVEBROWSE:
+ memset(&of, 0, sizeof(of));
+#ifdef OPENFILENAME_SIZE_VERSION_400
+ of.lStructSize = OPENFILENAME_SIZE_VERSION_400;
+#else
+ of.lStructSize = sizeof(of);
+#endif
+ of.hwndOwner = hwnd;
+ of.lpstrFilter = "Wave Files\0*.WAV\0AllFiles\0*\0\0\0";
+ of.lpstrCustomFilter = NULL;
+ of.nFilterIndex = 1;
+ of.lpstrFile = filename; strcpy(filename, cfg.bell_wavefile);
+ of.nMaxFile = sizeof(filename);
+ of.lpstrFileTitle = NULL;
+ of.lpstrInitialDir = NULL;
+ of.lpstrTitle = "Select Bell Sound File";
+ of.Flags = 0;
+ if (GetOpenFileName(&of)) {
+ strcpy(cfg.bell_wavefile, filename);
+ SetDlgItemText (hwnd, IDC_BELL_WAVEEDIT, cfg.bell_wavefile);
+ }
+ break;
+ case IDC_BELL_WAVEEDIT:
+ if (HIWORD(wParam) == EN_CHANGE)
+ GetDlgItemText (hwnd, IDC_BELL_WAVEEDIT, cfg.bell_wavefile,
+ sizeof(cfg.bell_wavefile)-1);
+ break;