2006-03-30 00:09:09 +00:00
|
|
|
/*****************************************************************************
|
|
|
|
|
|
|
|
Fraginator
|
|
|
|
|
|
|
|
*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
#include "Fraginator.h"
|
|
|
|
#include "Mutex.h"
|
|
|
|
#include "DriveVolume.h"
|
|
|
|
#include "Defragment.h"
|
|
|
|
#include "MainDialog.h"
|
|
|
|
#include "resource.h"
|
|
|
|
#include <crtdbg.h>
|
|
|
|
|
|
|
|
|
|
|
|
HINSTANCE GlobalHInstance = NULL;
|
|
|
|
Defragment *Defrag = NULL;
|
|
|
|
|
|
|
|
|
|
|
|
int WINAPI WinMain (HINSTANCE HInstance, HINSTANCE HPrevInstance, LPSTR CmdLine, int ShowCmd)
|
|
|
|
{
|
|
|
|
INITCOMMONCONTROLSEX InitControls;
|
|
|
|
|
|
|
|
// debugging crap
|
|
|
|
#ifndef NDEBUG
|
|
|
|
_CrtSetDbgFlag (_CRTDBG_LEAK_CHECK_DF | _CrtSetDbgFlag (_CRTDBG_REPORT_FLAG));
|
|
|
|
_CrtSetReportMode (_CRT_WARN, _CRTDBG_MODE_FILE);
|
|
|
|
_CrtSetReportFile (_CRT_WARN, _CRTDBG_FILE_STDOUT);
|
|
|
|
_CrtSetReportMode (_CRT_ERROR, _CRTDBG_MODE_FILE);
|
|
|
|
_CrtSetReportFile (_CRT_ERROR, _CRTDBG_FILE_STDOUT);
|
|
|
|
_CrtSetReportMode (_CRT_ASSERT, _CRTDBG_MODE_FILE);
|
|
|
|
_CrtSetReportFile (_CRT_ASSERT, _CRTDBG_FILE_STDOUT);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
GlobalHInstance = HInstance;
|
|
|
|
|
|
|
|
// We want our progress bar! NOW!
|
|
|
|
InitControls.dwSize = sizeof (InitControls);
|
|
|
|
InitControls.dwICC = ICC_WIN95_CLASSES;
|
|
|
|
InitCommonControlsEx (&InitControls);
|
|
|
|
|
|
|
|
if (!CheckWinVer())
|
|
|
|
{
|
2006-04-01 15:02:38 +00:00
|
|
|
MessageBox (GetDesktopWindow(), L"Sorry, this program requires Windows 2000.", L"Error", MB_OK);
|
2006-03-30 00:09:09 +00:00
|
|
|
return (0);
|
|
|
|
}
|
|
|
|
|
|
|
|
DialogBox (HInstance, MAKEINTRESOURCE (IDD_MAIN), GetDesktopWindow(), MainDialogProc);
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
AllocConsole ();
|
|
|
|
if (_CrtDumpMemoryLeaks ())
|
2006-04-01 15:02:38 +00:00
|
|
|
MessageBox (NULL, L"Click OK to quit", L"Leaks", MB_OK);
|
2006-03-30 00:09:09 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
return (0);
|
|
|
|
}
|