⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 miniguidlg.cpp

📁 内含纯DOS,WIN32控制台和WIN32 GUI三个版本.它们生成的备份文件可以在任何版本中使用. WIN32 GUI版本暂使用备份功能(其他模块也都已全部写好,全是完整的,现在仅开启备份功能),如
💻 CPP
📖 第 1 页 / 共 2 页
字号:


			if((argu.target==DBR || argu.target==FAT) && argu.mainArg->argMode!=ARGUMENT_PARTITION  && argu.mainArg->argMode!=ARGUMENT_DOSLETTER)
			{
				
			

				printf("n:n/?: required\n");
				return -1;
			}

			

			}
				

else
{
	
	
	if(argu.mainArg)
			
				{
				
				printf("n/n:n/?: unsupported, they're saved in file\n");
				return -1;
			}
if(argu.target!=INVALID_TARGET)
				{
					printf("/MBR/BOOT/FAT UNexpected\n");
					return -1;
				}


else mainArgCopy=NULL;

}		

			
		/*	doDPTDBRFAT(argu.partitionTable,mainArgCopy,argu.mode,argu.target,argu.fileStr,0,1,0,argu.yesTRUE);
		*/		AfxBeginThread(doDPTDBRFAT,this);
			
						
		}
		
		
		
			
	}
	

	else if(argu.turnTRUE)
	{
char str[8];
memset(str,0,8);
		if(!argu.mainArg || argu.mainArg->argMode!=ARGUMENT_PARTITION  && argu.mainArg->argMode!=ARGUMENT_DOSLETTER)
			{
				printf("n:n/?: required\n");
				return -1;
			}
if(argu.mainArg->argMode==ARGUMENT_PARTITION)
		sprintf(str,"%d:%d",argu.mainArg->drive,argu.mainArg->number);
else sprintf(str,"%c:",(argu.winTRUE ? argu.partitionTable[argu.mainArg->index]->WINletter : argu.mainArg->letter));
if(DOSletterPartitionConverter(argu.driveTable,argu.partitionTable,str,argu.winTRUE)==-1) return 2;
return 1;
																																																																																														  
	}
	



	
/*	
}*/





/*
MessageBox("完成");*/

	
/*
	CDialog::OnOK();*/

/*
CMiniGUIDlg dlg;
	m_pMainWnd = &dlg;
	int nResponse = dlg.DoModal();
	if (nResponse == IDOK)
	{
		// TODO: Place code here to handle when the dialog is
		//  dismissed with OK
	}
	else if (nResponse == IDCANCEL)
	{
		// TODO: Place code here to handle when the dialog is
		//  dismissed with Cancel
	}

	// Since the dialog has been closed, return FALSE so that we exit the
	//  application, rather than start the application's message pump.
	return FALSE;
*/
/*	AfxGetApp()->InitInstance();*/
	

}

void CMiniGUIDlg::OnCheck1() 
{
	// TODO: Add your control notification handler code here
	/*if()*/
	int check=((CButton *)GetDlgItem(IDC_CHECK1))->GetCheck();	

	if(check) /*GetDlgItem(IDC_COMBO2)->EnableWindow(TRUE);*/
	 {
		
GetDlgItem(IDC_COMBO2)->EnableWindow(TRUE);
GetDlgItem(IDC_COMBO3)->EnableWindow(TRUE);
((CButton *)GetDlgItem(IDC_CHECK3))->SetCheck(0);

GetDlgItem(IDC_COMBO1)->EnableWindow(FALSE);




GetDlgItem(IDC_RADIO8)->EnableWindow(TRUE);
GetDlgItem(IDC_RADIO9)->EnableWindow(TRUE);
GetDlgItem(IDC_RADIO10)->EnableWindow(TRUE);

	 }
	 else if(!((CButton *)GetDlgItem(IDC_CHECK2))->GetCheck())
	 {
		 
		 GetDlgItem(IDC_COMBO1)->EnableWindow(TRUE);
	 }
	 

		
}

