亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? formatdrive.cpp

?? FormatDriveExample.zip磁盤管理
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
/*******************************************************************
 *
 *	filename	: FormatDrive.cpp
 *
 *	Title		: implementation of the CFormatDriveDialog class.
 *	Abstract	: This class can be used to format a drive
 *				: from Sourcecode. The normal Windows dialog
 *				: is used of Windows 95/98/NT4/2000/XP
 *
 *	Interface	: 2 functions are exported.The constructor
 *				: and the DoModal function. First an instance
 *				: of this class need to be created and the
 *				: DoModal function can be called with the proper
 *				: arguments. An errorcode can be returned.
 *
 *	Keywords	: Format Drive
 *
 *	Version:	: 1
 *	Created_by	: R.W.G. B鰄mer (www.bohmer.net)
 *	Date_created: 2002, June, 23
 *
 *  2002 R.W.G.B鰄mer, Grubbenvorst, The Netherlands
 *
 *******************************************************************
 *
 *  You may freely use this source code in personal, freeware, 
 *  shareware or commercial applications provided that my name is 
 *  recognized in the code. IF this code represents a 
 *  substantial portion of the application, my name must be included
 *  in the credits for the application (about box, etc)
 * 
 *  Use this code at your own risk. This code is provided AS-IS.
 *  No warranty is granted as to the correctness, usefulness or
 *  value of this code. 
 *  If you discover any bug, please solve this bug and email me the
 *  bugfix (entire source file) which I can use for future release.
 *  Please, email it to OpenSource@bohmer.net
 *
 *******************************************************************
 *
 *  TECHNICAL NOTES:
 *
 *  DO NOT USE THE NAME 'Format' anywhere in one of the parent dialog
 *  ClassNames, or dialog titles.
 *  This will cause undesired effects to the parent window components!
 *  Otherwise place the parent names in the if-statement in the method
 *  CBTProc, just like the delivered example does!
 *
 *  This code is suitable for Windows 95/98/NT4/2000/XP only.
 *  Other OS can also work properly, but this is never tested!
 *	Maybe some configuring work need to be done.
 *  
 *  This Source file does use a precompiled header.
 *  If precompiled header are not used, then add the project property
 *
 *					NOT_USE_PRECOMPILED_HEADER
 *
 *	Otherwise the normal include file 'StdAfx.h' will be used.
 *
 ******************************************************************
 * Date			: 23 june 2002
 * Version		: 1
 * Modified by	: R.W.G. B鰄mer
 * Reference	: 
 * Description	: Initial Version
 * ***************************************************************** 
*/ 
#ifndef NOT_USE_PRECOMPILED_HEADER
#	include "StdAfx.h"
#else
#	define VC_EXTRALEAN		// Exclude rarely-used stuff from Windows headers
#	include <afxwin.h>         // MFC core and standard components
#endif

#include "formatdrive.h"

#define QUICK_DETECT_TEXT_ON_FORMATDLG	"Quick"
#define FULL_DETECT_TEXT_ON_FORMATDLG	"Full"

// For the following dialognames, See the Technical Notes above
#define INCLUDE_DIALOG_TITLE1			"Format"
#define EXCLUDE_DIALOG_TITLE1			"FormatDriveSample"
#define EXCLUDE_DIALOG_TITLE2			"Howto: Format"

#define PRODUCT_TYPE_BUFSIZE			80

/*****************************************************************
The SHFormatDrive API provides access to the Shell's format
dialog box. This allows applications that want to format disks to bring
up the same dialog box that the Shell uses for disk formatting.

PARAMETERS
  hwnd    = The window handle of the window that will own the
			dialog. NOTE that hwnd == NULL does not cause this
			dialog to come up as a "top level application"
			window. This parameter should always be non-null,
			this dialog box is only designed to be the child of
			another window, not a stand-alone application.

  drive   = The 0 based (A: == 0) drive number of the drive
			to format.

  fmtID   = Currently must be set to SHFMT_ID_DEFAULT.

  options = There are currently only two option bits defined.

			   SHFMT_OPT_FULL
			   SHFMT_OPT_SYSONLY

			SHFMT_OPT_FULL specifies that the "Quick Format"
			setting should be cleared by default. If the user
			leaves the "Quick Format" setting cleared, then a
			full format will be applied (this is useful for
			users that detect "unformatted" disks and want
			to bring up the format dialog box).

			If options is set to zero (0), then the "Quick Format"
			setting is set by default. In addition, if the user leaves
			it set, a quick format is performed. Under Windows NT 4.0,
			this flag is ignored and the "Quick Format" box is always
			checked when the dialog box first appears. The user can
			still change it. This is by design.

			The SHFMT_OPT_SYSONLY initializes the dialog to
			default to just sys the disk.

			All other bits are reserved for future expansion
			and must be 0.

			Please note that this is a bit field and not a
			value, treat it accordingly.

  RETURN
	 The return is either one of the SHFMT_* values, or if
	 the returned DWORD value is not == to one of these
	 values, then the return is the physical format ID of the
	 last successful format. The LOWORD of this value can be
	 passed on subsequent calls as the fmtID parameter to
	 "format the same type you did last time".

*****************************************************************/

