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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168
|
case IDB_NEXT2:
{
if(IsDlgButtonChecked(hMain, IDB_ACCEPT)==BST_UNCHECKED&&IsDlgButtonChecked(hMain, IDB_DENY)==BST_UNCHECKED)
{
WPARAM wPar=MAKEWPARAM(IDB_NEXT1, BN_CLICKED);
SendMessage(hMain, WM_COMMAND, wPar, (LPARAM)vhWin[1]);
}
else if(IsDlgButtonChecked(hMain, IDB_DENY)==BST_CHECKED)
{
SendMessage(hMain, WM_CLOSE, 0, 0);
WPARAM wPar=MAKEWPARAM(IDB_NEXT1, BN_CLICKED);
SendMessage(hMain, WM_COMMAND, wPar, (LPARAM)vhWin[1]);
}
else
{
clInit.bUserAcc=TRUE;
clInit.bProtect=FALSE;
iCount=0;
do
{
if(IsWindow(vhWin[iCount]))
{
DestroyWindow(vhWin[iCount]);
iCount++;
}
}
while(iCount<sizeof(vhWin)/sizeof(vhWin[0]));
std::string sAccount=GetAccountText();
vhWin[7]=CreateWindowEx(0, "Static", sAccount.c_str(), WS_CHILD|WS_VISIBLE|SS_BLACKFRAME|SS_LEFT, 20, 20,
760, 380, hMain, (HMENU)IDC_USE_STATIC, GetModuleHandle(NULL), NULL);
vhWin[8]=CreateWindowEx(0, "Button", "Enable User Accounts?", WS_CHILD|WS_VISIBLE|BS_AUTOCHECKBOX,
210, 400, 170, 160, hMain, (HMENU)IDB_PROTECT, GetModuleHandle(NULL), NULL);
vhWin[2]=CreateWindowEx(0, "Button", "Back", WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON, 420, 400,
170, 160, hMain, (HMENU)IDB_NEXT1, GetModuleHandle(NULL), NULL);
vhWin[9]=CreateWindowEx(0, "Button", "Next", WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON, 610, 400,
170, 160, hMain, (HMENU)IDB_NEXT3, GetModuleHandle(NULL), NULL);
}
}
break;
case IDB_NEXT3:
{
if(IsDlgButtonChecked(hMain, IDB_PROTECT)==BST_UNCHECKED)
{
clInit.bUserMem=FALSE;
clInit.bPassMem=FALSE;
WPARAM wPar=MAKEWPARAM(IDB_NEXT4, BN_CLICKED);
SendMessage(hMain, WM_COMMAND, wPar, (LPARAM)vhWin[1]);
}
else
{
clInit.bUserMem=FALSE;
clInit.bPassMem=FALSE;
iCount=0;
do
{
if(IsWindow(vhWin[iCount]))
{
DestroyWindow(vhWin[iCount]);
iCount++;
}
}
while(iCount<sizeof(vhWin)/sizeof(vhWin[0]));
std::string sMemory=GetMemoryText();
vhWin[10]=CreateWindowEx(0, "Static", sMemory.c_str(), WS_CHILD|WS_VISIBLE|SS_BLACKFRAME|SS_LEFT, 20, 20,
760, 380, hMain, (HMENU)IDC_MEM_STATIC, GetModuleHandle(NULL), NULL);
vhWin[11]=CreateWindowEx(0, "Button", "Remember Username?", WS_CHILD|WS_VISIBLE|BS_AUTOCHECKBOX, 20, 400,
170, 160, hMain, (HMENU)IDB_USER_MEM, GetModuleHandle(NULL), NULL);
vhWin[12]=CreateWindowEx(0, "Button", "Remember Password?", WS_CHILD|WS_VISIBLE|BS_AUTOCHECKBOX, 210, 400,
170, 160, hMain, (HMENU)IDB_PASS_MEM, GetModuleHandle(NULL), NULL);
vhWin[6]=CreateWindowEx(0, "Button", "Back", WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON, 420, 400,
170, 160, hMain, (HMENU)IDB_NEXT2, GetModuleHandle(NULL), NULL);
vhWin[13]=CreateWindowEx(0, "Button", "Next", WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON, 610, 400,
170, 160, hMain, (HMENU)IDB_NEXT4, GetModuleHandle(NULL), NULL);
}
}
break;
case IDB_NEXT4:
{
if(IsDlgButtonChecked(hMain, IDB_USER_MEM)==BST_CHECKED)
{
clInit.bUserMem=TRUE;
}
if(IsDlgButtonChecked(hMain, IDB_PASS_MEM)==BST_CHECKED)
{
clInit.bPassMem=TRUE;
}
iCount=0;
do
{
if(IsWindow(vhWin[iCount]))
{
DestroyWindow(vhWin[iCount]);
iCount++;
}
}
while(iCount<sizeof(vhWin)/sizeof(vhWin[0]));
std::string sOrganize=GetOrganizeText();
vhWin[14]=CreateWindowEx(0, "Static", sOrganize.c_str(), WS_CHILD|WS_VISIBLE|SS_BLACKFRAME|SS_LEFT, 20,
20, 530, 560, hMain, (HMENU)IDC_ORG_STATIC, GetModuleHandle(NULL), NULL);
vhWin[15]=CreateWindowEx(0, "Combobox", "", WS_CHILD|WS_VISIBLE|CBS_DROPDOWNLIST|CBS_HASSTRINGS,
570, 20, 210, 160, hMain, (HMENU)IDC_ORG, GetModuleHandle(NULL), NULL);
std::string sContents[5];
sContents[0]="Author";
sContents[1]="Title";
sContents[2]="Genre";
sContents[3]="Publisher";
sContents[4]="Date";
for(iCount=0; iCount<=4; iCount+=1)
{
SendMessage(vhWin[15], CB_ADDSTRING, 0, (LPARAM)sContents[iCount].c_str());
}
SendMessage(vhWin[15], CB_SETCURSEL, 0, 0);
clInit.bAuthOrg=TRUE;
clInit.bTitlOrg=FALSE;
clInit.bGenrOrg=FALSE;
clInit.bPublOrg=FALSE;
clInit.bDateOrg=FALSE;
vhWin[9]=CreateWindowEx(0, "Button", "Back", WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON, 590,
240, 170, 160, hMain, (HMENU)IDB_NEXT3, GetModuleHandle(NULL), NULL);
vhWin[16]=CreateWindowEx(0, "Button", "Finish", WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON, 590,
420, 170, 160, hMain, (HMENU)IDB_FINISH, GetModuleHandle(NULL), NULL);
}
break;
case IDB_FINISH:
{
iCount=0;
do
{
if(IsWindow(vhWin[iCount]))
{
DestroyWindow(vhWin[iCount]);
iCount++;
}
}
while(iCount<sizeof(vhWin)/sizeof(vhWin[0]));
vhWin[17]=CreateWindowEx(0, "Static", "", WS_CHILD|WS_VISIBLE|SS_BLACKFRAME|SS_CENTER, 20,
220, 760, 160, hMain, (HMENU)IDC_PRO_STATIC, GetModuleHandle(NULL), NULL);
vhWin[18]=CreateWindowEx(0, PROGRESS_CLASS, "", WS_CHILD|WS_VISIBLE, 220, 400, 360, 100,
hMain, (HMENU)IDC_BASE_PROGRESS, GetModuleHandle(NULL), NULL);
SendMessage(vhWin[18], PBM_SETRANGE, 0, MAKELPARAM(0, 11));
SendMessage(vhWin[18], PBM_SETSTEP, 1, 0);
SetWindowText(vhWin[17], "Obtaining Desktop Directory");
char pcDesk[248];
if(SHGetFolderPath(NULL, CSIDL_DESKTOPDIRECTORY, NULL, 0, pcDesk)==S_OK)
{
clPaths.sCur=pcDesk;
SendMessage(vhWin[18], PBM_STEPIT, 0, 0);
SetWindowText(vhWin[17], "Obtaining Programs Directory");
char pcProg[248];
if(SHGetFolderPath(NULL, CSIDL_PROGRAM_FILES, NULL, 0, pcProg)==S_OK)
{
clPaths.sTar=pcProg;
SendMessage(vhWin[18], PBM_STEPIT, 0, 0);
SetWindowText(vhWin[17], "Creating Current Directory");
clPaths.sApp="\\VirtLib";
clPaths.sCur=clPaths.sCur+clPaths.sApp;
SendMessage(vhWin[18], PBM_STEPIT, 0, 0);
SetWindowText(vhWin[17], "Creating Target Directory");
clPaths.sTar=clPaths.sTar+clPaths.sApp;
SendMessage(vhWin[18], PBM_STEPIT, 0, 0);
SetWindowText(vhWin[17], "Obtaining File: init.txt");
std::string sInit="\\System\\init.txt";
std::string sDir=clPaths.sCur;
sDir=sDir+sInit;
SendMessage(vhWin[18], PBM_STEPIT, 0, 0);
SetWindowText(vhWin[17], "Opening File: init.txt");
std::fstream cbOpen;
cbOpen.open(sDir.c_str(), std::ios::out);
|