void CMiniGUIDlg::OnCheck2() 
{
	// TODO: Add your control notification handler code here
	int check=((CButton *)GetDlgItem(IDC_CHECK2))->GetCheck();	
	 if(check) /*GetDlgItem(IDC_COMBO3)->EnableWindow(TRUE);*/
	 {
		 GetDlgItem(IDC_COMBO2)->EnableWindow(TRUE);
GetDlgItem(IDC_COMBO3)->EnableWindow(TRUE);
((CButton *)GetDlgItem(IDC_CHECK3))->SetCheck(0);

GetDlgItem(IDC_COMBO1)->EnableWindow(FALSE);

((CButton *)GetDlgItem(IDC_CHECK4))->SetCheck(0);


GetDlgItem(IDC_RADIO8)->EnableWindow(TRUE);
GetDlgItem(IDC_RADIO9)->EnableWindow(TRUE);
GetDlgItem(IDC_RADIO10)->EnableWindow(TRUE);

	 }
	 else if(!((CButton *)GetDlgItem(IDC_CHECK1))->GetCheck())
	 {
		 GetDlgItem(IDC_COMBO1)->EnableWindow(TRUE);
}
}

void CMiniGUIDlg::OnCheck3() 
{
	int check=((CButton *)GetDlgItem(IDC_CHECK3))->GetCheck();	
	 if(check) /*GetDlgItem(IDC_COMBO1)->EnableWindow(TRUE);*/
	{
		GetDlgItem(IDC_COMBO1)->EnableWindow(TRUE);
((CButton *)GetDlgItem(IDC_CHECK1))->SetCheck(0);
((CButton *)GetDlgItem(IDC_CHECK2))->SetCheck(0);


GetDlgItem(IDC_COMBO2)->EnableWindow(FALSE);

GetDlgItem(IDC_COMBO3)->EnableWindow(FALSE);

((CButton *)GetDlgItem(IDC_CHECK4))->SetCheck(0);

GetDlgItem(IDC_RADIO8)->EnableWindow(TRUE);
GetDlgItem(IDC_RADIO9)->EnableWindow(TRUE);
GetDlgItem(IDC_RADIO10)->EnableWindow(TRUE);



	 }
	 else 
	 {

GetDlgItem(IDC_COMBO2)->EnableWindow(TRUE);
GetDlgItem(IDC_COMBO3)->EnableWindow(TRUE);

	 }

}

void CMiniGUIDlg::OnRadio8() 
{
	// TODO: Add your control notification handler code here
	int check=((CButton *)GetDlgItem(IDC_RADIO8))->GetCheck();	
	 if(check) 
	 {
	((CButton *)GetDlgItem(IDC_CHECK4))->SetCheck(0);
	 }
}

void CMiniGUIDlg::OnRadio9() 
{
		int check=((CButton *)GetDlgItem(IDC_RADIO9))->GetCheck();	
	 if(check) 
	 {
	((CButton *)GetDlgItem(IDC_CHECK4))->SetCheck(0);
	 }
}

void CMiniGUIDlg::OnCheck4() 
{
	// TODO: Add your control notification handler code here
int check=((CButton *)GetDlgItem(IDC_CHECK4))->GetCheck();
if(check)
{	
GetDlgItem(IDC_RADIO8)->EnableWindow(FALSE);
GetDlgItem(IDC_RADIO9)->EnableWindow(FALSE);
GetDlgItem(IDC_RADIO10)->EnableWindow(FALSE);

GetDlgItem(IDC_COMBO3)->EnableWindow(FALSE);
GetDlgItem(IDC_COMBO1)->EnableWindow(FALSE);
GetDlgItem(IDC_COMBO2)->EnableWindow(TRUE);



}
else
{
GetDlgItem(IDC_RADIO8)->EnableWindow(TRUE);
GetDlgItem(IDC_RADIO9)->EnableWindow(TRUE);
GetDlgItem(IDC_RADIO10)->EnableWindow(TRUE);

GetDlgItem(IDC_COMBO3)->EnableWindow(TRUE);
GetDlgItem(IDC_COMBO1)->EnableWindow(TRUE);


	
}
}

void CMiniGUIDlg::OnRadio10() 
{
	// TODO: Add your control notification handler code here
	int check=((CButton *)GetDlgItem(IDC_RADIO10))->GetCheck();	
	 if(check) 
	 {
	((CButton *)GetDlgItem(IDC_CHECK4))->SetCheck(0);
	 }
	 
}