//
// Special value of fmtID which means "use the defaultformat"
//
#define SHFMT_ID_DEFAULT		 0xFFFF
//
// Option bits for options parameter
//
#define SHFMT_OPT_FULL			 0x0001
#define SHFMT_OPT_SYSONLY		 0x0002
//
// Special return values. PLEASE NOTE that these are DWORD values.
//
#define SHFMT_ERROR				 0xFFFFFFFFL // Error on last format,
											 // drive may be formatable
#define SHFMT_CANCEL			 0xFFFFFFFEL // Last format wascanceled
#define SHFMT_NOFORMAT			 0xFFFFFFFDL // Drive is not formatable
#define SHFMT_FMTSUCCESS		 0x00000000L // Drive is formatted
#define SHFMT_FMT_UNKNOWN_BUT_OK 0x00000006L // Unknown, but OK

typedef	DWORD WINAPI SH_FORMATDRIVE( HWND hwnd,
									 UINT drive,
									 UINT fmtID,
									 UINT options);
	

// Instance of the static Class Members
HHOOK	CFormatDriveDialog::m_hHook			= NULL;
HWND	CFormatDriveDialog::m_hFormatDialog	= NULL;
bool	CFormatDriveDialog::m_bQuick		= false;
char    CFormatDriveDialog::m_sVolumeLabel[MAX_LABEL];

// Construction/Destruction
CFormatDriveDialog::CFormatDriveDialog(void)
{
	strcpy(m_sVolumeLabel,"");
}

CFormatDriveDialog::~CFormatDriveDialog(void)
{
}

/**********************************************************************************
// FUNCTION      : CFormatDriveDialog::DoModal()
// 
// Description   : This function creates the Format disk dialog and and installs
//				   the hook and callback functions that will configure the
//				   FormatDrive dialog.	
// 
// Created       : [23-6-2002 17:20:30]
// Returns       : [int] - IDOK:	 Format has completed successfully
//                         IDCANCEL: Format has been Cancelled
//                         IDABORT:  Format has aborted due to Operating System
//									 problems
// Parameters    : [IN     : hWnd]	 Handle to the calling Window(Class) This may 
//									 not be NULL.
//                 [IN     : cDrive] Character that specifies the drive letter
//									 e.g. 'A', or 'C', ONLY UPPERCASE!!
//                 [IN     : bQuickFormat]  Default setting for Quickformat. This
//											can be overruled by the user!
//                 [IN     : sLabel] Volume name of the drive. This cannot be 
//									 altered by the user!
***********************************************************************************/
int CFormatDriveDialog::DoModal(HWND hWnd, char cDrive, bool bQuickFormat, LPCTSTR sLabel)
{
	ASSERT(hWnd);
	ASSERT((cDrive >= 'A') && (cDrive<='Z'));

	bool DisplayErrorDialog = false;
	int  RetVal				= IDABORT;
		 m_bQuick			= bQuickFormat;

	strncpy(m_sVolumeLabel, sLabel, MAX_LABEL-1);
	
	SH_FORMATDRIVE* dl_SHFormatDrive;
	HINSTANCE hShell = LoadLibrary("shell32.dll");

	if(hShell != NULL) // If the method is found in the shell32.dll library
	{
		dl_SHFormatDrive = reinterpret_cast<SH_FORMATDRIVE*>(GetProcAddress(hShell,"SHFormatDrive"));

		if (dl_SHFormatDrive != NULL)
		{
			// Set a callback function that will be called before activating, creating, destroying, 
			// minimizing, maximizing, moving, or sizing a window; before completing a system 
			// command; before removing a mouse or keyboard event from the system message queue;
			// before setting the keyboard focus; or before synchronizing with the system message queue.
			m_hHook = SetWindowsHookEx( WH_CBT,
										CBTProc,
										AfxGetApp()->m_hInstance,
										AfxGetApp()->m_nThreadID);
			
			// Call the SHFormatDrive function
			DWORD FormatResult;
			switch (GetTheSystemVersion())
			{
			case WINDOWS_95OSR1:
			case WINDOWS_95OSR2:
			case WINDOWS_98FE:
			case WINDOWS_98SE:
			case WINDOWS_NT4:
				// Notice that the Win98's SHFormatDrive function needs a different argument
				// list as the Windows 2000 based versions (Quickformat option is inverted)
				FormatResult = (*dl_SHFormatDrive)( hWnd,
								 cDrive - 'A',
								 SHFMT_ID_DEFAULT,
								 bQuickFormat?0:SHFMT_OPT_FULL);
				break;
			case WINDOWS_XP:
			case WINDOWS_2000:
				FormatResult = (*dl_SHFormatDrive)( hWnd,
								 cDrive - 'A',
								 SHFMT_ID_DEFAULT,
								 bQuickFormat?SHFMT_OPT_FULL:0);
				break;
			case UNKNOWN_OS:
			case WINDOWS_ME:
			case WINDOWS_NT35:
			default:
				DisplayErrorDialog = true;
				FormatResult = SHFMT_NOFORMAT;
				break;
			}
			if ( (SHFMT_FMTSUCCESS == FormatResult) ||
				 (SHFMT_FMT_UNKNOWN_BUT_OK == FormatResult) )
			{
				// Setting the volumelabel is not entirely reliable in the
				// SH_Format function.
				CString sDrive;
				sDrive.Format("%c:\\",cDrive);
				SetVolumeLabel( sDrive, m_sVolumeLabel );
				RetVal = IDOK;
			}
			else
			{
				RetVal = IDCANCEL;
			}
		}
		else
		{
			DisplayErrorDialog = true;
		}
		FreeLibrary(hShell);
	}
	else
	{
		DisplayErrorDialog = true;
	}

	// When there was an error accessing the Format Drive dialog an alternative
	// Window will be thrown. This dialog should make clear to the user what to do
	// now.
	if (DisplayErrorDialog)
	{
		CString csBuffer;
		CString csDefaultText("Not possible to open the Disk Format dialog\n\n" \
							  "Open 'My Computer' and Format the Floppy manually.\n\n");
		CString csLabel(m_sVolumeLabel);

		if (0 != csLabel.GetLength())
		{
			csBuffer.Format("%sSet volumelabel to: '%s'", csDefaultText, csLabel);
		}
		else
		{
			csBuffer.Format("%sLeave Volumename Empty!",csDefaultText);
		}
		MessageBox(NULL,csBuffer,"Error Accessing FormatDrive Dialog",MB_ICONEXCLAMATION);
	}
	return RetVal;
}

