Changeset 918 for trunk/dll/notebook.c
- Timestamp:
- Jan 12, 2008, 9:16:37 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/notebook.c
r917 r918 193 193 PrfWriteProfileString(fmprof, appname, "DefArc", szDefArc); 194 194 { 195 CHAR szBuf[CCHMAXPATH], *psz; 196 197 WinQueryDlgItemText(hwnd, CFGA_VIRUS, CCHMAXPATH, szBuf); 198 szBuf[CCHMAXPATH - 1] = 0; 199 if (strcmp(szBuf, virus)) { 200 psz = CheckApp_QuoteAddExe(szBuf); 201 memcpy(virus, psz, strlen(psz) + 1); 202 if (!strchr(virus, '%') && strlen(virus) > 3) 203 strcat(virus, " %p"); 195 CHAR szCLBuf[MAXCOMLINESTRG], szPathBuf[CCHMAXPATH]; 196 PSZ psz; 197 198 psz = xmalloc(MAXCOMLINESTRG, pszSrcFile, __LINE__); 199 WinQueryDlgItemText(hwnd, CFGA_VIRUS, MAXCOMLINESTRG, szCLBuf); 200 szCLBuf[MAXCOMLINESTRG - 1] = 0; 201 if (strcmp(szCLBuf, virus)){ 202 CheckApp_QuoteAddExe(psz, szCLBuf); 203 memcpy(virus, psz, strlen(psz) + 1); 204 if (!strchr(virus, '%') && strlen(virus) > 3) 205 strcat(virus, " %p"); 204 206 } 205 207 if (!*virus) 206 208 strcpy(virus, "OS2SCAN.EXE %p /SUB /A"); 207 WinQueryDlgItemText(hwnd, CFGA_EXTRACTPATH, CCHMAXPATH, szBuf); 208 szBuf[CCHMAXPATH - 1] = 0; 209 bstrip(szBuf); 210 211 if (strcmp(extractpath, szBuf)) { 212 memcpy(extractpath, szBuf, strlen(szBuf) + 1); 213 if (*extractpath) { 214 MakeFullName(extractpath); 215 if (IsFile(extractpath)) { 216 ulResult = saymsg(MB_YESNOCANCEL | MB_ICONQUESTION | MB_DEFBUTTON1, HWND_DESKTOP, 217 GetPString(IDS_WARNINGTEXT), 218 GetPString(IDS_EXTPATHNOTVALIDTEXT), 219 extractpath); 220 if (ulResult == MBID_YES) 221 *extractpath = 0; 222 if (ulResult == MBID_CANCEL) { 223 WinDlgBox(HWND_DESKTOP, 209 WinQueryDlgItemText(hwnd, CFGA_EXTRACTPATH, CCHMAXPATH, szPathBuf); 210 szPathBuf[CCHMAXPATH - 1] = 0; 211 bstrip(szPathBuf); 212 if (strcmp(extractpath, szPathBuf)) { 213 memcpy(extractpath, szPathBuf, strlen(szPathBuf) + 1); 214 if (*extractpath){ 215 MakeFullName(extractpath); 216 if (IsFile(extractpath)) { 217 ulResult = saymsg(MB_YESNOCANCEL | MB_ICONQUESTION | MB_DEFBUTTON1, HWND_DESKTOP, 218 GetPString(IDS_WARNINGTEXT), 219 GetPString(IDS_EXTPATHNOTVALIDTEXT), 220 extractpath); 221 if (ulResult == MBID_YES) 222 *extractpath = 0; 223 if (ulResult == MBID_CANCEL){ 224 WinDlgBox(HWND_DESKTOP, 224 225 hwnd, 225 226 CfgDlgProc, … … 227 228 CFG_FRAME, 228 229 MPFROMLONG(IDM_ARCHIVERSETTINGS)); 229 230 231 232 230 break; 231 } 232 } 233 } 233 234 } 234 235 } … … 364 365 case WM_INITDLG: 365 366 WinSendDlgItemMsg(hwnd, CFGV_VIEWER, EM_SETTEXTLIMIT, 366 MPFROM2SHORT( CCHMAXPATH, 0), MPVOID);367 MPFROM2SHORT(MAXCOMLINESTRG, 0), MPVOID); 367 368 WinSendDlgItemMsg(hwnd, CFGV_EDITOR, EM_SETTEXTLIMIT, 368 MPFROM2SHORT( CCHMAXPATH, 0), MPVOID);369 MPFROM2SHORT(MAXCOMLINESTRG, 0), MPVOID); 369 370 WinSendDlgItemMsg(hwnd, CFGV_BINVIEW, EM_SETTEXTLIMIT, 370 MPFROM2SHORT( CCHMAXPATH, 0), MPVOID);371 MPFROM2SHORT(MAXCOMLINESTRG, 0), MPVOID); 371 372 WinSendDlgItemMsg(hwnd, CFGV_BINED, EM_SETTEXTLIMIT, 372 MPFROM2SHORT( CCHMAXPATH, 0), MPVOID);373 MPFROM2SHORT(MAXCOMLINESTRG, 0), MPVOID); 373 374 WinEnableWindow(WinWindowFromID(hwnd, CFGV_FIND), FALSE); 374 375 PostMsg(hwnd, UM_UNDO, MPVOID, MPVOID); … … 456 457 case WM_CLOSE: 457 458 { 458 CHAR szBuf[CCHMAXPATH], *psz; 459 460 WinQueryDlgItemText(hwnd, CFGV_VIEWER, CCHMAXPATH, szBuf); 461 szBuf[CCHMAXPATH - 1] = 0; 462 if (strcmp(szBuf, viewer)) { 463 psz = CheckApp_QuoteAddExe(szBuf); 464 memcpy(viewer, psz, strlen(psz) + 1); 465 if (!strchr(viewer, '%') && strlen(viewer) > 3) 466 strcat(viewer, " %a"); 467 } 468 WinQueryDlgItemText(hwnd, CFGV_EDITOR, CCHMAXPATH, szBuf); 469 szBuf[CCHMAXPATH - 1] = 0; 470 if (strcmp(szBuf, editor)) { 471 psz = CheckApp_QuoteAddExe(szBuf); 472 memcpy(editor, psz, strlen(psz) + 1); 473 if (!strchr(editor, '%') && strlen(editor) > 3) 474 strcat(editor, " %a"); 475 } 476 WinQueryDlgItemText(hwnd, CFGV_BINVIEW, CCHMAXPATH, szBuf); 477 szBuf[CCHMAXPATH - 1] = 0; 478 if (strcmp(szBuf, binview)) { 479 psz = CheckApp_QuoteAddExe(szBuf); 480 memcpy(binview, psz, strlen(psz) + 1); 481 if (!strchr(binview, '%') && strlen(binview) > 3) 482 strcat(binview, " %a"); 483 } 484 WinQueryDlgItemText(hwnd, CFGV_BINED, CCHMAXPATH, szBuf); 485 szBuf[CCHMAXPATH - 1] = 0; 486 if (strcmp(szBuf, bined)) { 487 psz = CheckApp_QuoteAddExe(szBuf); 488 memcpy(bined, psz, strlen(psz) + 1); 489 if (!strchr(bined, '%') && strlen(bined) > 3) 490 strcat(bined, " %a"); 459 CHAR szCLBuf[MAXCOMLINESTRG]; 460 PSZ psz; 461 462 psz = xmalloc(MAXCOMLINESTRG, pszSrcFile, __LINE__); 463 WinQueryDlgItemText(hwnd, CFGV_VIEWER, MAXCOMLINESTRG, szCLBuf); 464 szCLBuf[MAXCOMLINESTRG - 1] = 0; 465 if (strcmp(szCLBuf, viewer)){ 466 CheckApp_QuoteAddExe(psz, szCLBuf); 467 memcpy(viewer, psz, strlen(psz) + 1); 468 if (!strchr(viewer, '%') && strlen(viewer) > 3) 469 strcat(viewer, " %a"); 470 } 471 WinQueryDlgItemText(hwnd, CFGV_EDITOR, MAXCOMLINESTRG, szCLBuf); 472 szCLBuf[MAXCOMLINESTRG - 1] = 0; 473 if (strcmp(szCLBuf, editor)){ 474 CheckApp_QuoteAddExe(psz, szCLBuf); 475 memcpy(editor, psz, strlen(psz) + 1); 476 if (!strchr(editor, '%') && strlen(editor) > 3) 477 strcat(editor, " %a"); 478 } 479 WinQueryDlgItemText(hwnd, CFGV_BINVIEW, MAXCOMLINESTRG, szCLBuf); 480 szCLBuf[MAXCOMLINESTRG - 1] = 0; 481 if (strcmp(szCLBuf, binview)){ 482 CheckApp_QuoteAddExe(psz, szCLBuf); 483 memcpy(binview, psz, strlen(psz) + 1); 484 if (!strchr(binview, '%') && strlen(binview) > 3) 485 strcat(binview, " %a"); 486 } 487 WinQueryDlgItemText(hwnd, CFGV_BINED, MAXCOMLINESTRG, szCLBuf); 488 szCLBuf[MAXCOMLINESTRG - 1] = 0; 489 if (strcmp(szCLBuf, bined)){ 490 CheckApp_QuoteAddExe(psz, szCLBuf); 491 memcpy(bined, psz, strlen(psz) + 1); 492 if (!strchr(bined, '%') && strlen(bined) > 3) 493 strcat(bined, " %a"); 491 494 } 492 495 PrfWriteProfileString(fmprof, appname, "Viewer", viewer); … … 530 533 MPFROM2SHORT(CCHMAXPATH, 0), MPVOID); 531 534 WinSendDlgItemMsg(hwnd, CFGH_FTPRUN, EM_SETTEXTLIMIT, 532 MPFROM2SHORT( CCHMAXPATH, 0), MPVOID);535 MPFROM2SHORT(MAXCOMLINESTRG, 0), MPVOID); 533 536 WinSendDlgItemMsg(hwnd, CFGH_HTTPRUN, EM_SETTEXTLIMIT, 534 MPFROM2SHORT(CCHMAXPATH, 0), MPVOID);537 MPFROM2SHORT(MAXCOMLINESTRG, 0), MPVOID); 535 538 WinSendDlgItemMsg(hwnd, CFGH_MAILRUN, EM_SETTEXTLIMIT, 536 MPFROM2SHORT(CCHMAXPATH, 0), MPVOID);539 MPFROM2SHORT(MAXCOMLINESTRG, 0), MPVOID); 537 540 WinSendDlgItemMsg(hwnd, CFGH_RUNMAILWORKDIR, EM_SETTEXTLIMIT, 538 541 MPFROM2SHORT(CCHMAXPATH, 0), MPVOID); … … 648 651 { // fixme these strings can be longer than CCHMAXPATH since 649 652 // they contain args. 650 CHAR szBuf[CCHMAXPATH], *psz; 651 652 WinQueryDlgItemText(hwnd, CFGH_RUNHTTPWORKDIR, CCHMAXPATH, szBuf); 653 szBuf[CCHMAXPATH - 1] = 0; 654 bstrip(szBuf); 655 memcpy(httprundir, szBuf, strlen(szBuf) + 1); 656 WinQueryDlgItemText(hwnd, CFGH_RUNFTPWORKDIR, CCHMAXPATH, szBuf); 657 szBuf[CCHMAXPATH - 1] = 0; 658 bstrip(szBuf); 659 memcpy(ftprundir, szBuf, strlen(szBuf) + 1); 660 WinQueryDlgItemText(hwnd, CFGH_RUNMAILWORKDIR, CCHMAXPATH, szBuf); 661 szBuf[CCHMAXPATH - 1] = 0; 662 bstrip(szBuf); 663 memcpy(mailrundir, szBuf, strlen(szBuf) + 1); 664 WinQueryDlgItemText(hwnd, CFGH_FTPRUN, CCHMAXPATH, szBuf); 665 szBuf[CCHMAXPATH - 1] = 0; 666 if (strcmp(szBuf, ftprun)) { 667 psz = CheckApp_QuoteAddExe(szBuf); 668 memcpy(ftprun, psz, strlen(psz) + 1); 669 } 670 WinQueryDlgItemText(hwnd, CFGH_HTTPRUN, CCHMAXPATH, szBuf); 671 szBuf[CCHMAXPATH - 1] = 0; 672 if (strcmp(szBuf, httprun)) { 673 psz = CheckApp_QuoteAddExe(szBuf); 674 memcpy(httprun, psz, strlen(psz) + 1); 675 } 676 WinQueryDlgItemText(hwnd, CFGH_MAILRUN, CCHMAXPATH, szBuf); 677 szBuf[CCHMAXPATH - 1] = 0; 678 if (strcmp(szBuf, mailrun)) { 679 psz = CheckApp_QuoteAddExe(szBuf); 680 memcpy(mailrun, psz, strlen(psz) + 1); 653 CHAR szCLBuf[MAXCOMLINESTRG], szPathBuf[CCHMAXPATH]; 654 PSZ psz; 655 656 psz = xmalloc(MAXCOMLINESTRG, pszSrcFile, __LINE__); 657 WinQueryDlgItemText(hwnd, CFGH_RUNHTTPWORKDIR, CCHMAXPATH, szPathBuf); 658 szPathBuf[CCHMAXPATH - 1] = 0; 659 bstrip(szPathBuf); 660 memcpy(httprundir, szPathBuf, strlen(szPathBuf) + 1); 661 WinQueryDlgItemText(hwnd, CFGH_RUNFTPWORKDIR, CCHMAXPATH, szPathBuf); 662 szPathBuf[CCHMAXPATH - 1] = 0; 663 bstrip(szPathBuf); 664 memcpy(ftprundir, szPathBuf, strlen(szPathBuf) + 1); 665 WinQueryDlgItemText(hwnd, CFGH_RUNMAILWORKDIR, CCHMAXPATH, szPathBuf); 666 szPathBuf[CCHMAXPATH - 1] = 0; 667 bstrip(szPathBuf); 668 memcpy(mailrundir, szPathBuf, strlen(szPathBuf) + 1); 669 WinQueryDlgItemText(hwnd, CFGH_FTPRUN, MAXCOMLINESTRG, szCLBuf); 670 szCLBuf[MAXCOMLINESTRG - 1] = 0; 671 if (strcmp(szCLBuf, ftprun)){ 672 CheckApp_QuoteAddExe(psz, szCLBuf); 673 memcpy(ftprun, psz, strlen(psz) + 1); 674 } 675 WinQueryDlgItemText(hwnd, CFGH_HTTPRUN, MAXCOMLINESTRG, szCLBuf); 676 szCLBuf[MAXCOMLINESTRG - 1] = 0; 677 if (strcmp(szCLBuf, httprun)){ 678 CheckApp_QuoteAddExe(psz, szCLBuf); 679 memcpy(httprun, psz, strlen(psz) + 1); 680 } 681 WinQueryDlgItemText(hwnd, CFGH_MAILRUN, MAXCOMLINESTRG, szCLBuf); 682 szCLBuf[MAXCOMLINESTRG - 1] = 0; 683 if (strcmp(szCLBuf, mailrun)){ 684 CheckApp_QuoteAddExe(psz, szCLBuf); 685 memcpy(mailrun, psz, strlen(psz) + 1); 681 686 } 682 687 PrfWriteProfileString(fmprof, appname, "HttpRunDir", httprundir); … … 1179 1184 case WM_INITDLG: 1180 1185 WinSendDlgItemMsg(hwnd, CFGC_COMPARE, EM_SETTEXTLIMIT, 1181 MPFROM2SHORT( CCHMAXPATH, 0), MPVOID);1186 MPFROM2SHORT(MAXCOMLINESTRG, 0), MPVOID); 1182 1187 WinSendDlgItemMsg(hwnd, CFGC_DIRCOMPARE, EM_SETTEXTLIMIT, 1183 MPFROM2SHORT( CCHMAXPATH, 0), MPVOID);1188 MPFROM2SHORT(MAXCOMLINESTRG, 0), MPVOID); 1184 1189 WinEnableWindow(WinWindowFromID(hwnd, CFGC_FIND), FALSE); 1185 1190 PostMsg(hwnd, UM_UNDO, MPVOID, MPVOID); … … 1257 1262 case WM_CLOSE: 1258 1263 { 1259 CHAR szBuf[CCHMAXPATH], *psz; 1260 1261 WinQueryDlgItemText(hwnd, CFGC_DIRCOMPARE, CCHMAXPATH, szBuf); 1262 szBuf[CCHMAXPATH - 1] = 0; 1263 if (strcmp(szBuf, dircompare)) { 1264 psz = CheckApp_QuoteAddExe(szBuf); 1265 memcpy(dircompare, psz, strlen(psz) + 1); 1266 if (!strchr(dircompare, '%') && strlen(dircompare) > 3) 1267 strcat(dircompare, " %a"); 1268 } 1264 CHAR szCLBuf[MAXCOMLINESTRG]; 1265 PSZ psz; 1266 1267 psz = xmalloc(MAXCOMLINESTRG, pszSrcFile, __LINE__); 1268 WinQueryDlgItemText(hwnd, CFGC_DIRCOMPARE, MAXCOMLINESTRG, szCLBuf); 1269 szCLBuf[MAXCOMLINESTRG - 1] = 0; 1270 if (strcmp(szCLBuf, dircompare)){ 1271 CheckApp_QuoteAddExe(psz, szCLBuf); 1272 memcpy(dircompare, psz, strlen(psz) + 1); 1273 if (!strchr(dircompare, '%') && strlen(dircompare) > 3) 1274 strcat(dircompare, " %a"); 1275 } 1269 1276 PrfWriteProfileString(fmprof, appname, "DirCompare", dircompare); 1270 WinQueryDlgItemText(hwnd, CFGC_COMPARE, CCHMAXPATH, szBuf);1271 szBuf[CCHMAXPATH- 1] = 0;1272 if (strcmp(szBuf, compare)){1273 psz = CheckApp_QuoteAddExe(szBuf);1274 1275 1276 1277 1277 WinQueryDlgItemText(hwnd, CFGC_COMPARE, MAXCOMLINESTRG, szCLBuf); 1278 szCLBuf[MAXCOMLINESTRG - 1] = 0; 1279 if (strcmp(szCLBuf, compare)){ 1280 CheckApp_QuoteAddExe(psz, szCLBuf); 1281 memcpy(compare, psz, strlen(psz) + 1); 1282 if (!strchr(compare, '%') && strlen(compare) > 3) 1283 strcat(compare, " %a"); 1284 } 1278 1285 PrfWriteProfileString(fmprof, appname, "Compare", compare); 1279 1286 break;
Note:
See TracChangeset
for help on using the changeset viewer.