void CMiniGUIDlg::OnOK() 
{
	CDialog::OnOK();
}




void CMiniGUIDlg::OnButton2() 
{
	// TODO: Add your control notification handler code here
	if(pause==true) pause=false;
	else pause=true;
		
}

void CMiniGUIDlg::OnButton3() 
{
	// TODO: Add your control notification handler code here
	
stop=true;
start=false;
((CProgressCtrl *)GetDlgItem(IDC_PROGRESS1))->SetPos(0);		
}

/*
void CMiniGUIDlg::OnChangeCOMBO2() 
{
	// TODO: If this is a RICHEDIT control, the control will not
	// send this notification unless you override the CDialog::OnInitDialog()
	// function and call CRichEditCtrl().SetEventMask()
	// with the ENM_CHANGE flag ORed into the mask.
	
	// TODO: Add your control notification handler code here



	

}*/
/*
void CMiniGUIDlg::OnChangeCOMBO3() 
{
	// TODO: If this is a RICHEDIT control, the control will not
	// send this notification unless you override the CDialog::OnInitDialog()
	// function and call CRichEditCtrl().SetEventMask()
	// with the ENM_CHANGE flag ORed into the mask.
	
	// TODO: Add your control notification handler code here
	
}*/
/*
void CMiniGUIDlg::OnChangeEdit3() 
{
	// TODO: If this is a RICHEDIT control, the control will not
	// send this notification unless you override the CDialog::OnInitDialog()
	// function and call CRichEditCtrl().SetEventMask()
	// with the ENM_CHANGE flag ORed into the mask.
	
	// TODO: Add your control notification handler code here
	

}*/

void CMiniGUIDlg::OnButton4() 
{
	// TODO: Add your control notification handler code here
	CFileDialog f(true);
	//f.m_ofn.Flags |=512; //NULL;//OFN_ALLOWMULTISELECT;新式风格,目录列表方式
	//f.m_ofn.Flags|=OFN_ALLOWMULTISELECT; //|OFN_CREATEPROMPT;新式风格
	
	//f.m_ofn.Flags=OFN_ALLOWMULTISELECT; //老式风格
	
	f.m_ofn.Flags=OFN_EXPLORER;
	f.m_ofn.lpstrFilter="所有媒体类型\0*.*\0\0";

   	if(f.DoModal()!=IDOK)
		return;//用户单击了“取消”
CString str;
str=f.GetPathName();
if(str.IsEmpty()) return ;
SetDlgItemText(IDC_EDIT5,str);


}

void CMiniGUIDlg::OnLButtonDown(UINT nFlags, CPoint point) 
{
	// TODO: Add your message handler code here and/or call default
	
	

	CDialog::OnLButtonDown(nFlags, point);
}

void CMiniGUIDlg::OnSetfocusCombo1() 
{
	// TODO: Add your control notification handler code here
	int i,item=0;
	/*switch(m_letterMode)
	{
	case 0 : argu.winTRUE=1; break;
	case 1 : argu.winTRUE=0; break;
	}*/
/*	UpdateData();*/


((CButton *)GetDlgItem(IDC_CHECK1))->SetCheck(0);
((CButton *)GetDlgItem(IDC_CHECK2))->SetCheck(0);

GetDlgItem(IDC_COMBO2)->EnableWindow(FALSE);
GetDlgItem(IDC_COMBO3)->EnableWindow(FALSE);


GetDlgItem(IDC_RADIO8)->EnableWindow(TRUE);
GetDlgItem(IDC_RADIO9)->EnableWindow(TRUE);
GetDlgItem(IDC_RADIO10)->EnableWindow(TRUE);



	for(i=0;argu.partitionTable[i];i++)
	{
		if(!(argu.winTRUE ? argu.partitionTable[i]->WINletter : argu.partitionTable[i]->letter))
continue;
		
		item++;
	}
	if(item) 
	{
		m_combo.ResetContent();
		m_combo.InitStorage(item+1,3);
		m_combo.AddString("");
	}
	else return;
	

for(i=0;argu.partitionTable[i];i++)
	{
	char letter=(argu.winTRUE ? argu.partitionTable[i]->WINletter : argu.partitionTable[i]->letter);

		if(!letter) continue;
	m_combo.AddString(CString(letter)+":");
	}
	
}

