일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
- Crack(Serial Key)
- MS windows
- FTP
- program
- Backup(Restore)
- PC
- Update
- Disk Partition
- MS Windows PE
- calculator
- Linux
- portable
- Command
- game
- script
- Windows 10
- H/W
- webhard
- OS(operating system)
- 대항해시대
- web
- apm
- explorer
- javascript
- network
- Network Info(Tool)
- LiveCD(USB)
- SSH
- UNIX
- Programming
- Today
- Total
<In Story>
Visual C++ disk format 강좌 // [C,C++] [MS Windows] [MFC] [Programming] 본문
Visual C++ disk format 강좌 // [C,C++] [MS Windows] [MFC] [Programming]
<In Story, Hi story, History> 2015. 4. 4. 19:36http://veye.vitzro.com/Language/VisualC.htm
https://drive.google.com/folderview?id=0B6Wmc4bVWT_bbXVra0pOSjBOa28&usp=sharing
http://m.blog.naver.com/whiteme7/110082652816
https://msdn.microsoft.com/en-us/library/windows/desktop/aa363870(v=vs.85).aspx
http://gparted-forum.surf4.info/viewtopic.php?id=17284
http://greenfishblog.tistory.com/149
MFC강좌
http://www.oopman.com/?page=15
참고 : http://kurapa.com/content-a4546_FormatEx
< 코드 >
volatile BOOLEAN bFormatExResult;
BOOLEAN __stdcall FormatExCallback(int Command,
DWORD Modifier, PVOID Argument)
{
if( Command == FMIFS_DONE )
bFormatExResult = *(BOOLEAN *)Argument;
return TRUE;
}
typedef void (__stdcall *PFORMATEX)(PWCHAR DriveRoot, DWORD MediaFlag,
PWCHAR Format, PWCHAR Label,
BOOL QuickFormat, DWORD ClusterSize,
BOOLEAN (__stdcall *Func)(int Command, DWORD SubAction, PVOID ActionInfo) );
// format을 실행하는 멤버함수
int CCreateDrvDlg::FormatDrive()
{
// format
m_iRet = FALSE;
WCHAR wcDrive[8];
CString strDrive, str;
memset( wcDrive, 0x00, sizeof(wcDrive) );
wcscpy( wcDrive, m_wsDriveName );
wcscat( wcDrive, L"\\" );
strDrive.Format( "%s:\\", wcDrive );
str.Format( _T("Format the %ws..."), m_wsDriveName );
m_StaticMsg.SetWindowText( str );
while(1)
{
HMODULE hModule;
hModule = LoadLibrary( _T("fmifs.dll") );
if (hModule == NULL)
{
AfxMessageBox(_T("LoadLibrary(fmifs) failed"));
str = L"LoadLibrary(fmifs) failed";
break;
}
PFORMATEX FormatEx = (PFORMATEX)GetProcAddress(GetModuleHandle(_T("fmifs.dll")), "FormatEx");
if (FormatEx == NULL)
{
AfxMessageBox(_T("GetProcAddress(fmifs) failed"));
str = L"GetProcAddress(fmifs) failed";
FreeLibrary(hModule);
break;
}
FormatEx( wcDrive, FMIFM_HARDDISK, L"NTFS", L"", TRUE, 0, FormatExCallback );
FreeLibrary(hModule);
if( bFormatExResult == TRUE )
{
str.Format( _T("Complete the %ws drive format!"), m_wsDriveName );
m_iRet = TRUE;
}
else
{
str.Format( _T("Failed the %ws drive format!"), m_wsDriveName );
AfxMessageBox( str );
}
break;
}
m_StaticMsg.SetWindowText( str );
return m_iRet;
}