/*------------------------------------------------ "Browse" button --------------------------------------------------*/ void OnBrowse(HWND hDlg) { const char *filter = "Bitmap, Icon (*.bmp, *.ico)\0*.bmp;*.ico\0" "Executable (*.exe, *.dll)\0*.exe;*.dll\0" "All (*.*)\0*.*\0\0"; char deffile[MAX_PATH], fname[MAX_PATH]; HFILE hf; char head[2]; GetDlgItemText(hDlg, IDC_FNAMEICON, deffile, MAX_PATH); if(!SelectMyFile(m_hInst, hDlg, filter, 2, deffile, fname)) return; hf = _lopen(fname, OF_READ); if(hf == HFILE_ERROR) return; _lread(hf, head, 2); _lclose(hf); strcpy(m_fname_index, fname); if(head[0] == 'M' && head[1] == 'Z') // Executable { if(InitSelectIcon(hDlg)) PostMessage(hDlg, WM_NEXTDLGCTL, (WPARAM)GetDlgItem(hDlg, IDC_LISTICON), TRUE); } else { EndSelectIcon(hDlg); EndDialog(hDlg, IDOK); } }
/*------------------------------------------------------------------ ---------------------------------- open dialog to browse sound files ------------------------------------------------------------------*/ BOOL BrowseSoundFile(HWND hDlg, const wchar_t* deffile, wchar_t fname[MAX_PATH]) { wchar_t filter[1024], mmfileexts[1024]; DWORD index; filter[0]=filter[1]='\0'; str0cat(filter, MyString(IDS_MMFILE)); GetMMFileExts(mmfileexts); str0cat(filter, mmfileexts); str0cat(filter, MyString(IDS_ALLFILE)); str0cat(filter, L"*.*"); if(!deffile[0] || IsMMFile(deffile)) index = 1; else index = 2; if(SelectMyFile(hDlg, filter, index, deffile, fname)) { if(!wcsncmp(fname,api.root,api.root_len)) { // make relative to waves/ if possible if(!wcsncmp(fname+api.root_len, L"\\waves\\", 7)) { memmove(fname, fname+api.root_len+7, ((wcslen(fname)-api.root_len-7+1) * sizeof fname[0])); } } return 1; } return 0; }
/*------------------------------------------------ clicked "..." button --------------------------------------------------*/ void OnBrowseFile(HWND hDlg, WORD id) { char filter[80], deffile[MAX_PATH], fname[MAX_PATH]; filter[0] = filter[1] = 0; if(id == IDC_BROWSEHELP) { str0cat(filter, "HTML"); str0cat(filter, "*.html;*.htm"); } else if(id == IDC_BROWSEHELP2CH) { str0cat(filter, "HTML"); str0cat(filter, "*.html;*.htm"); } else if(id == IDC_BROWSELANGDLL) { str0cat(filter, MyString(IDS_LANGDLLFILE)); str0cat(filter, "lang*.dll"); } GetDlgItemText(hDlg, id - 1, deffile, MAX_PATH); if(!SelectMyFile(hDlg, filter, 0, deffile, fname)) // propsheet.c return; SetDlgItemText(hDlg, id - 1, fname); PostMessage(hDlg, WM_NEXTDLGCTL, 1, FALSE); SendPSChanged(hDlg); }
//================================================================================================ //-------------------------------------//------+++--> Browse to the Quicky Menu Item's Target File: void BrowseForTargetFile(HWND hBft) //----------------------------------------------------+++--> { wchar_t szFile[MAX_PATH]; if(SelectMyFile(hBft, L"Program Files (*.exe)\0*.exe\0" L"All Files (*.*)\0*.*\0", 0, NULL, szFile)) { SetDlgItemText(hBft, IDC_MID_TARGET, szFile); } }
/*------------------------------------------------ clicked "..." button --------------------------------------------------*/ void OnBrowse(HWND hDlg) { char deffile[MAX_PATH], fname[MAX_PATH]; char *filter = "HTML\0*.html;*.htm\0\0"; GetDlgItemText(hDlg, IDC_HELPURL, deffile, MAX_PATH); if(!SelectMyFile(g_hInst, hDlg, filter, 0, deffile, fname)) return; SetDlgItemText(hDlg, IDC_HELPURL, fname); PostMessage(hDlg, WM_NEXTDLGCTL, 1, FALSE); SendPSChanged(hDlg); }
/*------------------------------------------------ browse bitmap file --------------------------------------------------*/ void OnBrowse(HWND hDlg) { char deffile[MAX_PATH], fname[MAX_PATH]; char *filter = "Bitmap (*.bmp)\0*.bmp\0\0"; GetDlgItemText(hDlg, IDC_ANALOGBMP, deffile, MAX_PATH); // select file : common/selectfile.c if(SelectMyFile(g_hInst, hDlg, filter, 0, deffile, fname)) { SetDlgItemText(hDlg, IDC_ANALOGBMP, fname); PostMessage(hDlg, WM_NEXTDLGCTL, 1, FALSE); SendPSChanged(hDlg); } }
/*------------------------------------------------ select file --------------------------------------------------*/ void OnBrowse(HWND hDlg) { char deffile[MAX_PATH], fname[MAX_PATH]; GetDlgItemText(hDlg, IDC_MOUSEOPT, deffile, MAX_PATH); // common/selectfile.c if(!SelectMyFile(g_hInst, hDlg, "All (*.*)\0*.*\0\0", 0, deffile, fname)) return; SetDlgItemText(hDlg, IDC_MOUSEOPT, fname); PostMessage(hDlg, WM_NEXTDLGCTL, 1, FALSE); SendPSChanged(hDlg); }
/*------------------------------------------------ 「...」 デスクトップカレンダーの参照 --------------------------------------------------*/ void OnSanshoDeskcal(HWND hDlg, WORD id) { char filter[] = "Deskcal.exe\0Deskcal.exe\0"; char deffile[MAX_PATH], fname[MAX_PATH]; //HFILE hf = HFILE_ERROR; GetDlgItemText(hDlg, id - 1, deffile, MAX_PATH); if(strlen(deffile) > 10 && strcmp(deffile + (strlen(deffile) - 10), " -OnlyDraw") == 0) deffile[strlen(deffile) - 10] = 0; if(!SelectMyFile(hDlg, filter, 0, deffile, fname)) // propsheet.c return; strcat(fname, " -OnlyDraw"); SetDlgItemText(hDlg, id - 1, fname); PostMessage(hDlg, WM_NEXTDLGCTL, 1, FALSE); SendPSChanged(hDlg); }