void CSettingDlg::OnBnClickedButtonBack() { // TODO: 在此添加控件通知处理程序代码 if(changed) MessageBox(_T("若您修改了图片库路径,则将在下一次启动时生效")); CString name, dict; GetDlgItemText(IDC_EDIT_NAME, name); GetDlgItemText(IDC_EDIT_DICT, dict); setting.libname = CStringA(name); setting.libpath = CStringA(dict); //TODO: 按钮处理 setting.browse = GetCheckedRadioButton(IDC_RADIO1, IDC_RADIO2) - IDC_RADIO1; setting.ssearch = (BST_CHECKED == IsDlgButtonChecked(IDC_CHECK1)); creatfile(); OnOK(); }
void forkfiles(char ficheros[][128],int txtfiles,int bytes){ int i; int pid; struct stat fichero; for(i=0;i<txtfiles;i++){ pid = fork(); switch(pid){ case -1: err(1,"Error: fork \n"); break; case 0: stat(ficheros[i],&fichero); if ((fichero.st_size)<bytes) bytes = fichero.st_size; creatfile(ficheros[i],bytes); exit(EXIT_SUCCESS); break; } } waitchild(txtfiles); }