void CMiniGUIDlg::OnRadio6() 
{
	// TODO: Add your control notification handler code here
	argu.winTRUE=1;
}

void CMiniGUIDlg::OnRadio7() 
{
	// TODO: Add your control notification handler code here
	argu.winTRUE=0;
}

void CMiniGUIDlg::OnSetfocusCombo2() 
{
	// TODO: Add your control notification handler code here
	int i,item=0;
	CString drive;
	
/*	UpdateData(TRUE);*/



((CButton *)GetDlgItem(IDC_CHECK3))->SetCheck(0);

GetDlgItem(IDC_COMBO1)->EnableWindow(FALSE);


GetDlgItem(IDC_RADIO8)->EnableWindow(TRUE);
GetDlgItem(IDC_RADIO9)->EnableWindow(TRUE);
GetDlgItem(IDC_RADIO10)->EnableWindow(TRUE);






	for(i=0;argu.driveTable[i] && argu.driveTable[i]->number>0;i++)		
		item++;
	if(item) 
	{
		m_combo2.ResetContent();
		m_combo2.InitStorage(item+1,3);
		m_combo2.AddString("");
	}
	else return;
for(i=0;i<item;i++)		
{
	drive.Format("%d",argu.driveTable[i]->number);
	m_combo2.AddString(drive);
}
}

void CMiniGUIDlg::OnSetfocusCombo3() 
{
	// TODO: Add your control notification handler code here
	short i,index=INVALID_INDEX;
	CString driveStr;
	short drive=0;
	CString part;
	/*switch(m_letterMode)
	{
	case 0 : argu.winTRUE=1; break;
	case 1 : argu.winTRUE=0; break;
	}*/
/*	UpdateData();*/
	


((CButton *)GetDlgItem(IDC_CHECK3))->SetCheck(0);

GetDlgItem(IDC_COMBO1)->EnableWindow(FALSE);


GetDlgItem(IDC_RADIO8)->EnableWindow(TRUE);
GetDlgItem(IDC_RADIO9)->EnableWindow(TRUE);
GetDlgItem(IDC_RADIO10)->EnableWindow(TRUE);




	GetDlgItemText(IDC_COMBO2,driveStr);
if(driveStr.IsEmpty()) return;
drive=atoi((char *)(LPCSTR)driveStr);
getDriveItem(drive,argu.driveTable,&index);	

	if(index!=INVALID_INDEX && argu.driveTable[index] && argu.driveTable[index]->part) 
	{
		m_combo3.ResetContent();
		m_combo3.InitStorage(argu.driveTable[index]->part+1,3);
		m_combo3.AddString("");
	}
	else return;
for(i=1;i<=argu.driveTable[index]->part;i++)		
{
	part.Format("%d",i);
	m_combo3.AddString(part);
}


}

void CMiniGUIDlg::OnRadio2() 
{
	// TODO: Add your control notification handler code here
	GetDlgItem(IDC_RADIO8)->EnableWindow(FALSE);
GetDlgItem(IDC_RADIO9)->EnableWindow(FALSE);
GetDlgItem(IDC_RADIO10)->EnableWindow(FALSE);
/*
GetDlgItem(IDC_COMBO2)->EnableWindow(FALSE);*/
GetDlgItem(IDC_COMBO3)->EnableWindow(FALSE);
GetDlgItem(IDC_COMBO1)->EnableWindow(FALSE);

GetDlgItem(IDC_EDIT5)->EnableWindow(TRUE);
GetDlgItem(IDC_CHECK4)->EnableWindow(TRUE);

}

void CMiniGUIDlg::OnRadio1() 
{
	// TODO: Add your control notification handler code here
	GetDlgItem(IDC_RADIO8)->EnableWindow(TRUE);
GetDlgItem(IDC_RADIO9)->EnableWindow(TRUE);
GetDlgItem(IDC_RADIO10)->EnableWindow(TRUE);

GetDlgItem(IDC_COMBO2)->EnableWindow(TRUE);
GetDlgItem(IDC_COMBO3)->EnableWindow(TRUE);
GetDlgItem(IDC_COMBO1)->EnableWindow(TRUE);

GetDlgItem(IDC_EDIT5)->EnableWindow(TRUE);
GetDlgItem(IDC_CHECK4)->EnableWindow(TRUE);


}