/**********************************************************************************
// FUNCTION      : CFormatDriveDialog::CBTProc()
// 
// Description   : This function will be called as Hook Callback procedure every-
//				   time before activating, creating, destroying, minimizing, 
//				   maximizing, moving, or sizing a window; before completing a system 
//				   command; before removing a mouse or keyboard event from the
//				   system message queue; before setting the keyboard focus; 
//				   or before synchronizing with the system message queue.
// 
// Created       : [23-6-2002 17:20:30]
// Returns       : [int] - ALWAYS FALSE!!
// Parameters    : [IN     : xxx] See MSDN (SetWindowsHookEx method)
***********************************************************************************/
LRESULT CALLBACK CFormatDriveDialog::CBTProc(int nCode,WPARAM wParam, LPARAM lParam)
{

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩精品中文字幕在线不卡尤物| 欧美午夜寂寞影院| 91在线观看高清| 精品视频在线免费看| 99久久精品国产一区| 欧日韩精品视频| 久久这里只有精品6| 亚洲精品欧美激情| 午夜精彩视频在线观看不卡| 麻豆成人久久精品二区三区红| 日本欧美一区二区| 99国产精品久久久久| 717成人午夜免费福利电影| xvideos.蜜桃一区二区| 亚洲最新在线观看| 国产激情一区二区三区桃花岛亚洲| 国产亚洲一区二区三区四区| 亚洲影视资源网| 福利一区二区在线观看| 精品国产不卡一区二区三区| 国产成人精品免费视频网站| 精品久久久久久久久久久久久久久| 亚洲综合精品自拍| 色妹子一区二区| 国产精品二三区| av激情综合网| 亚洲欧美二区三区| www.视频一区| 国产精品成人免费在线| 国产伦精品一区二区三区视频青涩| 日韩一级免费一区| 免费成人在线视频观看| 日韩三级视频在线观看| 日韩中文字幕一区二区三区| 欧美日本乱大交xxxxx| 亚洲高清视频中文字幕| 欧美在线不卡一区| 亚洲动漫第一页| 在线综合+亚洲+欧美中文字幕| 亚洲午夜私人影院| 欧美高清视频不卡网| 蜜芽一区二区三区| 精品国产一区二区国模嫣然| 国产精品中文欧美| 国产精品福利影院| 91久久一区二区| 午夜免费久久看| 日韩欧美视频一区| 国产经典欧美精品| 亚洲欧洲综合另类在线| 在线看日韩精品电影| 午夜视黄欧洲亚洲| 日韩免费看的电影| 成人午夜av电影| 亚洲国产精品久久人人爱蜜臀 | 国产日本亚洲高清| 成人av在线看| 五月综合激情婷婷六月色窝| 欧美一区二区在线免费播放| 韩国一区二区三区| 亚洲三级电影网站| 欧美二区在线观看| 成人精品视频网站| 视频一区二区三区在线| 国产亚洲精品aa午夜观看| 91在线精品一区二区| 日本在线观看不卡视频| 国产日韩成人精品| 欧美亚洲国产一区二区三区va| 另类小说欧美激情| 亚洲三级在线观看| 日韩三级精品电影久久久| 94-欧美-setu| 国产成人自拍网| 日韩专区在线视频| 亚洲精品免费一二三区| 久久网站热最新地址| 在线亚洲+欧美+日本专区| 国内精品免费**视频| 一区二区三区中文免费| 欧美精品一区二| 欧美精品成人一区二区三区四区| 粉嫩av一区二区三区在线播放| 亚洲成av人片在线观看无码| 欧美国产亚洲另类动漫| 91精品国产综合久久久久| 97久久超碰国产精品电影| 国产一区视频导航| 日韩不卡一二三区| 亚洲一区在线观看视频| 成人免费在线观看入口| 久久精品视频一区二区三区| 欧美中文字幕亚洲一区二区va在线| 免费xxxx性欧美18vr| 亚洲日本在线看| 精品少妇一区二区三区在线播放| 青椒成人免费视频| 亚洲va欧美va国产va天堂影院| 久久精品亚洲乱码伦伦中文| 欧美日韩免费一区二区三区| 国产乱子伦视频一区二区三区| 一区二区三区免费看视频| 在线播放中文一区| 91精品福利视频| 国产白丝网站精品污在线入口| 一区二区三区加勒比av| 久久久影院官网| 日韩一级片在线观看| 欧美午夜宅男影院| 欧美日韩免费在线视频| 91香蕉视频在线| 国产精品一区三区| 亚洲国产另类av| 亚洲一区在线观看免费观看电影高清 | 国产成人精品在线看| 麻豆精品视频在线观看视频| 一区二区三区在线观看视频| 国产欧美va欧美不卡在线| 精品国产一区二区三区忘忧草 | 精品一区二区免费视频| 美日韩一级片在线观看| 婷婷开心激情综合| 国产精品国产a| 中文一区在线播放| 国产区在线观看成人精品| 日韩欧美精品在线| 欧美一区二区三区免费大片| 色综合天天综合色综合av| 欧美网站大全在线观看| 99久免费精品视频在线观看| 成人黄页在线观看| 波多野结衣精品在线| 成人网男人的天堂| 国产精一品亚洲二区在线视频| 懂色av一区二区三区蜜臀| 成人国产精品视频| 成人动漫一区二区在线| 99视频在线精品| 日本精品视频一区二区三区| 欧美日韩国产小视频在线观看| 欧美日韩精品高清| 91精品国产91综合久久蜜臀| 欧美三级电影精品| 91精品国产一区二区| 日韩女优毛片在线| 亚洲色图在线播放| 亚洲在线一区二区三区| 日韩高清不卡一区二区三区| 美腿丝袜亚洲一区| 国产91精品在线观看| 91久久香蕉国产日韩欧美9色| 91久久奴性调教| 欧美一级xxx| 久久亚洲精精品中文字幕早川悠里| 26uuu亚洲综合色| 91精品国产福利| 亚洲乱码国产乱码精品精98午夜 | 欧美日韩你懂得| 日韩欧美亚洲国产精品字幕久久久| 久久久美女艺术照精彩视频福利播放| 久久精品这里都是精品| 亚洲免费观看高清| 人人精品人人爱| 成人a免费在线看| 精品99久久久久久| 亚洲精品国产视频| 久久99国产精品久久99果冻传媒| 成人av网址在线| 欧美日韩国产综合久久| 亚洲欧美综合在线精品| 麻豆91精品视频| 一道本成人在线| 国产日韩一级二级三级| 午夜精品久久久久久不卡8050| 韩国欧美国产一区| 欧美日韩精品一区二区三区 | 国产风韵犹存在线视精品| 91偷拍与自偷拍精品| 日韩一级二级三级精品视频| 亚洲视频电影在线| 国产一区二区三区四区五区美女 | 一级日本不卡的影视| 久久97超碰国产精品超碰| 在线一区二区三区做爰视频网站| 日韩免费观看高清完整版| 国产精品久久久久久亚洲毛片| 国产一区在线精品| 欧美高清精品3d| 亚洲一区二区精品视频| 国产高清成人在线| 欧美videofree性高清杂交| 亚洲成国产人片在线观看| 成人av午夜电影| 久久青草欧美一区二区三区| 午夜精品爽啪视频| 91精品国产综合久久福利| 亚洲精品国产无套在线观| 福利一区二区在线| 久久丝袜美腿综合| 国产原创一区二区|