void CMiniGUIDlg::OnRadio3() 
{
	// TODO: Add your control notification handler code here
	
	((CButton *)GetDlgItem(IDC_RADIO8))->SetCheck(0);
((CButton *)GetDlgItem(IDC_CHECK4))->SetCheck(0);
	GetDlgItem(IDC_RADIO8)->EnableWindow(FALSE);
GetDlgItem(IDC_EDIT5)->EnableWindow(FALSE);
GetDlgItem(IDC_CHECK4)->EnableWindow(FALSE);


}

void CMiniGUIDlg::OnButton5() 
{
	// TODO: Add your control notification handler code here
	int i;
((CButton *)GetDlgItem(IDC_RADIO1))->SetCheck(0);
((CButton *)GetDlgItem(IDC_RADIO2))->SetCheck(0);
((CButton *)GetDlgItem(IDC_RADIO3))->SetCheck(0);
((CButton *)GetDlgItem(IDC_RADIO4))->SetCheck(0);
((CButton *)GetDlgItem(IDC_RADIO5))->SetCheck(0);

argu.printPartTRUE=false;
	argu.printDriveTRUE=true;
m_print.ResetContent();
/*
	m_print.Clear();*/

	for(i=0;argu.driveTable[i];i++);	
	
	
	m_print.InitStorage(i,256);

OnButton1();
argu.printDriveTRUE=false;
argu.printPartTRUE=false;


}

void CMiniGUIDlg::OnButton6() 
{
	// TODO: Add your control notification handler code here
	int i;
	((CButton *)GetDlgItem(IDC_RADIO1))->SetCheck(0);
	((CButton *)GetDlgItem(IDC_RADIO2))->SetCheck(0);
	((CButton *)GetDlgItem(IDC_RADIO3))->SetCheck(0);
	((CButton *)GetDlgItem(IDC_RADIO4))->SetCheck(0);
	((CButton *)GetDlgItem(IDC_RADIO5))->SetCheck(0);
	argu.printDriveTRUE=false;
	argu.printPartTRUE=true;
m_print.ResetContent();

/*	for(i=0;i<26;i++);
	m_print.DeleteString(i);
	m_print.UpdateData(FALSE);
/*	m_print.InitStorage(i,256);*/

	for(i=0;argu.partitionTable[i];i++);
	m_print.InitStorage(i,256);
OnButton1();
argu.printDriveTRUE=false;
argu.printPartTRUE=false;

}

void CMiniGUIDlg::OnSetfocusCombo4() 
{
	// TODO: Add your control notification handler code here
	
}

void CMiniGUIDlg::OnButton7() 
{
	// TODO: Add your control notification handler code here
	int i;	



	for(i=0;argu.driveTable[i];i++)
	{
		free(argu.driveTable[i]);
		argu.driveTable[i]=NULL;
	}
	
	for(i=0;argu.partitionTable[i];i++)
	{
		free(argu.partitionTable[i]);
		argu.partitionTable[i]=NULL;
	}
	
	for(i=0;i<MAX_TASK_NUM;i++)
		argu.srcStr[i]=NULL;
	
	for(i=0;i<MAX_TASK_NUM;i++)
		argu.dstStr[i]=NULL;
	
	for(i=0;i<MAX_TASK_NUM;i++)
		argu.src[i]=NULL;
	
	for(i=0;i<MAX_TASK_NUM;i++)
		argu.dst[i]=NULL;
		
	





getDriveTable(argu.driveTable,argu.useFloppyTRUE,argu.ignoreHDDparameterTRUE);


	getPartitionTable(argu.driveTable,argu.partitionTable);

putInDrivePartNum(argu.driveTable,argu.partitionTable);
	
	putInDOSletter(argu.partitionTable);
	
	/*if(ntfsproTRUE || ifsTRUE)
		putInExtraLetter(partitionTable,(ntfsproTRUE ? NTFSPRO : IFS));
	*/
	
putInWINletterVol(argu.partitionTable);

	WINputInDiskFreeSpace(argu.partitionTable);

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -