Changeset 423 for trunk/dll/arccnrs.c


Ignore:
Timestamp:
Jul 31, 2006, 9:21:52 PM (19 years ago)
Author:
root
Message:

Lower priority for archives with more than 1000 entries

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/arccnrs.c

    r406 r423  
    2727  26 Jul 06 SHL Correct SelectAll usage
    2828  29 Jul 06 SHL Use xfgets_bstripcr
     29  31 Jul 06 SHL Lower priority for archives with more than 1000 entries
    2930
    3031***********************************************************************/
     
    6970  {
    7071    case WM_INITDLG:
    71       if(!mp2)
     72      if (!mp2)
    7273        WinDismissDlg(hwnd,0);
    7374      else {
    7475        ad = (ARCDUMP *)mp2;
    7576        WinSetWindowPtr(hwnd,QWL_USER,ad);
    76         if(ad->errmsg)
    77           WinSetDlgItemText(hwnd,
    78                             ARCERR_TEXT,
    79                             ad->errmsg);
    80         if(!ad->info->test)
     77        if (ad->errmsg)
     78          WinSetDlgItemText(hwnd,ARCERR_TEXT,ad->errmsg);
     79        if (!ad->info->test)
    8180          WinEnableWindow(WinWindowFromID(hwnd,ARCERR_TEST),FALSE);
    82         if(ad->listname) {
     81        if (ad->listname) {
    8382          MLEsetlimit(WinWindowFromID(hwnd,ARCERR_MLE),-1L);
    8483          MLEsetformat(WinWindowFromID(hwnd,ARCERR_MLE),MLFIE_NOTRANS);
     
    9998
    10099        case IDM_HELP:
    101           if(hwndHelp)
     100          if (hwndHelp) {
    102101            WinSendMsg(hwndHelp,HM_DISPLAY_HELP,
    103102                       MPFROM2SHORT(HELP_ARCERR,0),
    104103                       MPFROMSHORT(HM_RESOURCEID));
     104          }
    105105          break;
    106106
     
    119119            list[0] = ad->arcname;
    120120            list[1] = NULL;
    121             if(TestBinary(ad->arcname)) {
    122               if(*binview)
     121            if (TestBinary(ad->arcname)) {
     122              if (*binview)
    123123                ExecOnList((HWND)0,binview,WINDOWED | SEPARATE,NULL,list,NULL);
    124124              else
     
    126126            }
    127127            else {
    128               if(*viewer)
     128              if (*viewer) {
    129129                ExecOnList((HWND)0,viewer,WINDOWED | SEPARATE |
    130130                           ((fViewChild) ? CHILD : 0),
    131131                           NULL,list,NULL);
     132              }
    132133              else
    133134                StartMLEEditor(HWND_DESKTOP,8 + 4 + 1,ad->arcname,hwnd);
     
    160161  INT        sortFlags;
    161162
    162   if (!pdcd)
    163   {
     163  if (!pdcd) {
    164164    HWND hwndCnr = pai1->hwndCnr;
    165     pdcd = (DIRCNRDATA *)WinQueryWindowPtr(hwndCnr,QWL_USER);
     165    pdcd = WinQueryWindowPtr(hwndCnr,QWL_USER);
    166166    if (!pdcd) {
    167167      Runtime_Error2(pszSrcFile, __LINE__, IDS_NODATATEXT);
     
    172172  sortFlags = pdcd->sortFlags;          // Optimize
    173173
    174   if(sortFlags) {
     174  if (sortFlags) {
    175175    switch(sortFlags & (~SORT_REVERSE)) {
    176176      case SORT_FIRSTEXTENSION:
    177177        pext = strchr(pai1->szFileName,'.');
    178178        ppext = strchr(pai2->szFileName,'.');
    179         if(!pext)
     179        if (!pext)
    180180          pext = NullStr;
    181         if(!ppext)
     181        if (!ppext)
    182182          ppext = NullStr;
    183183        ret = stricmp(pext,ppext);
     
    187187        pext = strrchr(pai1->szFileName,'.');
    188188        ppext = strrchr(pai2->szFileName,'.');
    189         if(!pext)
     189        if (!pext)
    190190          pext = NullStr;
    191         if(!ppext)
     191        if (!ppext)
    192192          ppext = NullStr;
    193193        ret = stricmp(pext,ppext);
     
    212212        ret = (pai1->cbFile < pai2->cbFile) ? 1 : (pai1->cbFile == pai2->cbFile) ?
    213213              0 : -1;
    214         if(!ret)
     214        if (!ret)
    215215          ret = (pai1->cbComp < pai2->cbComp) ? 1 : (pai1->cbComp == pai2->cbComp) ?
    216216                0 : -1;
     
    220220        ret = (pai1->cbComp < pai2->cbComp) ? 1 : (pai1->cbComp == pai2->cbComp) ?
    221221              0 : -1;
    222         if(!ret)
     222        if (!ret)
    223223          ret = (pai1->cbFile < pai2->cbFile) ? 1 : (pai1->cbFile == pai2->cbFile) ?
    224224                0 : -1;
    225225        break;
    226226    }
    227     if(!ret)
     227    if (!ret)
    228228      ret = (SHORT)stricmp(pai1->szFileName,pai2->szFileName);
    229     if(ret && (sortFlags & SORT_REVERSE))
     229    if (ret && (sortFlags & SORT_REVERSE))
    230230      ret = (ret > 0) ? -1 : 1;
    231231    return ret;
     
    242242  INT           ret = FALSE;
    243243
    244   if(dcd && *dcd->mask.szMask) {
     244  if (dcd && *dcd->mask.szMask) {
    245245    r = (PARCITEM)rmini;
    246     if(dcd->mask.pszMasks[1]) {
     246    if (dcd->mask.pszMasks[1]) {
    247247      for(x = 0;dcd->mask.pszMasks[x];x++) {
    248         if(*dcd->mask.pszMasks[x]) {
    249           if(*dcd->mask.pszMasks[x] != '/') {
    250             if(wildcard(r->szFileName,dcd->mask.pszMasks[x],FALSE))
     248        if (*dcd->mask.pszMasks[x]) {
     249          if (*dcd->mask.pszMasks[x] != '/') {
     250            if (wildcard(r->szFileName,dcd->mask.pszMasks[x],FALSE))
    251251              ret = TRUE;
    252252          }
    253253          else {
    254             if(wildcard(r->szFileName,dcd->mask.pszMasks[x] + 1,FALSE)) {
     254            if (wildcard(r->szFileName,dcd->mask.pszMasks[x] + 1,FALSE)) {
    255255              ret = FALSE;
    256256              break;
     
    261261    }
    262262    else {
    263       if(wildcard(r->szFileName,dcd->mask.szMask,FALSE))
     263      if (wildcard(r->szFileName,dcd->mask.szMask,FALSE))
    264264        ret = TRUE;
    265265    }
     
    279279static BOOL IsArcThere (HWND hwnd, CHAR *arcname)
    280280{
    281   if(arcname) {
    282     if(IsFile(arcname) != 1) {
     281  if (arcname) {
     282    if (IsFile(arcname) != 1) {
    283283      saymsg(MB_CANCEL,hwnd,
    284284             GetPString(IDS_SAYWHATTEXT),
     
    293293
    294294
    295 static INT FillArcCnr (HWND hwndCnr,CHAR *arcname,ARC_TYPE **arcinfo,
    296                        ULONGLONG *pullTotalBytes)
     295//== FillArcCnr() generate archive content list and fill container window ==
     296
     297static INT FillArcCnr(HWND hwndCnr,CHAR *arcname,ARC_TYPE **arcinfo,
     298                      ULONGLONG *pullTotalBytes)
    297299{
    298300  FILE         *fp;
     
    312314  APIRET        rc;
    313315
    314   if(!arcname || !arcinfo)
     316  if (!arcname || !arcinfo)
    315317    return 0;
    316318
    317319  info = *arcinfo;
    318   if(!info)
     320  if (!info)
    319321    info = find_type(arcname,NULL);
    320     for(x = 0;x < 99;x++) {
    321       sprintf(arctemp,"%s.%03x",ArcTempRoot,(clock() & 4095L));
    322       if(IsFile(arctemp) == 1)
    323         DosSleep(rand() % 100);
    324       else
    325         break;
    326     }
     322  for(x = 0;x < 99;x++) {
     323    sprintf(arctemp,"%s.%03x",ArcTempRoot,(clock() & 4095L));
     324    if (IsFile(arctemp) == 1)
     325      DosSleep(rand() % 100);
     326    else
     327      break;
     328  }
    327329
    328330ReTry:
     
    344346               CM_REMOVERECORD,
    345347               MPVOID,
    346                MPFROM2SHORT(0,
    347                             CMA_FREE | CMA_INVALIDATE | CMA_ERASE));
     348               MPFROM2SHORT(0,CMA_FREE | CMA_INVALIDATE | CMA_ERASE));
    348349    *arcinfo = info;
    349350    highest = info->osizepos;
    350     if(info->nsizepos > highest)
     351    if (info->nsizepos > highest)
    351352      highest = info->nsizepos;
    352     if(info->fdpos > highest)
     353    if (info->fdpos > highest)
    353354      highest = info->fdpos;
    354     if(info->fnpos > highest)
     355    if (info->fnpos > highest)
    355356      highest = info->fnpos;
    356     if(highest > 50)
     357    if (highest > 50) {
    357358      saymsg(MB_ENTER | MB_ICONEXCLAMATION,HWND_DESKTOP,
    358359             GetPString(IDS_SHAMETEXT),
    359360             "%s",
    360361             GetPString(IDS_BUNGEDUPTEXT));
    361     if(info->fnpos == -1)
     362    }
     363    if (info->fnpos == -1)
    362364      highest = 32767;
    363365
     
    368370    strcpy(s,info->list);
    369371    p = strchr(s,' ');
    370     if(p)
     372    if (p)
    371373      *p = 0;
    372374    DosError(FERR_DISABLEHARDERR);
    373     if(!DosQAppType(s,&apptype) &&
    374        ((apptype & FAPPTYP_DOS) ||
    375         (apptype & FAPPTYP_WINDOWSREAL) ||
    376         (apptype & FAPPTYP_WINDOWSPROT) ||
    377         (apptype & 0x1000))) {
     375    if (!DosQAppType(s,&apptype) &&
     376        ((apptype & FAPPTYP_DOS) ||
     377         (apptype & FAPPTYP_WINDOWSREAL) ||
     378         (apptype & FAPPTYP_WINDOWSPROT) ||
     379         (apptype & 0x1000))) {
    378380      p = GetCmdSpec(TRUE);
    379381      runemf2(SEPARATE | INVISIBLE | MINIMIZED | BACKGROUND | WAIT,
     
    391393    else {
    392394      fp = xfopen(arctemp,"w",pszSrcFile,__LINE__);
    393       if(!fp)
     395      if (!fp)
    394396        return 0;
    395397      else {
     
    432434
    433435      while(!feof(fp) && !gotend) {
    434         if(!xfgets_bstripcr(s,sizeof(s),fp,pszSrcFile,__LINE__))
     436        if (!xfgets_bstripcr(s,sizeof(s),fp,pszSrcFile,__LINE__))
    435437          break;
    436         if(!gotstart) {
     438        if (!gotstart) {
    437439          if (!strcmp(s,info->startlist))
    438440            gotstart = TRUE;
    439441        }
    440         else if(info->endlist &&
    441                 !strcmp(s,info->endlist))
     442        else if (info->endlist &&
     443                 !strcmp(s,info->endlist))
    442444          gotend = TRUE;
    443445        else {
     
    445447          fname = NULL;
    446448          bstrip(s);
    447           if(info->nameisfirst) {
     449          if (info->nameisfirst) {
    448450            strncpy(lonename,s,CCHMAXPATH + 2);
    449451            lonename[CCHMAXPATH + 1] = 0;
    450452            fname = lonename;
    451             if(!xfgets_bstripcr(s,sizeof(s),fp,pszSrcFile,__LINE__))
     453            if (!xfgets_bstripcr(s,sizeof(s),fp,pszSrcFile,__LINE__))
    452454              break;
    453             if(*fname == '\"') {
     455            if (*fname == '\"') {
    454456              memmove(fname,fname + 1,strlen(fname) + 1);
    455457              p = strchr(fname,'\"');
    456               if(p)
     458              if (p)
    457459                *p = 0;
    458460            }
     
    465467            while(*pp && (*pp == ' ' || *pp == '\t')) /* skip leading */
    466468              pp++;
    467             if(!*pp)
     469            if (!*pp)
    468470              break;
    469471            wasquote = FALSE;
     
    472474                         ((x != info->fnpos || !info->nameislast) ?
    473475                          (*p != ' ' && *p != '\t') : TRUE))) {
    474               if(*p == '\"') {
    475                 if(!wasquote) {
     476              if (*p == '\"') {
     477                if (!wasquote) {
    476478                  wasquote = TRUE;
    477479                  memmove(p,p + 1,strlen(p));
     
    484486                }
    485487              }
    486               else if(*p)
     488              else if (*p)
    487489                p++;
    488490            }
    489             if(*p) {
     491            if (*p) {
    490492              *p = 0;
    491493              p++;
    492494            }
    493             if(x == info->nsizepos)
     495            if (x == info->nsizepos)
    494496              nsize = pp;
    495             else if(x == info->osizepos)
     497            else if (x == info->osizepos)
    496498              osize = pp;
    497             else if(x == info->fdpos) {
     499            else if (x == info->fdpos) {
    498500              fdate = pp;
    499               if(info->fdflds > 1 &&
    500                  info->fdflds < 24) {
    501 
     501              if (info->fdflds > 1 &&
     502                  info->fdflds < 24) {
    502503                INT y;
    503504
    504                 if(*p) {
     505                if (*p) {
    505506                  p--;
    506507                  *p = ' ';
     
    512513                    x++;
    513514                  }
    514                   if(*p) {
     515                  if (*p) {
    515516                    *p = 0;
    516517                    p++;
     
    519520              }
    520521            }
    521             else if(x == info->fnpos) {
     522            else if (x == info->fnpos) {
    522523              fname = pp;
    523               if(pp && *pp == '*' && !*(pp + 1))  /* workaround for LH.EXE */
     524              if (pp && *pp == '*' && !*(pp + 1))  /* workaround for LH.EXE */
    524525                fname = NULL;
    525               if(info->nameislast)
     526              if (info->nameislast)
    526527                break;
    527528            }
    528             else if((!p || !*p) && info->fnpos == -1) {
     529            else if ((!p || !*p) && info->fnpos == -1) {
    529530              fname = pp;
    530531              break;
     
    536537            fname = lonename;
    537538          }
     539          // fixme to complain?
    538540          if (fname && *fname) {
    539541
     
    568570                pai->flags = ARCFLAGS_REALDIR;
    569571              }
    570               if(fname[strlen(fname) - 1] == '\\' ||
     572              if (fname[strlen(fname) - 1] == '\\' ||
    571573                 fname[strlen(fname) - 1] == '/')
    572574                pai->flags = ARCFLAGS_REALDIR;
    573575              strcpy(pai->szFileName,fname);
    574               if(fdate)
     576              if (fdate)
    575577                strcpy(pai->szDate,fdate);
    576578              pai->pszFileName = pai->szFileName;
     
    603605                *pullTotalBytes += pai->cbFile;
    604606              }
    605               if(!lastpai)
    606                 lastpai = pai;
    607607              numarcfiles++;
    608608              if  (!(++counter % 50)) {
     609                if (!lastpai)
     610                  lastpai = pai;
    609611                WinSendMsg(hwndCnr,
    610612                           CM_INVALIDATERECORD,
    611613                           lastpai,
    612                            MPFROM2SHORT(10,
    613                                         CMA_ERASE | CMA_REPOSITION));
     614                           MPFROM2SHORT(10,CMA_ERASE | CMA_REPOSITION));
    614615                lastpai = pai;
    615616              }
     617              // Avoid hogging system if large archive
     618              if (numarcfiles == 1000)
     619                  priority_idle();
    616620            }
    617621          }
     
    623627      if (!numarcfiles || !gotstart || (!gotend && info->endlist && *info->endlist))
    624628      {
     629        // Oops
    625630        ARCDUMP ad;
    626 
     631        CHAR errstr[CCHMAXPATH + 256];
     632
     633        // Try for alternate archiver
    627634        tinfo = info;
    628635        do {
    629636          tinfo = tinfo->next;
    630           if(tinfo)
     637          if (tinfo)
    631638            tinfo = find_type(arcname,tinfo);
    632           if(tinfo) {
     639          if (tinfo) {
    633640            DosError(FERR_DISABLEHARDERR);
    634641            DosForceDelete(arctemp);
     
    637644          }
    638645        } while(tinfo);
    639         DosBeep(750,50);                // fixme to know why?
    640         {
    641           CHAR errstr[CCHMAXPATH + 256];
    642 
    643           sprintf(errstr,GetPString(IDS_ARCERRORINFOTEXT),
    644                   arcname,
    645                   (!gotstart) ? GetPString(IDS_NOGOTSTARTTEXT) : NullStr,
    646                   (!numarcfiles) ? GetPString(IDS_NOARCFILESFOUNDTEXT) : NullStr,
    647                   (!gotend) ? GetPString(IDS_NOENDOFLISTTEXT) : NullStr);
    648           memset(&ad,0,sizeof(ARCDUMP));
    649           ad.info = info;
    650           strcpy(ad.listname,arctemp);
    651           strcpy(ad.arcname,arcname);
    652           ad.errmsg = errstr;
    653           WinDlgBox(HWND_DESKTOP,
    654                     hwndCnr,
    655                     ArcErrProc,
    656                     FM3ModHandle,
    657                     ARCERR_FRAME,
    658                     MPFROMP(&ad));
    659         }
     646        DosBeep(750,50);                // wake up user
     647        sprintf(errstr,GetPString(IDS_ARCERRORINFOTEXT),
     648                arcname,
     649                (!gotstart) ? GetPString(IDS_NOGOTSTARTTEXT) : NullStr,
     650                (!numarcfiles) ? GetPString(IDS_NOARCFILESFOUNDTEXT) : NullStr,
     651                (!gotend) ? GetPString(IDS_NOENDOFLISTTEXT) : NullStr);
     652        memset(&ad,0,sizeof(ARCDUMP));
     653        ad.info = info;
     654        strcpy(ad.listname,arctemp);
     655        strcpy(ad.arcname,arcname);
     656        ad.errmsg = errstr;
     657        WinDlgBox(HWND_DESKTOP,
     658                  hwndCnr,
     659                  ArcErrProc,
     660                  FM3ModHandle,
     661                  ARCERR_FRAME,
     662                  MPFROMP(&ad));
    660663      }
    661664      else if (!nomove && tinfo) {
     
    664667        info->next = arcsighead;
    665668        arcsighead->prev = info;
    666         if(tinfo)
     669        if (tinfo)
    667670          tinfo->next->prev = info->prev;
    668671        info->prev->next = tinfo;
     
    675678    DosForceDelete(arctemp);
    676679  }
     680
     681  if (numarcfiles >= 500)
     682    priority_normal();
    677683
    678684  return numarcfiles;
     
    713719              DIRCNRDATA *dcd;
    714720
    715               if(hwndButtonPopup)
     721              if (hwndButtonPopup)
    716722                WinDestroyWindow(hwndButtonPopup);
    717               if(id == DIR_SELECTED)
     723              if (id == DIR_SELECTED)
    718724                id = DIR_RESTORE;
    719               if(id == lastid) {
     725              if (id == lastid) {
    720726
    721727                ULONG check;
    722728
    723729                DosQuerySysInfo(QSV_MS_COUNT,QSV_MS_COUNT,&check,sizeof(check));
    724                 if(check < timestamp + 500) {
     730                if (check < timestamp + 500) {
    725731                  lastid = 0;
    726732                  goto MenuAbort;
     
    730736                                            FM3ModHandle,
    731737                                            id);
    732               if(hwndButtonPopup) {
     738              if (hwndButtonPopup) {
    733739                WinSetWindowUShort(hwndButtonPopup,
    734740                                   QWS_ID,
     
    738744                                                        ARC_CNR),
    739745                                        QWL_USER);
    740                 if(id == DIR_SORT) {
    741                   if(dcd)
     746                if (id == DIR_SORT) {
     747                  if (dcd)
    742748                    SetSortChecks(hwndButtonPopup,
    743749                                  dcd->sortFlags);
    744750                  WinSendMsg(hwndButtonPopup,
    745751                             MM_DELETEITEM,
    746                              MPFROM2SHORT(IDM_SORTNONE,
    747                                           FALSE),
     752                             MPFROM2SHORT(IDM_SORTNONE,FALSE),
    748753                             MPVOID);
    749754                  WinSendMsg(hwndButtonPopup,
    750755                             MM_DELETEITEM,
    751                              MPFROM2SHORT(IDM_SORTNAME,
    752                                           FALSE),
     756                             MPFROM2SHORT(IDM_SORTNAME,FALSE),
    753757                             MPVOID);
    754758                  WinSendMsg(hwndButtonPopup,
    755759                             MM_DELETEITEM,
    756                              MPFROM2SHORT(IDM_SORTLADATE,
    757                                           FALSE),
     760                             MPFROM2SHORT(IDM_SORTLADATE,FALSE),
    758761                             MPVOID);
    759762                  WinSendMsg(hwndButtonPopup,
    760763                             MM_DELETEITEM,
    761                              MPFROM2SHORT(IDM_SORTCRDATE,
    762                                           FALSE),
     764                             MPFROM2SHORT(IDM_SORTCRDATE,FALSE),
    763765                             MPVOID);
    764766                  WinSendMsg(hwndButtonPopup,
    765767                             MM_DELETEITEM,
    766                              MPFROM2SHORT(IDM_SORTDIRSFIRST,
    767                                           FALSE),
     768                             MPFROM2SHORT(IDM_SORTDIRSFIRST,FALSE),
    768769                             MPVOID);
    769770                  WinSendMsg(hwndButtonPopup,
    770771                             MM_DELETEITEM,
    771                              MPFROM2SHORT(IDM_SORTDIRSLAST,
    772                                           FALSE),
     772                             MPFROM2SHORT(IDM_SORTDIRSLAST,FALSE),
    773773                             MPVOID);
    774774                  WinSendMsg(hwndButtonPopup,
    775775                             MM_DELETEITEM,
    776                              MPFROM2SHORT(IDM_SORTSUBJECT,
    777                                           FALSE),
     776                             MPFROM2SHORT(IDM_SORTSUBJECT,FALSE),
    778777                             MPVOID);
    779778                  WinSendMsg(hwndButtonPopup,
     
    787786                }
    788787                ptl.x = 0;
    789                 if(WinPopupMenu(HWND_OBJECT,
     788                if (WinPopupMenu(HWND_OBJECT,
    790789                                HWND_OBJECT,
    791790                                hwndButtonPopup,
     
    803802                  ptl.y = swp.cy + 2;
    804803                }
    805                 if(WinPopupMenu(hwnd,
     804                if (WinPopupMenu(hwnd,
    806805                                hwnd,
    807806                                hwndButtonPopup,
     
    824823                                    ARC_CNR),
    825824                    WM_CONTROL,
    826                     MPFROM2SHORT(ARC_CNR,
    827                                  CN_CONTEXTMENU),
     825                    MPFROM2SHORT(ARC_CNR,CN_CONTEXTMENU),
    828826                    MPVOID);
    829827            break;
     
    831829      }
    832830MenuAbort:
    833       if(msg == UM_CONTEXTMENU)
     831      if (msg == UM_CONTEXTMENU)
    834832        return 0;
    835833      break;
    836834
    837835    case WM_MENUEND:
    838       if(hwndButtonPopup == (HWND)mp2) {
     836      if (hwndButtonPopup == (HWND)mp2) {
    839837        lastid = WinQueryWindowUShort((HWND)mp2,QWS_ID);
    840838        WinDestroyWindow(hwndButtonPopup);
     
    857855        char  *s    = NULL;
    858856
    859         if(fOtherHelp) {
    860           if((!hwndBubble ||
     857        if (fOtherHelp) {
     858          if ((!hwndBubble ||
    861859              WinQueryWindowULong(hwndBubble,QWL_USER) != hwnd) &&
    862860             !WinQueryCapture(HWND_DESKTOP)) {
     
    883881                break;
    884882            }
    885             if(s)
     883            if (s)
    886884              MakeBubble(hwnd,TRUE,s);
    887             else if(hwndBubble)
     885            else if (hwndBubble)
    888886              WinDestroyWindow(hwndBubble);
    889887          }
     
    933931                break;
    934932              default:
    935                 if((SHORT2FROMMP(mp2) & KC_ALT) != 0)
     933                if ((SHORT2FROMMP(mp2) & KC_ALT) != 0)
    936934                  cmd = IDM_WINDOWDLG;
    937935                else
     
    943941          case DIR_SORT:
    944942          case DIR_SELECTED:
    945             PostMsg(hwnd,
    946                     UM_CONTEXTMENU,
    947                     MPVOID,
    948                     MPVOID);
     943            PostMsg(hwnd,UM_CONTEXTMENU,MPVOID,MPVOID);
    949944            break;
    950945          case DIR_FILTER:
     
    954949            break;
    955950        }
    956         if(cmd)
     951        if (cmd)
    957952          PostMsg(WinWindowFromID(WinQueryWindow(hwnd,QW_PARENT),
    958953                                  ARC_CNR),
     
    968963    case DM_DRAGLEAVE:
    969964    case DM_DROPHELP:
    970       if(msg == DM_DRAGOVER) {
    971         if(!emphasized) {
     965      if (msg == DM_DRAGOVER) {
     966        if (!emphasized) {
    972967          emphasized = TRUE;
    973968          DrawTargetEmphasis(hwnd,emphasized);
    974969        }
    975970      }
    976       else if(msg != WM_BEGINDRAG) {
    977         if(emphasized) {
     971      else if (msg != WM_BEGINDRAG) {
     972        if (emphasized) {
    978973          emphasized = FALSE;
    979974          DrawTargetEmphasis(hwnd,emphasized);
     
    984979          switch(msg) {
    985980            case DM_DRAGOVER:
    986               if(AcceptOneDrop(mp1,mp2))
     981              if (AcceptOneDrop(mp1,mp2))
    987982                return MRFROM2SHORT(DOR_DROP,
    988983                                    DO_MOVE);
     
    998993                char szFrom[CCHMAXPATH + 2];
    999994
    1000                 if(emphasized) {
     995                if (emphasized) {
    1001996                  emphasized = FALSE;
    1002997                  DrawTargetEmphasis(hwnd,emphasized);
    1003998                }
    1004                 if(GetOneDrop(mp1,mp2,szFrom,sizeof(szFrom)))
     999                if (GetOneDrop(mp1,mp2,szFrom,sizeof(szFrom)))
    10051000                  WinSendMsg(WinWindowFromID(WinQueryWindow(hwnd,QW_PARENT),
    10061001                                             ARC_CNR),
     
    10771072    case WM_PSETFOCUS:
    10781073    case WM_SETFOCUS:
    1079       if(mp2)
     1074      if (mp2)
    10801075        PostMsg(hwnd,UM_FOCUSME,MPVOID,MPVOID);
    10811076      break;
     
    10911086
    10921087        hps = WinBeginPaint(hwnd,(HPS)0,NULL);
    1093         if(hps) {
     1088        if (hps) {
    10941089          WinQueryWindowRect(hwnd,&rcl);
    10951090          WinFillRect(hps,&rcl,CLR_PALEGRAY);
     
    11021097    case UM_SIZE:
    11031098    case WM_SIZE:
    1104       if(msg == UM_SIZE) {
     1099      if (msg == UM_SIZE) {
    11051100
    11061101        SWP     swp;
     
    11661161      }
    11671162      CommonTextPaint(hwnd,(HPS)0);
    1168       if(msg == UM_SIZE) {
     1163      if (msg == UM_SIZE) {
    11691164        WinSetWindowPos(WinQueryWindow(hwnd,QW_PARENT),HWND_TOP,0,0,0,0,
    11701165                        SWP_SHOW | SWP_ZORDER | SWP_ACTIVATE);
     
    11861181    case DM_DISCARDOBJECT:
    11871182      dcd = INSTDATA(hwnd);
    1188       if(dcd) {
     1183      if (dcd) {
    11891184
    11901185        LISTINFO    *li;
     
    11981193                        MPVOID,
    11991194                        MPFROMP(&cni));
    1200         if(li) {
     1195        if (li) {
    12011196          li->type = (msg == DM_DISCARDOBJECT) ?
    12021197                      IDM_DELETE :
    12031198                      IDM_PRINT;
    1204           if(!li->list ||
     1199          if (!li->list ||
    12051200             !li->list[0] ||
    1206              !PostMsg(hwnd,
    1207                       UM_ACTION,
    1208                       MPFROMP(li),
    1209                       MPVOID))
     1201             !PostMsg(hwnd,UM_ACTION,MPFROMP(li),MPVOID))
    12101202            FreeListInfo(li);
    12111203          else
     
    12201212    case DM_RENDER:
    12211213      dcd = WinQueryWindowPtr(hwnd,QWL_USER);
    1222       if(dcd && dcd->info && dcd->info->extract && dcd->arcname) {
     1214      if (dcd && dcd->info && dcd->info->extract && dcd->arcname) {
    12231215
    12241216        PDRAGTRANSFER  pdt = (PDRAGTRANSFER)mp1;
     
    12261218        ULONG          len;
    12271219
    1228         if(pdt->hwndClient && pdt->pditem && pdt->hstrSelectedRMF &&
     1220        if (pdt->hwndClient && pdt->pditem && pdt->hstrSelectedRMF &&
    12291221           pdt->hstrRenderToName)
    12301222        {
     
    12401232              len = DrgQueryStrName(pdt->hstrRenderToName,CCHMAXPATH,filename);
    12411233              filename[len] = 0;
    1242               if(len && *filename) {
     1234              if (len && *filename) {
    12431235                psz = xstrdup(filename,pszSrcFile,__LINE__);
    12441236                if (psz) {
     
    12631255
    12641256        dcd = WinQueryWindowPtr(hwnd,QWL_USER);
    1265         if(dcd && dcd->info && dcd->info->extract && dcd->arcname) {
     1257        if (dcd && dcd->info && dcd->info->extract && dcd->arcname) {
    12661258
    12671259          CHAR          *filename = (CHAR *)mp2,*p;
     
    12731265                                CCHMAXPATH,membername);
    12741266          membername[len] = 0;
    1275           if(*membername && len && filename) {
     1267          if (*membername && len && filename) {
    12761268            unlinkf("%s",filename);
    12771269            strcpy(construct,filename);
    12781270            p = strrchr(filename,'\\');
    1279             if(!p)
     1271            if (!p)
    12801272              *construct = 0;
    12811273            else {
    1282               if(p == filename || *(p - 1) == ':')
     1274              if (p == filename || *(p - 1) == ':')
    12831275                p++;
    12841276              *p = 0;
     
    12951287                    membername,
    12961288                    (needs_quoting(membername)) ? "\"" : NullStr);
    1297             if(*construct && construct[strlen(construct) - 1] != '\\')
     1289            if (*construct && construct[strlen(construct) - 1] != '\\')
    12981290              strcat(construct,"\\");
    12991291            strcat(construct,membername);
    1300             if(IsFile(construct) != -1) {
     1292            if (IsFile(construct) != -1) {
    13011293              rename(construct,filename);
    13021294              unlinkf("%s",construct);
    1303               if(IsFile(filename) != -1)
     1295              if (IsFile(filename) != -1)
    13041296                usRes = DMFL_RENDEROK;
    13051297            }
    13061298          }
    13071299        }
    1308         if(mp2)
     1300        if (mp2)
    13091301          free((CHAR *)mp2);
    13101302        PostMsg(pdt->hwndClient,DM_RENDERCOMPLETE,MPFROMP(pdt),
    1311                    MPFROM2SHORT(usRes,0));
     1303                MPFROM2SHORT(usRes,0));
    13121304      }
    13131305      return 0;
     
    13151307    case UM_SETUP:
    13161308      dcd = WinQueryWindowPtr(hwnd,QWL_USER);
    1317       if(dcd) {
     1309      if (!dcd) {
     1310        Runtime_Error2(pszSrcFile, __LINE__, IDS_NODATATEXT);
     1311        PostMsg(hwnd,WM_CLOSE,MPVOID,MPVOID);
     1312      }
     1313      else {
    13181314        /* set unique id */
    13191315        WinSetWindowUShort(hwnd,QWS_ID,ARCOBJ_FRAME + (ARC_FRAME - dcd->id));
    13201316        dcd->hwndObject = hwnd;         // pass back hwnd
    1321         if(ParentIsDesktop(hwnd,dcd->hwndParent))
     1317        if (ParentIsDesktop(hwnd,dcd->hwndParent))
    13221318          DosSleep(250);                // Avoid race?
    13231319      }
    1324       else
    1325         PostMsg(hwnd,WM_CLOSE,MPVOID,MPVOID);
    13261320      return 0;
    13271321
     
    13311325       */
    13321326      dcd = WinQueryWindowPtr(hwnd,QWL_USER);
    1333       if(dcd) {
    1334         if(mp1)
     1327      if (dcd) {
     1328        if (mp1)
    13351329          strcpy(dcd->arcname,(CHAR *)mp1);     // Update name on request
    13361330        WinSetWindowText(dcd->hwndFrame,"AV/2");
     
    13441338                                     &dcd->info,
    13451339                                     &dcd->ullTotalBytes);
    1346         if(!dcd->totalfiles)
    1347           PostMsg(dcd->hwndCnr,
    1348                   WM_CLOSE,
    1349                   MPVOID,
    1350                   MPVOID);
     1340        if (!dcd->totalfiles)
     1341          PostMsg(dcd->hwndCnr,WM_CLOSE,MPVOID,MPVOID);
    13511342        else {
    13521343          dcd->arcfilled = TRUE;
    1353           if(!PostMsg(dcd->hwndCnr,
    1354                       UM_RESCAN,
    1355                       MPVOID,
    1356                       MPVOID))
    1357             WinSendMsg(dcd->hwndCnr,
    1358                        UM_RESCAN,
    1359                        MPVOID,
    1360                        MPVOID);
    1361           PostMsg(dcd->hwndCnr,
    1362                   UM_SETUP2,
    1363                   MPVOID,
    1364                   MPVOID);
     1344          if (!PostMsg(dcd->hwndCnr,UM_RESCAN,MPVOID,MPVOID))
     1345            WinSendMsg(dcd->hwndCnr,UM_RESCAN,MPVOID,MPVOID);
     1346          PostMsg(dcd->hwndCnr,UM_SETUP2,MPVOID,MPVOID);
    13651347          WinSendMsg(dcd->hwndCnr,
    13661348                     CM_INVALIDATERECORD,
     
    13731355    case UM_SELECT:
    13741356      dcd = WinQueryWindowPtr(hwnd,QWL_USER);
    1375       if(dcd) {
     1357      if (dcd) {
    13761358        switch(SHORT1FROMMP(mp1)) {
    13771359          case IDM_SELECTALL:
     
    13961378                                IDS_SELECTFILTERTEXT :
    13971379                                IDS_DESELECTFILTERTEXT));
    1398               if(pci && (INT)pci != -1)
     1380              if (pci && (INT)pci != -1)
    13991381                strcpy(mask.szMask,pci->szFileName);
    1400               if(WinDlgBox(HWND_DESKTOP,dcd->hwndCnr,PickMaskDlgProc,
     1382              if (WinDlgBox(HWND_DESKTOP,dcd->hwndCnr,PickMaskDlgProc,
    14011383                           FM3ModHandle,MSK_FRAME,MPFROMP(&mask))) {
    1402                 if(SHORT1FROMMP(mp1) == IDM_SELECTMASK)
     1384                if (SHORT1FROMMP(mp1) == IDM_SELECTMASK)
    14031385                  SelectAll(dcd->hwndCnr,TRUE,TRUE,mask.szMask,NULL,FALSE);
    14041386                else
     
    14161398    case UM_ENTER:
    14171399      dcd = WinQueryWindowPtr(hwnd,QWL_USER);
    1418       if(dcd) {
     1400      if (dcd) {
    14191401
    14201402        CHAR   *s = (CHAR *)mp1,*p,*pp,filename[CCHMAXPATH];
    14211403
    1422         if(s) {
     1404        if (s) {
    14231405          if (!dcd->info->extract) {
    14241406            Runtime_Error(pszSrcFile, __LINE__, "no extract");
     
    14381420                    (needs_quoting(s)) ? "\"" : NullStr);
    14391421
    1440           if(!dcd->info->exwdirs) {
     1422          if (!dcd->info->exwdirs) {
    14411423            p = s;
    14421424            p = strrchr(s,'\\');
    14431425            pp = strrchr(s,'/');
    1444             if(p && pp)
     1426            if (p && pp)
    14451427              p = max(p,pp);
    1446             else if(!p)
     1428            else if (!p)
    14471429              p = pp;
    1448             if(p)
     1430            if (p)
    14491431              memmove(s,p + 1,strlen(p + 1));
    14501432          }
     
    14521434          p = filename;
    14531435          while(*p) {
    1454             if(*p == '/')
     1436            if (*p == '/')
    14551437              *p = '\\';
    14561438            p++;
    14571439          }
    14581440          free(s);
    1459           if(IsFile(filename) == 1)
     1441          if (IsFile(filename) == 1)
    14601442            WinSendMsg(dcd->hwndCnr,UM_ENTER,MPFROMP(filename),MPVOID);
    14611443        }
     
    14641446
    14651447    case UM_COMMAND:
    1466       if(mp1) {
    1467         if(PostMsg(hwnd,UM_ACTION,mp1,mp2))
     1448      if (mp1) {
     1449        if (PostMsg(hwnd,UM_ACTION,mp1,mp2))
    14681450          return (MRESULT)TRUE;
    14691451      }
     
    14731455      DosError(FERR_DISABLEHARDERR);
    14741456      dcd = WinQueryWindowPtr(hwnd,QWL_USER);
    1475       if(dcd) {
     1457      if (dcd) {
    14761458
    14771459        LISTINFO    *li = (LISTINFO *)mp1;
    14781460        register INT x;
    14791461
    1480         if(li && li->list && li->list[0]) {
     1462        if (li && li->list && li->list[0]) {
    14811463          switch(li->type) {
    14821464            case IDM_ARCHIVE:
     
    14931475                ad.namecanchange = 0;
    14941476                ad.fmoving = (li->type == IDM_ARCHIVEM);
    1495                 if(!WinDlgBox(HWND_DESKTOP,dcd->hwndClient,
     1477                if (!WinDlgBox(HWND_DESKTOP,dcd->hwndClient,
    14961478                              ArchiveDlgProc,FM3ModHandle,
    14971479                              ARCH_FRAME,(PVOID)&ad) ||
     
    15021484                strcpy(szBuffer,ad.command);
    15031485                strcat(szBuffer," ");
    1504                 if(needs_quoting(ad.arcname))
     1486                if (needs_quoting(ad.arcname))
    15051487                  strcat(szBuffer,"\"");
    15061488                strcat(szBuffer,ad.arcname);
    1507                 if(needs_quoting(ad.arcname))
     1489                if (needs_quoting(ad.arcname))
    15081490                  strcat(szBuffer,"\"");
    15091491                p = &szBuffer[strlen(szBuffer)];
    1510                 if(ad.mask.szMask) {
     1492                if (ad.mask.szMask) {
    15111493                  strcat(szBuffer," ");
    1512                   if(needs_quoting(ad.mask.szMask))
     1494                  if (needs_quoting(ad.mask.szMask))
    15131495                    strcat(szBuffer,"\"");
    15141496                  strcat(szBuffer,ad.mask.szMask);
    1515                   if(needs_quoting(ad.mask.szMask))
     1497                  if (needs_quoting(ad.mask.szMask))
    15161498                    strcat(szBuffer,"\"");
    15171499                }
     
    15191501                x = 0;
    15201502                while(li->list[x]) {
    1521                   if(needs_quoting(li->list[x]))
     1503                  if (needs_quoting(li->list[x]))
    15221504                    strcat(szBuffer,"\"");
    15231505                  strcat(szBuffer,li->list[x]);
    1524                   if(!IsFile(li->list[x])) {
    1525                     if(szBuffer[strlen(szBuffer) - 1] != '\\')
     1506                  if (!IsFile(li->list[x])) {
     1507                    if (szBuffer[strlen(szBuffer) - 1] != '\\')
    15261508                      strcat(szBuffer,"\\");
    15271509                    strcat(szBuffer,"*");
    15281510                  }
    1529                   if(needs_quoting(li->list[x]))
     1511                  if (needs_quoting(li->list[x]))
    15301512                    strcat(szBuffer,"\"");
    15311513                  x++;
    1532                   if(!li->list[x] || strlen(szBuffer) +
     1514                  if (!li->list[x] || strlen(szBuffer) +
    15331515                     strlen(li->list[x]) + 5 > 1024) {
    15341516                    runemf2(SEPARATE | WINDOWED |
     
    15401522                  strcat(szBuffer," ");
    15411523                }
    1542                 PostMsg(dcd->hwndCnr,
    1543                         UM_RESCAN,
    1544                         MPFROMSHORT(1),
    1545                         MPVOID);
     1524                PostMsg(dcd->hwndCnr,UM_RESCAN,MPFROMSHORT(1),MPVOID);
    15461525                Broadcast(WinQueryAnchorBlock(hwnd),
    15471526                          hwndMain,
     
    15651544                CHAR      prompt[CCHMAXPATH + 257];
    15661545
    1567                 if(!dcd->info->delete)
     1546                if (!dcd->info->delete)
    15681547                  break;
    15691548                memset(&ck,0,sizeof(ck));
     
    15811560                         GetPString(IDS_DELETELOWERTEXT) :
    15821561                         GetPString(IDS_REFRESHLOWERTEXT));
    1583                 if(!WinDlgBox(HWND_DESKTOP,hwnd,CheckListProc,
     1562                if (!WinDlgBox(HWND_DESKTOP,hwnd,CheckListProc,
    15841563                              FM3ModHandle,
    15851564                              CHECK_FRAME,MPFROMP(&ck)))
    15861565                  break;
    15871566                li->list = ck.list;
    1588                 if(!li->list || !li->list[0])
     1567                if (!li->list || !li->list[0])
    15891568                  break;
    1590                 if(li->type == IDM_DELETE)
     1569                if (li->type == IDM_DELETE)
    15911570                  sprintf(cl,"%s %s%s%s",dcd->info->delete,
    15921571                          (needs_quoting(dcd->arcname)) ? "\"" : NullStr,
     
    16041583                       strlen(cl) + strlen(li->list[x]) < 999;x++) {
    16051584                    strcat(cl," ");
    1606                     if(needs_quoting(li->list[x]))
     1585                    if (needs_quoting(li->list[x]))
    16071586                      strcat(cl,"\"");
    16081587                    strcat(cl,li->list[x]);
    1609                     if(needs_quoting(li->list[x]))
     1588                    if (needs_quoting(li->list[x]))
    16101589                      strcat(cl,"\"");
    16111590                  }
     
    16161595                  *endofit = 0;
    16171596                } while(li->list[x]);
    1618                 PostMsg(dcd->hwndCnr,
    1619                         UM_RESCAN,
    1620                         MPFROMSHORT(1),
    1621                         MPVOID);
     1597                PostMsg(dcd->hwndCnr,UM_RESCAN,MPFROMSHORT(1),MPVOID);
    16221598                Broadcast(WinQueryAnchorBlock(hwnd),
    16231599                          hwndMain,
     
    16451621                INT  z;
    16461622
    1647                 if((li->type == IDM_EXTRACT && !li->info->extract) ||
     1623                if ((li->type == IDM_EXTRACT && !li->info->extract) ||
    16481624                   ((li->type == IDM_VIEW || li->type == IDM_VIEWTEXT ||
    16491625                    li->type == IDM_VIEWBINARY || li->type == IDM_EDIT ||
     
    16621638                  break;
    16631639                }
    1664                 if(li->type == IDM_EXTRACT || li->type == IDM_EXTRACTWDIRS) {
     1640                if (li->type == IDM_EXTRACT || li->type == IDM_EXTRACTWDIRS) {
    16651641
    16661642                  CHAR        fullname[CCHMAXPATH * 2];
     
    16741650                            NullStr : "\\",
    16751651                            li->list[x]);
    1676                     if(IsFile(fullname) != -1) {
     1652                    if (IsFile(fullname) != -1) {
    16771653                      AddToList(li->list[x],&exfiles,&numfiles,
    16781654                                &numalloc);
    16791655                      li->list = RemoveFromList(li->list,li->list[x]);
    1680                       if(!li->list)
     1656                      if (!li->list)
    16811657                        break;
    16821658                      x--;
    16831659                    }
    16841660                  }
    1685                   if(exfiles && numfiles) {
     1661                  if (exfiles && numfiles) {
    16861662
    16871663                    CHECKLIST ckl;
     
    16991675                            &"s"[numfiles != 1],
    17001676                            li->targetpath);
    1701                     if(!WinDlgBox(HWND_DESKTOP,hwnd,CheckListProc,
     1677                    if (!WinDlgBox(HWND_DESKTOP,hwnd,CheckListProc,
    17021678                                  FM3ModHandle,
    17031679                                  CHECK_FRAME,MPFROMP(&ckl))) {
    1704                       if(ckl.list)
     1680                      if (ckl.list)
    17051681                        FreeList(ckl.list);
    17061682                      break;
    17071683                    }
    1708                     else if(ckl.list)
     1684                    else if (ckl.list)
    17091685                      li->list = CombineLists(li->list,ckl.list);
    17101686                  }
    17111687                }
    1712                 if(!li->list || !li->list[0])
     1688                if (!li->list || !li->list[0])
    17131689                  break;
    17141690                sprintf(cl,"%s %s%s%s",(li->type == IDM_EXTRACT ||
     
    17311707                       strlen(cl) + strlen(li->list[x]) < 999;x++) {
    17321708                    strcat(cl," ");
    1733                     if(needs_quoting(li->list[x]))
     1709                    if (needs_quoting(li->list[x]))
    17341710                      strcat(cl,"\"");
    17351711                    strcat(cl,li->list[x]);
    1736                     if(needs_quoting(li->list[x]))
     1712                    if (needs_quoting(li->list[x]))
    17371713                      strcat(cl,"\"");
    17381714                    ptr = li->list[x];
    17391715                    while(*ptr) {
    1740                       if(*ptr == '/')
     1716                      if (*ptr == '/')
    17411717                        *ptr = '\\';
    17421718                      ptr++;
     
    17491725                  *endofit = 0;
    17501726                } while(li->list[x]);
    1751                 if(li->type == IDM_EXTRACT || li->type == IDM_EXTRACTWDIRS) {
     1727                if (li->type == IDM_EXTRACT || li->type == IDM_EXTRACTWDIRS) {
    17521728                  /* update windows */
    17531729                  for(x = 0;li->list[x];x++) {
     
    17581734                    p = temp;
    17591735                    while(*p) {
    1760                       if(*p == '/')
     1736                      if (*p == '/')
    17611737                        *p = '\\';
    17621738                      p++;
     
    17651741                    if (p) {
    17661742                      strcpy(p,li->targetpath);
    1767                       if(p[strlen(p) - 1] != '\\')
     1743                      if (p[strlen(p) - 1] != '\\')
    17681744                        strcat(p,"\\");
    17691745                      strcat(p,temp);
     
    17811757                                   FM3ModHandle,OBJCNR_FRAME,
    17821758                                   MPFROMP(objectpath));
    1783                     if(rc) {
    1784                       if(rc > 1)
     1759                    if (rc) {
     1760                      if (rc > 1)
    17851761                        strcpy(objectpath,"<WP_DESKTOP>");
    17861762                      p = NULL;
    1787                       if(li->arcname) {
     1763                      if (li->arcname) {
    17881764                        p = strrchr(li->arcname,'\\');
    1789                         if(p)
     1765                        if (p)
    17901766                          p++;
    17911767                      }
     
    17991775                            MPVOID);
    18001776                }
    1801                 else if(li->type == IDM_EXEC)
     1777                else if (li->type == IDM_EXEC)
    18021778                  ExecOnList(hwnd,
    18031779                             li->runfile,
     
    18061782                             NULL,
    18071783                             GetPString(IDS_EXECARCFILETITLETEXT));
    1808                 else if(li->type == IDM_VIRUSSCAN)
     1784                else if (li->type == IDM_VIRUSSCAN)
    18091785                  ExecOnList(hwnd,virus,PROMPT | WINDOWED | SEPARATEKEEP,
    18101786                             li->targetpath,NULL,
    18111787                             GetPString(IDS_VIRUSSCANARCHIVETITLETEXT));
    1812                 else if(li->type == IDM_VIEW || li->type == IDM_VIEWTEXT ||
     1788                else if (li->type == IDM_VIEW || li->type == IDM_VIEWTEXT ||
    18131789                        li->type == IDM_VIEWBINARY || li->type == IDM_EDIT ||
    18141790                        li->type == IDM_EDITTEXT ||
     
    18441820                      free(temp);
    18451821                  }
    1846                   if(li->type == IDM_VIEW || li->type == IDM_EDIT) {
     1822                  if (li->type == IDM_VIEW || li->type == IDM_EDIT) {
    18471823
    18481824                    BOOL isit = TestBinary(li->list[0]);
    18491825
    1850                     if(isit) {
    1851                       if(li->type == IDM_VIEW)
     1826                    if (isit) {
     1827                      if (li->type == IDM_VIEW)
    18521828                        li->type = IDM_VIEWBINARY;
    18531829                      else
     
    18551831                    }
    18561832                    else {
    1857                       if(li->type == IDM_VIEW)
     1833                      if (li->type == IDM_VIEW)
    18581834                        li->type = IDM_VIEWTEXT;
    18591835                      else
     
    18611837                    }
    18621838                  }
    1863                   if(li->type == IDM_MCIPLAY) {
     1839                  if (li->type == IDM_MCIPLAY) {
    18641840
    18651841                    FILE *fp;
     
    18771853                    }
    18781854                  }
    1879                   else if(li->type == IDM_PRINT) {
     1855                  else if (li->type == IDM_PRINT) {
    18801856                    strcpy(li->targetpath,printer);
    18811857                    if (_beginthread(PrintList,NULL,65536,(PVOID)li) != -1) {
     
    18841860                    }
    18851861                  }
    1886                   else if(li->type == IDM_VIEWARCHIVE) {
     1862                  else if (li->type == IDM_VIEWARCHIVE) {
    18871863
    18881864                    ARC_TYPE *info;
    18891865
    18901866                    for(x = 0;li->list[x];x++) {
    1891                       if(IsFile(li->list[x]) == 1) {
     1867                      if (IsFile(li->list[x]) == 1) {
    18921868                        info = NULL;    // Do not hide dups - fixme to know why?
    18931869                        if (WinDlgBox(HWND_DESKTOP,HWND_DESKTOP,
     
    19051881                    }
    19061882                  }
    1907                   else if((li->type == IDM_VIEWTEXT && *viewer) ||
     1883                  else if ((li->type == IDM_VIEWTEXT && *viewer) ||
    19081884                          (li->type == IDM_VIEWBINARY && *binview) ||
    19091885                          (li->type == IDM_EDITTEXT && *editor) ||
     
    19181894                  }
    19191895                  else {
    1920                     if(li->hwnd) {
     1896                    if (li->hwnd) {
    19211897
    19221898                      ULONG viewtype;
    19231899
    19241900                      for(x = 0;li->list[x];x++) {
    1925                         if(x == 0) {
    1926                           if(li->type == IDM_VIEWBINARY ||
     1901                        if (x == 0) {
     1902                          if (li->type == IDM_VIEWBINARY ||
    19271903                             li->type == IDM_EDITBINARY)
    19281904                            viewtype = 16;
     
    19581934                  p = li->list[x];
    19591935                  while(*p) {
    1960                     if(*p == '/')
     1936                    if (*p == '/')
    19611937                      *p = '\\';
    19621938                    p++;
     
    19651941                          (dcd->directory[strlen(dcd->directory) - 1] == '\\') ?
    19661942                          NullStr : "\\",li->list[x]);
    1967                   if(IsFile(fullname) != -1)
    1968                     if(AddToList(fullname,&list2,&numfiles,&numalloced))
     1943                  if (IsFile(fullname) != -1)
     1944                    if (AddToList(fullname,&list2,&numfiles,&numalloced))
    19691945                      break;
    1970                   if(strchr(li->list[x],'\\')) {
     1946                  if (strchr(li->list[x],'\\')) {
    19711947                    p = strrchr(li->list[x],'\\');
    1972                     if(p) {
     1948                    if (p) {
    19731949                      p++;
    1974                       if(*p) {
     1950                      if (*p) {
    19751951                        sprintf(fullname,"%s%s%s",dcd->directory,
    19761952                                (dcd->directory[strlen(dcd->directory) - 1] == '\\') ?
    19771953                                NullStr : "\\",p);
    1978                         if(IsFile(fullname) != -1)
    1979                           if(AddToList(fullname,&list2,&numfiles,&numalloced))
     1954                        if (IsFile(fullname) != -1)
     1955                          if (AddToList(fullname,&list2,&numfiles,&numalloced))
    19801956                            break;
    19811957                      }
     
    19891965                             MPFROM2SHORT(IDM_COLLECTOR,0),MPVOID);
    19901966                  DosSleep(128L);
    1991                   if(Collector) {
    1992                     if(!PostMsg(Collector,WM_COMMAND,
     1967                  if (Collector) {
     1968                    if (!PostMsg(Collector,WM_COMMAND,
    19931969                                   MPFROM2SHORT(IDM_COLLECTOR,0),
    19941970                                   MPFROMP(list2)))
     
    20121988    case WM_DESTROY:
    20131989      dcd = WinQueryWindowPtr(hwnd,QWL_USER);
    2014       if(dcd) {
    2015         if(*dcd->workdir) {
     1990      if (dcd) {
     1991        if (*dcd->workdir) {
    20161992          DosSleep(33L);
    20171993          wipeallf("%s\\*",dcd->workdir);
    2018           if(rmdir(dcd->workdir)) {
     1994          if (rmdir(dcd->workdir)) {
    20191995            DosSleep(256L);
    20201996            wipeallf("%s\\*",dcd->workdir);
     
    20272003        WinSetWindowPtr(dcd->hwndCnr,QWL_USER,NULL);
    20282004      }
    2029       if(!PostMsg((HWND)0,WM_QUIT,MPVOID,MPVOID))
     2005      if (!PostMsg((HWND)0,WM_QUIT,MPVOID,MPVOID))
    20302006        WinSendMsg((HWND)0,WM_QUIT,MPVOID,MPVOID);
    20312007      break;
     
    20422018    case DM_PRINTOBJECT:
    20432019    case DM_DISCARDOBJECT:
    2044       if(dcd)
    2045         return WinSendMsg(dcd->hwndObject,
    2046                           msg,
    2047                           mp1,
    2048                           mp2);
     2020      if (dcd)
     2021        return WinSendMsg(dcd->hwndObject,msg,mp1,mp2);
    20492022      else
    20502023        return MRFROMLONG(DRR_TARGET);
     
    20522025    case WM_CHAR:
    20532026      shiftstate = (SHORT1FROMMP(mp1) & (KC_SHIFT | KC_ALT | KC_CTRL));
    2054       if(SHORT1FROMMP(mp1) & KC_KEYUP)
     2027      if (SHORT1FROMMP(mp1) & KC_KEYUP)
    20552028        return (MRESULT)TRUE;
    2056       if(SHORT1FROMMP(mp1) & KC_VIRTUALKEY) {
     2029      if (SHORT1FROMMP(mp1) & KC_VIRTUALKEY) {
    20572030        switch(SHORT2FROMMP(mp2)) {
    20582031          case VK_DELETE:
    2059             PostMsg(hwnd,
    2060                     WM_COMMAND,
    2061                     MPFROM2SHORT(IDM_DELETE,0),
    2062                     MPVOID);
    2063             break;
    2064         }
    2065       }
    2066       if(shiftstate || fNoSearch)
     2032            PostMsg(hwnd,WM_COMMAND,MPFROM2SHORT(IDM_DELETE,0),MPVOID);
     2033            break;
     2034        }
     2035      }
     2036      if (shiftstate || fNoSearch)
    20672037        break;
    2068       if(SHORT1FROMMP(mp1) & KC_CHAR) {
     2038      if (SHORT1FROMMP(mp1) & KC_CHAR) {
    20692039
    20702040        ULONG        thistime,len;
     
    20722042        PCNRITEM     pci;
    20732043
    2074         if(!dcd)
     2044        if (!dcd)
    20752045          break;
    20762046        switch(SHORT1FROMMP(mp2)) {
     
    20832053          default:
    20842054            thistime = WinQueryMsgTime(WinQueryAnchorBlock(hwnd));
    2085             if(thistime > dcd->lasttime + 1250)
     2055            if (thistime > dcd->lasttime + 1250)
    20862056              *dcd->szCommonName = 0;
    20872057            dcd->lasttime = thistime;
    2088             if(SHORT1FROMMP(mp2) == ' ' && !*dcd->szCommonName)
     2058            if (SHORT1FROMMP(mp2) == ' ' && !*dcd->szCommonName)
    20892059              break;
    20902060KbdRetry:
    20912061            len = strlen(dcd->szCommonName);
    2092             if(len >= CCHMAXPATH - 1) {
     2062            if (len >= CCHMAXPATH - 1) {
    20932063              *dcd->szCommonName = 0;
    20942064              len = 0;
     
    21062076                             MPFROMP(&srch),
    21072077                             MPFROMLONG(CMA_FIRST));
    2108             if(pci && (INT)pci != -1) {
     2078            if (pci && (INT)pci != -1) {
    21092079
    21102080              USHORT  attrib = CRA_CURSORED;
    21112081
    21122082              /* make found item current item */
    2113               if(!stricmp(pci->pszFileName,dcd->szCommonName))
     2083              if (!stricmp(pci->pszFileName,dcd->szCommonName))
    21142084                attrib |= CRA_SELECTED;
    21152085              WinSendMsg(hwnd,
     
    21222092            }
    21232093            else {
    2124               if(SHORT1FROMMP(mp2) == ' ') {
     2094              if (SHORT1FROMMP(mp2) == ' ') {
    21252095                dcd->szCommonName[len] = 0;
    21262096                break;
     
    21282098              *dcd->szCommonName = 0;
    21292099              dcd->lasttime = 0;
    2130               if(len)           // retry as first letter if no match
     2100              if (len)           // retry as first letter if no match
    21312101                goto KbdRetry;
    21322102            }
     
    21502120        memset(&cnri,0,sizeof(CNRINFO));
    21512121        cnri.cb = sizeof(CNRINFO);
    2152         if(WinSendMsg(hwnd,
     2122        if (WinSendMsg(hwnd,
    21532123                      CM_QUERYCNRINFO,
    21542124                      MPFROMP(&cnri),
    21552125                      MPFROMLONG(sizeof(CNRINFO)))) {
    2156           if(cnri.flWindowAttr & CV_DETAIL)
     2126          if (cnri.flWindowAttr & CV_DETAIL)
    21572127            PrfWriteProfileData(fmprof,
    21582128                                appname,
     
    21702140    case UM_UPDATERECORD:
    21712141    case UM_UPDATERECORDLIST:
    2172       if(dcd &&
    2173          !IsArcThere(hwnd,dcd->arcname))
    2174         PostMsg(hwnd,
    2175                 WM_CLOSE,
    2176                 MPVOID,
    2177                 MPVOID);
     2142      if (dcd && !IsArcThere(hwnd,dcd->arcname))
     2143        PostMsg(hwnd,WM_CLOSE,MPVOID,MPVOID);
    21782144      return 0;
    21792145
     
    21822148       * put name of our window (archive name) on status line
    21832149       */
    2184       if(dcd &&
    2185          hwndStatus &&
    2186          mp2)
    2187         WinSendMsg(hwnd,
    2188                    UM_RESCAN,
    2189                    MPVOID,
    2190                    MPVOID);
     2150      if (dcd && hwndStatus && mp2)
     2151        WinSendMsg(hwnd,UM_RESCAN,MPVOID,MPVOID);
    21912152      break;
    21922153
    21932154    case UM_SETUP2:
    2194       if(dcd &&
     2155      if (dcd &&
    21952156         dcd->info) {
    2196         if(dcd->info->fdpos == -1 || !dcd->info->datetype)
     2157        if (dcd->info->fdpos == -1 || !dcd->info->datetype)
    21972158          dcd->sortFlags &= (~SORT_LWDATE);
    2198         if(dcd->info->nsizepos == -1)
     2159        if (dcd->info->nsizepos == -1)
    21992160          dcd->sortFlags &= (~SORT_EASIZE);
    2200         if(dcd->info->osizepos == -1)
     2161        if (dcd->info->osizepos == -1)
    22012162          dcd->sortFlags &= (~SORT_SIZE);
    22022163        AdjustCnrColVis(hwnd,
     
    22222183                        dcd->info->fdpos != -1 && dcd->info->datetype,
    22232184                        FALSE);
    2224         WinSendMsg(hwnd,
    2225                    CM_INVALIDATEDETAILFIELDINFO,
    2226                    MPVOID,
    2227                    MPVOID);
     2185        WinSendMsg(hwnd,CM_INVALIDATEDETAILFIELDINFO,MPVOID,MPVOID);
    22282186      }
    22292187      return 0;
    22302188
    22312189    case UM_RESCAN:
    2232       if(dcd) {
    2233 
     2190      if (dcd) {
    22342191        CNRINFO  cnri;
    22352192        CHAR     s[CCHMAXPATH * 2],tb[81],tf[81];
    22362193        PARCITEM pci;
    22372194
    2238         if(mp1) {
    2239           PostMsg(dcd->hwndObject,
    2240                   UM_RESCAN,
    2241                   MPVOID,
    2242                   MPVOID);
     2195        if (mp1) {
     2196          PostMsg(dcd->hwndObject,UM_RESCAN,MPVOID,MPVOID);
    22432197          return 0;
    22442198        }
     
    22592213                *tb ? " / " : NullStr,
    22602214                tb);
    2261         WinSetDlgItemText(dcd->hwndClient,
    2262                           DIR_SELECTED,
    2263                           s);
     2215        WinSetDlgItemText(dcd->hwndClient,DIR_SELECTED,s);
    22642216        commafmt(tf,sizeof(tf),dcd->totalfiles);
    22652217        if (dcd->ullTotalBytes)
     
    22712223                *tb ? " / " : NullStr,
    22722224                tb);
    2273         WinSetDlgItemText(dcd->hwndClient,
    2274                           DIR_TOTALS,
    2275                           s);
    2276         if(hwndStatus &&
     2225        WinSetDlgItemText(dcd->hwndClient,DIR_TOTALS,s);
     2226        if (hwndStatus &&
    22772227           dcd->hwndFrame == WinQueryActiveWindow(dcd->hwndParent))
    22782228        {
     
    22852235                  (*dcd->mask.szMask) ? ")" : NullStr,dcd->arcname);
    22862236          WinSetWindowText(hwndStatus,s);
    2287           if(!ParentIsDesktop(hwnd,dcd->hwndParent)) {
     2237          if (!ParentIsDesktop(hwnd,dcd->hwndParent)) {
    22882238            pci = WinSendMsg(hwnd,
    22892239                             CM_QUERYRECORDEMPHASIS,
    22902240                             MPFROMLONG(CMA_FIRST),
    22912241                             MPFROMSHORT(CRA_CURSORED));
    2292             if(pci && (INT)pci != -1) {
    2293               if(fSplitStatus && hwndStatus2) {
     2242            if (pci && (INT)pci != -1) {
     2243              if (fSplitStatus && hwndStatus2) {
    22942244                if (dcd->ullTotalBytes)
    22952245                  CommaFmtULL(tb,sizeof(tb),pci->cbFile,' ');
     
    23032253                WinSetWindowText(hwndStatus2,s);
    23042254              }
    2305               if(fMoreButtons)
     2255              if (fMoreButtons)
    23062256                WinSetWindowText(hwndName,
    23072257                                 pci->szFileName);
     
    23152265          }
    23162266        }
    2317         if((dcd->arcfilled &&
     2267        if ((dcd->arcfilled &&
    23182268            !dcd->totalfiles) ||
    23192269           !IsArcThere(hwnd,dcd->arcname))
    2320           PostMsg(hwnd,
    2321                   WM_CLOSE,
    2322                   MPVOID,
    2323                   MPVOID);
     2270          PostMsg(hwnd,WM_CLOSE,MPVOID,MPVOID);
    23242271      }
    23252272      return 0;
    23262273
    23272274    case UM_SETUP:
    2328       if(dcd) {
    2329         if(!dcd->hwndObject) {
     2275      if (!dcd) {
     2276        Runtime_Error2(pszSrcFile, __LINE__, IDS_NODATATEXT);
     2277        PostMsg(hwnd,WM_CLOSE,MPVOID,MPVOID);
     2278        return 0;
     2279      }
     2280      else {
     2281        if (!dcd->hwndObject) {
    23302282          /*
    23312283           * first time through -- set things up
     
    23372289
    23382290            rc = DosCreateDir(dcd->workdir,0);
    2339             if(rc) {
    2340               if(rc == ERROR_ACCESS_DENIED) {
     2291            if (rc) {
     2292              if (rc == ERROR_ACCESS_DENIED) {
    23412293                p = strrchr(dcd->workdir,'.');
    2342                 if(p) {
     2294                if (p) {
    23432295                  p++;
    23442296                  pp = p;
     
    23482300                    sprintf(p,"%03x");
    23492301                    rc = DosCreateDir(dcd->workdir,0);
    2350                     if(!rc || rc != ERROR_ACCESS_DENIED)
     2302                    if (!rc || rc != ERROR_ACCESS_DENIED)
    23512303                      break;
    23522304                  }
    23532305                }
    23542306              }
    2355               if(rc)
     2307              if (rc)
    23562308                PostMsg(hwnd,WM_CLOSE,MPVOID,MPVOID);
    23572309              return 0;
     
    23652317            PFIELDINFO  pfi, pfiLastLeftCol;
    23662318            ULONG       numcols = CON_COLS;
     2319            CNRINFO cnri;
     2320            ULONG size;
    23672321
    23682322            pfi = WinSendMsg(hwnd,
     
    23702324                             MPFROMLONG(numcols),
    23712325                             NULL);
    2372             if(pfi) {
     2326            if (pfi) {
    23732327
    23742328              PFIELDINFO      pfiFirst;
     
    24152369                         MPFROMP(pfiFirst),
    24162370                         MPFROMP(&fii));
    2417               PostMsg(hwnd,
    2418                       UM_SETUP2,
    2419                       MPVOID,
    2420                       MPVOID);
    2421               {
    2422                 CNRINFO cnri;
    2423 
    2424                 memset(&cnri,0,sizeof(cnri));
    2425                 cnri.cb             = sizeof( CNRINFO );
    2426                 cnri.pFieldInfoLast = pfiLastLeftCol;
    2427                 cnri.xVertSplitbar  = DIR_SPLITBAR_OFFSET + 32;
    2428                 {
    2429                   ULONG size;
    2430 
    2431                   size = sizeof(LONG);
    2432                   PrfQueryProfileData(fmprof,appname,"ArcCnrSplitBar",
    2433                                       &cnri.xVertSplitbar,&size);
    2434                   if(cnri.xVertSplitbar <= 0)
    2435                     cnri.xVertSplitbar = DIR_SPLITBAR_OFFSET + 32;
    2436                 }
    2437                 cnri.flWindowAttr &= (~(CV_ICON | CV_TREE | CV_TEXT |
    2438                                       CV_NAME));
    2439                 cnri.flWindowAttr |= (CV_DETAIL | CA_DETAILSVIEWTITLES |
    2440                                       CV_FLOW);
    2441                 cnri.flWindowAttr &= (~(CA_ORDEREDTARGETEMPH |
    2442                                         CA_MIXEDTARGETEMPH));
    2443                 cnri.pSortRecord = (PVOID)ArcSort;
    2444                 WinSendMsg(hwnd,
    2445                            CM_SETCNRINFO,
    2446                            MPFROMP(&cnri),
    2447                            MPFROMLONG(CMA_PFIELDINFOLAST |
    2448                                       CMA_XVERTSPLITBAR  |
    2449                                       CMA_PSORTRECORD    |
    2450                                       CMA_FLWINDOWATTR));
    2451               }
     2371              PostMsg(hwnd,UM_SETUP2,MPVOID,MPVOID);
     2372
     2373              memset(&cnri,0,sizeof(cnri));
     2374              cnri.cb             = sizeof( CNRINFO );
     2375              cnri.pFieldInfoLast = pfiLastLeftCol;
     2376              cnri.xVertSplitbar  = DIR_SPLITBAR_OFFSET + 32;
     2377
     2378              size = sizeof(LONG);
     2379              PrfQueryProfileData(fmprof,appname,"ArcCnrSplitBar",
     2380                                  &cnri.xVertSplitbar,&size);
     2381              if (cnri.xVertSplitbar <= 0)
     2382                cnri.xVertSplitbar = DIR_SPLITBAR_OFFSET + 32;
     2383
     2384              cnri.flWindowAttr &= (~(CV_ICON | CV_TREE | CV_TEXT |
     2385                                    CV_NAME));
     2386              cnri.flWindowAttr |= (CV_DETAIL | CA_DETAILSVIEWTITLES |
     2387                                    CV_FLOW);
     2388              cnri.flWindowAttr &= (~(CA_ORDEREDTARGETEMPH |
     2389                                      CA_MIXEDTARGETEMPH));
     2390              cnri.pSortRecord = (PVOID)ArcSort;
     2391              WinSendMsg(hwnd,
     2392                         CM_SETCNRINFO,
     2393                         MPFROMP(&cnri),
     2394                         MPFROMLONG(CMA_PFIELDINFOLAST |
     2395                                    CMA_XVERTSPLITBAR  |
     2396                                    CMA_PSORTRECORD    |
     2397                                    CMA_FLWINDOWATTR));
    24522398            }
    24532399          }
    2454           WinSendMsg(hwnd,
    2455                      CM_SORTRECORD,
    2456                      MPFROMP(ArcSort),
    2457                      MPFROMP(dcd));
    2458           if(_beginthread(MakeObjWin,NULL,245760,(PVOID)dcd) == -1) {
     2400          WinSendMsg(hwnd,CM_SORTRECORD,MPFROMP(ArcSort),MPFROMP(dcd));
     2401          if (_beginthread(MakeObjWin,NULL,245760,(PVOID)dcd) == -1) {
    24592402            Runtime_Error(pszSrcFile, __LINE__, GetPString(IDS_COULDNTSTARTTHREADTEXT));
    24602403            PostMsg(hwnd,WM_CLOSE,MPVOID,MPVOID);
     
    24742417        }
    24752418      }
    2476       else {
    2477         PostMsg(hwnd,
    2478                 WM_CLOSE,
    2479                 MPVOID,
    2480                 MPVOID);
    2481         return 0;
    2482       }
    24832419      return 0;
    24842420
    24852421    case UM_SETDIR:
    2486       if(dcd) {
     2422      if (dcd) {
    24872423
    24882424        CHAR        s[CCHMAXPATH],*p;
     
    24952431        bstrip(s);
    24962432        MakeFullName(s);
    2497         if(*s) {
     2433        if (*s) {
    24982434          while ((p = strchr(s,'/')) != NULL)
    24992435            *p = '\\';
     
    25112447              }
    25122448            }
    2513             if(!SetDir(dcd->hwndParent,hwnd,s,0)) {
    2514               if(stricmp(dcd->directory,s)) {
     2449            if (!SetDir(dcd->hwndParent,hwnd,s,0)) {
     2450              if (stricmp(dcd->directory,s)) {
    25152451                DosEnterCritSec();
    25162452                 strcpy(lastextractpath,s);
     
    25182454              }
    25192455              strcpy(dcd->directory,s);
    2520               if((!isalpha(*s) || s[1] != ':') && *s != '.')
     2456              if ((!isalpha(*s) || s[1] != ':') && *s != '.')
    25212457                saymsg(MB_ENTER | MB_ICONASTERISK,
    25222458                       hwnd,
     
    25362472
    25372473    case UM_ENTER:
    2538       if(WinSendMsg(hwnd,
    2539                     UM_SETDIR,
    2540                     MPVOID,
    2541                     MPVOID))
     2474      if (WinSendMsg(hwnd,UM_SETDIR,MPVOID,MPVOID))
    25422475        return 0;
    25432476      SetShiftState();
    2544       if(dcd && (CHAR *)mp1) {
     2477      if (dcd && (CHAR *)mp1) {
    25452478
    25462479        SWP   swp;
    25472480        CHAR *filename = mp1;
    25482481
    2549         if(IsFile(filename) != 1)
     2482        if (IsFile(filename) != 1)
    25502483          return 0;
    25512484        WinQueryWindowPos(dcd->hwndFrame,&swp);
     
    25552488                        &swp,
    25562489                        filename);
    2557         if(fUnHilite)
     2490        if (fUnHilite)
    25582491          UnHilite(hwnd,
    25592492                   FALSE,
     
    25632496
    25642497    case WM_MENUEND:
    2565       if(dcd) {
     2498      if (dcd) {
    25662499
    25672500        HWND hwndMenu = (HWND)mp2;
    25682501
    2569         if(hwndMenu == ArcCnrMenu ||
    2570            hwndMenu == ArcMenu) {
    2571           MarkAll(hwnd,
    2572                   TRUE,
    2573                   FALSE,
    2574                   TRUE);
    2575           if(dcd->cnremphasized) {
     2502        if (hwndMenu == ArcCnrMenu || hwndMenu == ArcMenu) {
     2503          MarkAll(hwnd,TRUE,FALSE,TRUE);
     2504          if (dcd->cnremphasized) {
    25762505            WinSendMsg(hwnd,
    25772506                       CM_SETRECORDEMPHASIS,
     
    25852514
    25862515    case MM_PORTHOLEINIT:
    2587       if(dcd) {
     2516      if (dcd) {
    25882517        switch(SHORT1FROMMP(mp1)) {
    25892518          case 0:
     
    26072536    case UM_INITMENU:
    26082537    case WM_INITMENU:
    2609       if(dcd) {
     2538      if (dcd) {
    26102539        switch(SHORT1FROMMP(mp1)) {
    26112540          case IDM_FILESMENU:
    2612             if(dcd->info) {
     2541            if (dcd->info) {
    26132542              WinEnableMenuItem((HWND)mp2,
    26142543                                IDM_DELETE,
     
    26422571
    26432572          case IDM_COMMANDSMENU:
    2644             SetupCommandMenu((HWND)mp2,
    2645                              hwnd);
     2573            SetupCommandMenu((HWND)mp2,hwnd);
    26462574            break;
    26472575
    26482576          case IDM_SORTSUBMENU:
    2649             SetSortChecks((HWND)mp2,
    2650                           dcd->sortFlags);
     2577            SetSortChecks((HWND)mp2,dcd->sortFlags);
    26512578            break;
    26522579
     
    26622589        dcd->hwndLastMenu = (HWND)mp2;
    26632590      }
    2664       if(msg == WM_INITMENU)
     2591      if (msg == WM_INITMENU)
    26652592        break;
    26662593      return 0;
    26672594
    26682595    case UM_LOADFILE:
    2669       if(dcd && mp2) {
     2596      if (dcd && mp2) {
    26702597
    26712598        HWND ret;
     
    26812608
    26822609    case UM_COMMAND:
    2683       if(mp1) {
    2684         if(dcd) {
    2685           if(!PostMsg(dcd->hwndObject,
    2686                       UM_COMMAND,
    2687                       mp1,
    2688                       mp2)) {
     2610      if (mp1) {
     2611        if (dcd) {
     2612          if (!PostMsg(dcd->hwndObject,UM_COMMAND,mp1,mp2)) {
    26892613            Runtime_Error(pszSrcFile, __LINE__, "post");
    26902614            FreeListInfo((LISTINFO *)mp1);
     
    26992623
    27002624    case UM_OPENWINDOWFORME:
    2701       if(dcd) {
    2702         if(mp1 &&
    2703            !IsFile((CHAR *)mp1))
     2625      if (dcd) {
     2626        if (mp1 && !IsFile((CHAR *)mp1)) {
    27042627          OpenDirCnr((HWND)0,
    27052628                     hwndMain,
     
    27072630                     FALSE,
    27082631                     (char *)mp1);
    2709         else if(mp1 &&
    2710                 IsFile(mp1) == 1)
     2632        }
     2633        else if (mp1 && IsFile(mp1) == 1) {
    27112634          StartArcCnr(HWND_DESKTOP,
    27122635                      dcd->hwndFrame,
     
    27142637                      4,
    27152638                      (ARC_TYPE *)mp2);
     2639        }
    27162640      }
    27172641      return 0;
     
    27192643    case WM_COMMAND:
    27202644      DosError(FERR_DISABLEHARDERR);
    2721       if(dcd) {
    2722         if(SwitchCommand(dcd->hwndLastMenu,
     2645      if (dcd) {
     2646        if (SwitchCommand(dcd->hwndLastMenu,
    27232647                         SHORT1FROMMP(mp1)))
    27242648          return 0;
    2725         if(WinSendMsg(hwnd,
    2726                       UM_SETDIR,
    2727                       MPVOID,
    2728                       MPVOID))
     2649        if (WinSendMsg(hwnd,UM_SETDIR,MPVOID,MPVOID))
    27292650          return 0;
    2730         if(!IsArcThere(hwnd,
    2731                        dcd->arcname)) {
    2732           PostMsg(hwnd,
    2733                   WM_CLOSE,
    2734                   MPVOID,
    2735                   MPVOID);
     2651        if (!IsArcThere(hwnd,dcd->arcname)) {
     2652          PostMsg(hwnd,WM_CLOSE,MPVOID,MPVOID);
    27362653          return 0;
    27372654        }
     
    27482665              PostMsg(hwnd,
    27492666                      WM_CONTROL,
    2750                       MPFROM2SHORT(ARC_CNR,
    2751                                    CN_CONTEXTMENU),
     2667                      MPFROM2SHORT(ARC_CNR,CN_CONTEXTMENU),
    27522668                      MPFROMP(pci));
    27532669            }
     
    27842700
    27852701          case IDM_NOTEBOOK:
    2786             if(!ParentIsDesktop(dcd->hwndParent,dcd->hwndParent))
    2787               PostMsg(dcd->hwndParent,
    2788                       msg,
    2789                       mp1,
    2790                       mp2);
     2702            if (!ParentIsDesktop(dcd->hwndParent,dcd->hwndParent))
     2703              PostMsg(dcd->hwndParent,msg,mp1,mp2);
    27912704            else
    27922705              WinDlgBox(HWND_DESKTOP,
     
    28072720                                         &dcd->info,
    28082721                                         &dcd->ullTotalBytes);
    2809             PostMsg(dcd->hwndCnr,
    2810                     UM_RESCAN,
    2811                     MPVOID,
    2812                     MPVOID);
    2813             PostMsg(dcd->hwndCnr,
    2814                     UM_SETUP2,
    2815                     MPVOID,
    2816                     MPVOID);
     2722            PostMsg(dcd->hwndCnr,UM_RESCAN,MPVOID,MPVOID);
     2723            PostMsg(dcd->hwndCnr,UM_SETUP2,MPVOID,MPVOID);
    28172724            WinSendMsg(dcd->hwndCnr,
    28182725                       CM_INVALIDATERECORD,
    28192726                       MPVOID,
    2820                        MPFROM2SHORT(0,
    2821                                     CMA_ERASE | CMA_REPOSITION));
     2727                       MPFROM2SHORT(0,CMA_ERASE | CMA_REPOSITION));
    28222728            break;
    28232729
     
    28332739
    28342740          case IDM_HELP:
    2835             if(hwndHelp)
     2741            if (hwndHelp)
    28362742              WinSendMsg(hwndHelp,
    28372743                         HM_DISPLAY_HELP,
     
    28412747
    28422748          case IDM_WINDOWDLG:
    2843             if(!ParentIsDesktop(dcd->hwndParent,dcd->hwndFrame))
     2749            if (!ParentIsDesktop(dcd->hwndParent,dcd->hwndFrame))
    28442750              PostMsg(dcd->hwndParent,
    28452751                      UM_COMMAND,
     
    28622768                                         MPFROMLONG(CMA_FIRST),
    28632769                                         MPFROMSHORT(CRA_CURSORED));
    2864               if((INT)pci == -1)
     2770              if ((INT)pci == -1)
    28652771                pci = NULL;
    2866               if(SHORT1FROMMP(mp1) == IDM_HIDEALL) {
    2867                 if(pci) {
    2868                   if(!(pci->rc.flRecordAttr & CRA_SELECTED))
     2772              if (SHORT1FROMMP(mp1) == IDM_HIDEALL) {
     2773                if (pci) {
     2774                  if (!(pci->rc.flRecordAttr & CRA_SELECTED))
    28692775                    pci->rc.flRecordAttr |= CRA_FILTERED;
    28702776                    WinSendMsg(hwnd,
    28712777                               CM_INVALIDATERECORD,
    28722778                               MPFROMP(&pci),
    2873                                MPFROM2SHORT(1,
    2874                                             CMA_ERASE | CMA_REPOSITION));
     2779                               MPFROM2SHORT(1,CMA_ERASE | CMA_REPOSITION));
    28752780                    break;
    28762781                }
    28772782              }
    2878               PostMsg(dcd->hwndObject,
    2879                       UM_SELECT,
    2880                       mp1,
    2881                       MPFROMP(pci));
     2783              PostMsg(dcd->hwndObject,UM_SELECT,mp1,MPFROMP(pci));
    28822784            }
    28832785            break;
     
    29152817                break;
    29162818              case IDM_SORTREVERSE:
    2917                 if(dcd->sortFlags & SORT_REVERSE)
     2819                if (dcd->sortFlags & SORT_REVERSE)
    29182820                  dcd->sortFlags &= (~SORT_REVERSE);
    29192821                else
     
    29212823                break;
    29222824            }
    2923             WinSendMsg(hwnd,
    2924                        CM_SORTRECORD,
    2925                        MPFROMP(ArcSort),
    2926                        MPFROMP(dcd));
     2825            WinSendMsg(hwnd,CM_SORTRECORD,MPFROMP(ArcSort),MPFROMP(dcd));
    29272826            SaySort(WinWindowFromID(WinQueryWindow(hwnd,QW_PARENT),
    29282827                                    DIR_SORT),
     
    29332832
    29342833          case IDM_COLLECTOR:
    2935             if(!Collector) {
    2936 
     2834            if (!Collector) {
    29372835              HWND hwndC;
    29382836              SWP  swp;
    29392837
    2940               if(ParentIsDesktop(hwnd,dcd->hwndParent) && !fAutoTile &&
    2941                  (!fExternalCollector && !strcmp(realappname,FM3Str)))
     2838              if (ParentIsDesktop(hwnd,dcd->hwndParent) && !fAutoTile &&
     2839                  (!fExternalCollector && !strcmp(realappname,FM3Str)))
    29422840                GetNextWindowPos(dcd->hwndParent,&swp,NULL,NULL);
    29432841              hwndC = StartCollector((fExternalCollector ||
    29442842                                      strcmp(realappname,FM3Str)) ?
    29452843                                     HWND_DESKTOP : dcd->hwndParent,4);
    2946               if(hwndC) {
    2947                 if(!ParentIsDesktop(hwnd,dcd->hwndParent) && !fAutoTile &&
    2948                    (!fExternalCollector && !strcmp(realappname,FM3Str)))
     2844              if (hwndC) {
     2845                if (!ParentIsDesktop(hwnd,dcd->hwndParent) && !fAutoTile &&
     2846                    (!fExternalCollector && !strcmp(realappname,FM3Str)))
    29492847                  WinSetWindowPos(hwndC,
    29502848                                  HWND_TOP,
     
    29552853                                  SWP_MOVE | SWP_SIZE |
    29562854                                  SWP_SHOW | SWP_ZORDER);
    2957                 else if(!ParentIsDesktop(hwnd,dcd->hwndParent) &&
    2958                         fAutoTile &&
    2959                         !strcmp(realappname,FM3Str))
     2855                else if (!ParentIsDesktop(hwnd,dcd->hwndParent) &&
     2856                         fAutoTile &&
     2857                         !strcmp(realappname,FM3Str)) {
    29602858                  TileChildren(dcd->hwndParent,TRUE);
     2859                }
    29612860                WinSetWindowPos(hwndC,
    29622861                                HWND_TOP,
     
    29752874          case IDM_ARCEXTRACTEXIT:
    29762875          case IDM_ARCEXTRACT:
    2977             if(dcd->info->extract)
     2876            if (dcd->info->extract)
    29782877              runemf2(SEPARATE | WINDOWED |
    29792878                      ((fArcStuffVisible) ? 0 : (BACKGROUND | MINIMIZED)),
     
    29832882                      dcd->arcname,
    29842883                      (needs_quoting(dcd->arcname)) ? "\"" : NullStr);
    2985             if(SHORT1FROMMP(mp1) == IDM_ARCEXTRACTEXIT)
    2986               PostMsg(hwnd,
    2987                       WM_CLOSE,
    2988                       MPVOID,
    2989                       MPVOID);
     2884            if (SHORT1FROMMP(mp1) == IDM_ARCEXTRACTEXIT)
     2885              PostMsg(hwnd,WM_CLOSE,MPVOID,MPVOID);
    29902886            break;
    29912887
    29922888          case IDM_ARCEXTRACTWDIRSEXIT:
    29932889          case IDM_ARCEXTRACTWDIRS:
    2994             if(dcd->info->exwdirs)
     2890            if (dcd->info->exwdirs)
    29952891              runemf2(SEPARATE | WINDOWED |
    29962892                      ((fArcStuffVisible) ? 0 : (BACKGROUND | MINIMIZED)) ,
     
    30002896                      dcd->arcname,
    30012897                      (needs_quoting(dcd->arcname)) ? "\"" : NullStr);
    3002             if(SHORT1FROMMP(mp1) == IDM_ARCEXTRACTWDIRSEXIT)
    3003               PostMsg(hwnd,
    3004                       WM_CLOSE,
    3005                       MPVOID,
    3006                       MPVOID);
     2898            if (SHORT1FROMMP(mp1) == IDM_ARCEXTRACTWDIRSEXIT)
     2899              PostMsg(hwnd,WM_CLOSE,MPVOID,MPVOID);
    30072900            break;
    30082901
    30092902          case IDM_RESORT:
    3010             WinSendMsg(hwnd,
    3011                        CM_SORTRECORD,
    3012                        MPFROMP(ArcSort),
    3013                        MPFROMP(dcd));
     2903            WinSendMsg(hwnd,CM_SORTRECORD,MPFROMP(ArcSort),MPFROMP(dcd));
    30142904            break;
    30152905
     
    30192909              PARCITEM pci;
    30202910
    3021               if(!*dcd->mask.szMask) {
     2911              if (!*dcd->mask.szMask) {
    30222912                empty = TRUE;
    30232913                pci = (PARCITEM)CurrentRecord(hwnd);
    3024                 if(pci && strchr(pci->szFileName,'.'))
     2914                if (pci && strchr(pci->szFileName,'.'))
    30252915                  strcpy(dcd->mask.szMask,pci->szFileName);
    30262916              }
    30272917
    3028               if(WinDlgBox(HWND_DESKTOP,hwnd,PickMaskDlgProc,
    3029                            FM3ModHandle,MSK_FRAME,MPFROMP(&dcd->mask))) {
    3030                 WinSendMsg(hwnd,CM_FILTER,MPFROMP(ArcFilter),
    3031                            MPFROMP(dcd));
     2918              if (WinDlgBox(HWND_DESKTOP,hwnd,PickMaskDlgProc,
     2919                            FM3ModHandle,MSK_FRAME,MPFROMP(&dcd->mask))) {
     2920                WinSendMsg(hwnd,CM_FILTER,MPFROMP(ArcFilter),MPFROMP(dcd));
    30322921                PostMsg(hwnd,UM_RESCAN,MPVOID,MPVOID);
    30332922              }
    3034               else if(empty)
     2923              else if (empty)
    30352924                *dcd->mask.szMask = 0;
    30362925              SayFilter(WinWindowFromID(WinQueryWindow(hwnd,QW_PARENT),
     
    30402929
    30412930          case IDM_SWITCH:
    3042             if(mp2) {
    3043               if(stricmp(dcd->directory,(CHAR *)mp2)) {
     2931            if (mp2) {
     2932              if (stricmp(dcd->directory,(CHAR *)mp2)) {
    30442933                DosEnterCritSec();
    30452934                 strcpy(lastextractpath,(CHAR *)mp2);
     
    30582947
    30592948              strcpy(newdir,dcd->directory);
    3060               if(!WinDlgBox(HWND_DESKTOP,dcd->hwndParent,WalkExtractDlgProc,
    3061                             FM3ModHandle,WALK_FRAME,
    3062                             MPFROMP(newdir)) || !*newdir)
     2949              if (!WinDlgBox(HWND_DESKTOP,dcd->hwndParent,WalkExtractDlgProc,
     2950                             FM3ModHandle,WALK_FRAME,
     2951                             MPFROMP(newdir)) || !*newdir)
    30632952                break;
    3064               if(stricmp(newdir,dcd->directory)) {
     2953              if (stricmp(newdir,dcd->directory)) {
    30652954                strcpy(dcd->directory,newdir);
    3066                 if(stricmp(lastextractpath,newdir))
     2955                if (stricmp(lastextractpath,newdir))
    30672956                  strcpy(lastextractpath,newdir);
    30682957                WinSetWindowText(dcd->hwndExtract,dcd->directory);
     
    30722961
    30732962          case IDM_TEST:
    3074             if(dcd->info->test)
     2963            if (dcd->info->test)
    30752964              runemf2(SEPARATEKEEP | WINDOWED | MAXIMIZED,
    30762965                      hwnd,NULL,NULL,"%s %s%s%s",dcd->info->test,
     
    31343023                  PARCITEM pai;
    31353024
    3136                   if(SHORT1FROMMP(mp1) != IDM_EXEC)
     3025                  if (SHORT1FROMMP(mp1) != IDM_EXEC)
    31373026                    pai = (PARCITEM)CurrentRecord(hwnd);
    31383027                  else
     
    31403029                                               MPFROMLONG(CMA_FIRST),
    31413030                                               MPFROMSHORT(CRA_CURSORED));
    3142                   if(pai && (INT)pai != -1)
     3031                  if (pai && (INT)pai != -1)
    31433032                    strcpy(li->runfile,pai->szFileName);
    31443033                  else
     
    31623051                    break;
    31633052                }
    3164                 if(li->list) {
    3165                   if(!PostMsg(dcd->hwndObject,UM_ACTION,MPFROMP(li),
    3166                                  MPVOID)) {
     3053                if (li->list) {
     3054                  if (!PostMsg(dcd->hwndObject,UM_ACTION,MPFROMP(li),MPVOID)) {
    31673055                    Runtime_Error(pszSrcFile, __LINE__, "post");
    31683056                    FreeListInfo(li);
    31693057                  }
    3170                   else if(fUnHilite && SHORT1FROMMP(mp1) != IDM_EDIT)
     3058                  else if (fUnHilite && SHORT1FROMMP(mp1) != IDM_EDIT)
    31713059                    UnHilite(hwnd,TRUE,&dcd->lastselection);
    31723060                }
     
    31823070    case WM_CONTROL:
    31833071      DosError(FERR_DISABLEHARDERR);
    3184       if(dcd) {
     3072      if (dcd) {
    31853073        switch(SHORT2FROMMP(mp1)) {
    31863074          case CN_BEGINEDIT:
    3187             PostMsg(hwnd,
    3188                     CM_CLOSEEDIT,
    3189                     MPVOID,
    3190                     MPVOID);
     3075            PostMsg(hwnd,CM_CLOSEEDIT,MPVOID,MPVOID);
    31913076            break;
    31923077
    31933078          case CN_ENDEDIT:
    3194             if(!((PCNREDITDATA)mp2)->pRecord) {
     3079            if (!((PCNREDITDATA)mp2)->pRecord) {
    31953080
    31963081              PFIELDINFO pfi = ((PCNREDITDATA)mp2)->pFieldInfo;
    31973082              USHORT     cmd = 0;
    31983083
    3199               if(!pfi || pfi->offStruct == FIELDOFFSET(ARCITEM,pszFileName))
     3084              if (!pfi || pfi->offStruct == FIELDOFFSET(ARCITEM,pszFileName))
    32003085                cmd = IDM_SORTSMARTNAME;
    3201               else if(pfi->offStruct == FIELDOFFSET(ARCITEM,cbFile))
     3086              else if (pfi->offStruct == FIELDOFFSET(ARCITEM,cbFile))
    32023087                cmd = IDM_SORTSIZE;
    3203               else if(pfi->offStruct == FIELDOFFSET(ARCITEM,cbComp))
     3088              else if (pfi->offStruct == FIELDOFFSET(ARCITEM,cbComp))
    32043089                cmd = IDM_SORTEASIZE;
    3205               else if(pfi->offStruct == FIELDOFFSET(ARCITEM,date))
     3090              else if (pfi->offStruct == FIELDOFFSET(ARCITEM,date))
    32063091                cmd = IDM_SORTLWDATE;
    3207               else if(pfi->offStruct == FIELDOFFSET(ARCITEM,time))
     3092              else if (pfi->offStruct == FIELDOFFSET(ARCITEM,time))
    32083093                cmd = IDM_SORTLWDATE;
    3209               if(cmd)
    3210                 PostMsg(hwnd,
    3211                         WM_COMMAND,
    3212                         MPFROM2SHORT(cmd,0),
    3213                         MPVOID);
     3094              if (cmd)
     3095                PostMsg(hwnd,WM_COMMAND,MPFROM2SHORT(cmd,0),MPVOID);
    32143096            }
    32153097            break;
     
    32233105
    32243106          case CN_DRAGLEAVE:
    3225             if(mp2) {
     3107            if (mp2) {
    32263108
    32273109              PDRAGINFO pDInfo;
     
    32353117          case CN_DRAGAFTER:
    32363118          case CN_DRAGOVER:
    3237             if(mp2) {
     3119            if (mp2) {
    32383120
    32393121              PDRAGITEM pDItem;                      /* Pointer to DRAGITEM   */
     
    32423124
    32433125              pci = (PARCITEM)((PCNRDRAGINFO)mp2)->pRecord;
    3244               if(SHORT1FROMMP(mp1) == CN_DRAGAFTER)
     3126              if (SHORT1FROMMP(mp1) == CN_DRAGAFTER)
    32453127                pci = NULL;
    32463128              pDInfo = ((PCNRDRAGINFO)mp2)->pDragInfo;
    32473129              DrgAccessDraginfo(pDInfo);             /* Access DRAGINFO       */
    3248               if(*dcd->arcname) {
    3249                 if((driveflags[toupper(*dcd->arcname) - 'A'] & DRIVE_NOTWRITEABLE) ||
    3250                    !dcd->info ||
    3251                    !dcd->info->create) {
     3130              if (*dcd->arcname) {
     3131                if ((driveflags[toupper(*dcd->arcname) - 'A'] & DRIVE_NOTWRITEABLE) ||
     3132                    !dcd->info ||
     3133                    !dcd->info->create) {
    32523134                  DrgFreeDraginfo(pDInfo);
    32533135                  return MRFROM2SHORT(DOR_NEVERDROP,0);
    32543136                }
    32553137              }
    3256               if(pci) {
     3138              if (pci) {
    32573139                DrgFreeDraginfo(pDInfo);
    32583140                return MRFROM2SHORT(DOR_NODROP,0);
    32593141              }
    3260               pDItem = DrgQueryDragitemPtr(pDInfo,   /* Access DRAGITEM       */
    3261                                            0);       /* Index to DRAGITEM     */
    3262               if(DrgVerifyRMF(pDItem,                /* Check valid rendering */
    3263                               DRM_OS2FILE,           /* mechanisms and data   */
    3264                               NULL) &&
    3265                  !(pDItem->fsControl & DC_PREPARE)) {
     3142              pDItem = DrgQueryDragitemPtr(pDInfo,      /* Access DRAGITEM       */
     3143                                           0);          /* Index to DRAGITEM     */
     3144              if (DrgVerifyRMF(pDItem,                  /* Check valid rendering */
     3145                               DRM_OS2FILE,             /* mechanisms and data   */
     3146                               NULL) &&
     3147                  !(pDItem->fsControl & DC_PREPARE)) {
    32663148                DrgFreeDraginfo(pDInfo);             /* Free DRAGINFO         */
    32673149                return(MRFROM2SHORT(DOR_DROP,        /* Return okay to drop   */
     
    32743156
    32753157          case CN_INITDRAG:
    3276             if(mp2) {
     3158            if (mp2) {
    32773159
    32783160              BOOL         wasemphasized = FALSE;
     
    32803162              PARCITEM  pci;
    32813163
    3282               if(pcd) {
     3164              if (pcd) {
    32833165                pci = (PARCITEM)pcd->pRecord;
    3284                 if(pci) {
    3285                   if(pci->rc.flRecordAttr & CRA_SELECTED)
     3166                if (pci) {
     3167                  if (pci->rc.flRecordAttr & CRA_SELECTED)
    32863168                    wasemphasized = TRUE;
    3287                   if(!ParentIsDesktop(hwnd,dcd->hwndParent) &&
    3288                      fSplitStatus && hwndStatus2)
     3169                  if (!ParentIsDesktop(hwnd,dcd->hwndParent) &&
     3170                      fSplitStatus && hwndStatus2)
    32893171                    WinSetWindowText(hwndStatus2,
    32903172                                     GetPString(IDS_DRAGARCMEMTEXT));
    3291                   if(DoFileDrag(hwnd,
    3292                                 dcd->hwndObject,
    3293                                 mp2,
    3294                                 dcd->arcname,
    3295                                 NULL,
    3296                                 TRUE)) {
    3297                     if(fUnHilite && wasemphasized)
     3173                  if (DoFileDrag(hwnd,
     3174                                 dcd->hwndObject,
     3175                                 mp2,
     3176                                 dcd->arcname,
     3177                                 NULL,
     3178                                 TRUE)) {
     3179                    if (fUnHilite && wasemphasized)
    32983180                      UnHilite(hwnd,TRUE,&dcd->lastselection);
    32993181                  }
    3300                   if(!ParentIsDesktop(hwnd,dcd->hwndParent) &&
    3301                      fSplitStatus && hwndStatus2)
     3182                  if (!ParentIsDesktop(hwnd,dcd->hwndParent) &&
     3183                      fSplitStatus && hwndStatus2) {
    33023184                    PostMsg(hwnd,UM_RESCAN,MPVOID,MPVOID);
     3185                  }
    33033186                }
    33043187                else {
    3305                   if(!ParentIsDesktop(hwnd,dcd->hwndParent) &&
    3306                      fSplitStatus && hwndStatus2)
     3188                  if (!ParentIsDesktop(hwnd,dcd->hwndParent) &&
     3189                      fSplitStatus && hwndStatus2)
    33073190                    WinSetWindowText(hwndStatus2,
    33083191                                     GetPString(IDS_DRAGARCFILETEXT));
     
    33113194                          dcd->arcname,
    33123195                          FALSE);
    3313                   if(!ParentIsDesktop(hwnd,dcd->hwndParent) &&
    3314                      fSplitStatus && hwndStatus2)
     3196                  if (!ParentIsDesktop(hwnd,dcd->hwndParent) &&
     3197                      fSplitStatus && hwndStatus2)
    33153198                    PostMsg(hwnd,UM_RESCAN,MPVOID,MPVOID);
    33163199                }
     
    33203203
    33213204          case CN_DROP:
    3322             if(mp2) {
     3205            if (mp2) {
    33233206
    33243207              LISTINFO *li;
     
    33313214                              mp2);
    33323215              DosBeep(50,100);                  // fixme to know why beep?
    3333               if(li) {
     3216              if (li) {
    33343217                li->type = (li->type == DO_MOVE) ?
    33353218                            IDM_ARCHIVEM :
    33363219                            IDM_ARCHIVE;
    33373220                strcpy(li->targetpath,dcd->arcname);
    3338                 if(!li->list ||
    3339                    !li->list[0] ||
    3340                    !PostMsg(dcd->hwndObject,
    3341                             UM_ACTION,
    3342                             MPFROMP(li),
    3343                             MPVOID))
     3221                if (!li->list ||
     3222                    !li->list[0] ||
     3223                    !PostMsg(dcd->hwndObject,UM_ACTION,MPFROMP(li),MPVOID))
    33443224                  FreeListInfo(li);
    33453225              }
     
    33513231              PARCITEM pci = (PARCITEM)mp2;
    33523232
    3353               if(pci) {
     3233              if (pci) {
    33543234                WinSendMsg(hwnd,CM_SETRECORDEMPHASIS,MPFROMP(pci),
    33553235                           MPFROM2SHORT(TRUE,CRA_CURSORED));
     
    33593239              else {
    33603240                dcd->hwndLastMenu = CheckMenu(&ArcCnrMenu,ARCCNR_POPUP);
    3361                 if(dcd->hwndLastMenu && !dcd->cnremphasized) {
     3241                if (dcd->hwndLastMenu && !dcd->cnremphasized) {
    33623242                  WinSendMsg(hwnd,CM_SETRECORDEMPHASIS,MPVOID,
    33633243                             MPFROM2SHORT(TRUE,CRA_SOURCE));
     
    33653245                }
    33663246              }
    3367               if(dcd->hwndLastMenu) {
    3368                 if(dcd->hwndLastMenu == ArcCnrMenu) {
    3369                   if(dcd->flWindowAttr & CV_MINI)
     3247              if (dcd->hwndLastMenu) {
     3248                if (dcd->hwndLastMenu == ArcCnrMenu) {
     3249                  if (dcd->flWindowAttr & CV_MINI)
    33703250                    WinCheckMenuItem(dcd->hwndLastMenu,IDM_MINIICONS,TRUE);
    33713251                }
    33723252                WinCheckMenuItem(dcd->hwndLastMenu,IDM_FOLDERAFTEREXTRACT,
    33733253                                 fFolderAfterExtract);
    3374                 if(!PopupMenu(hwnd,hwnd,dcd->hwndLastMenu)) {
    3375                   if(dcd->cnremphasized) {
     3254                if (!PopupMenu(hwnd,hwnd,dcd->hwndLastMenu)) {
     3255                  if (dcd->cnremphasized) {
    33763256                    WinSendMsg(hwnd,CM_SETRECORDEMPHASIS,MPVOID,
    33773257                               MPFROM2SHORT(FALSE,CRA_SOURCE));
     
    33853265
    33863266          case CN_EMPHASIS:
    3387             if(mp2) {
     3267            if (mp2) {
    33883268
    33893269              PNOTIFYRECORDEMPHASIS pre = mp2;
     
    33923272
    33933273              pci = (PARCITEM)((pre) ? pre->pRecord : NULL);
    3394               if(!pci) {
    3395                 if(!ParentIsDesktop(hwnd,dcd->hwndParent)) {
    3396                   if(hwndStatus2)
     3274              if (!pci) {
     3275                if (!ParentIsDesktop(hwnd,dcd->hwndParent)) {
     3276                  if (hwndStatus2)
    33973277                    WinSetWindowText(hwndStatus2,NullStr);
    3398                   if(fMoreButtons)
     3278                  if (fMoreButtons)
    33993279                    WinSetWindowText(hwndName,NullStr);
    34003280                }
    34013281                break;
    34023282              }
    3403               if(pre->fEmphasisMask & CRA_SELECTED) {
    3404                 if(pci->rc.flRecordAttr & CRA_SELECTED) {
     3283              if (pre->fEmphasisMask & CRA_SELECTED) {
     3284                if (pci->rc.flRecordAttr & CRA_SELECTED) {
    34053285                  dcd->selectedbytes += pci->cbFile;
    34063286                  dcd->selectedfiles++;
    34073287                }
    3408                 else if(dcd->selectedfiles) {
     3288                else if (dcd->selectedfiles) {
    34093289                  dcd->selectedbytes -= pci->cbFile;
    34103290                  dcd->selectedfiles--;
     
    34213301                WinSetDlgItemText(dcd->hwndClient,DIR_SELECTED,s);
    34223302              }
    3423               else if(WinQueryActiveWindow(dcd->hwndParent) ==
    3424                       dcd->hwndFrame &&
    3425                       !ParentIsDesktop(hwnd,dcd->hwndParent)) {
    3426                 if(pre->fEmphasisMask & CRA_CURSORED) {
    3427                   if(pci->rc.flRecordAttr & CRA_CURSORED) {
    3428                     if(fSplitStatus && hwndStatus2) {
     3303              else if (WinQueryActiveWindow(dcd->hwndParent) ==
     3304                       dcd->hwndFrame &&
     3305                       !ParentIsDesktop(hwnd,dcd->hwndParent)) {
     3306                if (pre->fEmphasisMask & CRA_CURSORED) {
     3307                  if (pci->rc.flRecordAttr & CRA_CURSORED) {
     3308                    if (fSplitStatus && hwndStatus2) {
    34293309                      if (dcd->ullTotalBytes)
    34303310                        CommaFmtULL(tb,sizeof(tb),pci->cbFile,' ');
     
    34383318                      WinSetWindowText(hwndStatus2,s);
    34393319                    }
    3440                     if(fMoreButtons)
     3320                    if (fMoreButtons)
    34413321                      WinSetWindowText(hwndName,pci->szFileName);
    34423322                  }
     
    34473327
    34483328          case CN_ENTER:
    3449             if(mp2) {
     3329            if (mp2) {
    34503330
    34513331              PARCITEM pci = (PARCITEM)((PNOTIFYRECORDENTER)mp2)->pRecord;
    34523332
    3453               if(pci) {
     3333              if (pci) {
    34543334
    34553335                CHAR *s;
    34563336
    3457                 if((pci->rc.flRecordAttr & CRA_INUSE) ||
    3458                    (pci->flags & (ARCFLAGS_REALDIR | ARCFLAGS_PSEUDODIR)))
     3337                if ((pci->rc.flRecordAttr & CRA_INUSE) ||
     3338                    (pci->flags & (ARCFLAGS_REALDIR | ARCFLAGS_PSEUDODIR)))
    34593339                  break;
    34603340                s = xstrdup(pci->szFileName,pszSrcFile,__LINE__);
    34613341                if (s) {
    3462                   if(!PostMsg(dcd->hwndObject,UM_ENTER,
    3463                                  MPFROMP(s),MPVOID)) {
     3342                  if (!PostMsg(dcd->hwndObject,UM_ENTER,MPFROMP(s),MPVOID)) {
    34643343                    Runtime_Error(pszSrcFile, __LINE__, "post");
    34653344                    free(s);
     
    34743353
    34753354    case UM_FOLDUP:
    3476       if(!PostMsg((HWND)0,
    3477                   WM_QUIT,
    3478                   MPVOID,
    3479                   MPVOID))
     3355      if (!PostMsg((HWND)0,WM_QUIT,MPVOID,MPVOID))
    34803356        DosExit(EXIT_PROCESS,1);
    34813357      return 0;
     
    34873363
    34883364    case WM_SAVEAPPLICATION:
    3489       if(dcd &&
    3490          ParentIsDesktop(hwnd,dcd->hwndParent)) {
    3491 
     3365      if (dcd &&
     3366          ParentIsDesktop(hwnd,dcd->hwndParent)) {
    34923367        SWP swp;
    3493 
    34943368        WinQueryWindowPos(dcd->hwndFrame,&swp);
    3495         if(!(swp.fl & (SWP_HIDE | SWP_MINIMIZE | SWP_MAXIMIZE)))
     3369        if (!(swp.fl & (SWP_HIDE | SWP_MINIMIZE | SWP_MAXIMIZE)))
    34963370          PrfWriteProfileData(fmprof,
    34973371                              appname,
     
    35033377
    35043378    case WM_CLOSE:
    3505       WinSendMsg(hwnd,
    3506                  WM_SAVEAPPLICATION,
    3507                  MPVOID,
    3508                  MPVOID);
    3509       if(dcd)
     3379      WinSendMsg(hwnd,WM_SAVEAPPLICATION,MPVOID,MPVOID);
     3380      if (dcd)
    35103381        dcd->stopflag++;
    3511       if(dcd && dcd->hwndObject) {
    3512         if(!PostMsg(dcd->hwndObject,
    3513                     WM_CLOSE,
    3514                     MPVOID,
    3515                     MPVOID))
    3516           WinSendMsg(dcd->hwndObject,
    3517                      WM_CLOSE,
    3518                      MPVOID,
    3519                      MPVOID);
     3382      if (dcd && dcd->hwndObject) {
     3383        if (!PostMsg(dcd->hwndObject,WM_CLOSE,MPVOID,MPVOID))
     3384          WinSendMsg(dcd->hwndObject,WM_CLOSE,MPVOID,MPVOID);
    35203385      }
    35213386      dcd = WinQueryWindowPtr(hwnd,QWL_USER);
    3522       if(!dcd ||
    3523          (!dcd->dontclose &&
    3524           !dcd->amextracted &&
    3525           ParentIsDesktop(hwnd,dcd->hwndParent))) {
    3526         if(!PostMsg(hwnd,
    3527                     UM_FOLDUP,
    3528                     MPVOID,
    3529                     MPVOID))
    3530           WinSendMsg(hwnd,
    3531                      UM_FOLDUP,
    3532                      MPVOID,
    3533                      MPVOID);
     3387      if (!dcd ||
     3388          (!dcd->dontclose &&
     3389           !dcd->amextracted &&
     3390           ParentIsDesktop(hwnd,dcd->hwndParent))) {
     3391        if (!PostMsg(hwnd,UM_FOLDUP,MPVOID,MPVOID))
     3392          WinSendMsg(hwnd,UM_FOLDUP,MPVOID,MPVOID);
    35343393      }
    35353394      return 0;
    35363395
    35373396    case WM_DESTROY:
    3538       if(ArcMenu)
     3397      if (ArcMenu)
    35393398        WinDestroyWindow(ArcMenu);
    3540       if(ArcCnrMenu)
     3399      if (ArcCnrMenu)
    35413400        WinDestroyWindow(ArcCnrMenu);
    35423401      ArcMenu = ArcCnrMenu = (HWND)0;
     
    35693428  static USHORT idinc = 0;
    35703429
    3571   if(!idinc)
     3430  if (!idinc)
    35723431    idinc = (rand() % 256);
    3573   if(ParentIsDesktop(hwndParent,hwndParent))
     3432  if (ParentIsDesktop(hwndParent,hwndParent))
    35743433    FrameFlags |= (FCF_TASKLIST | FCF_MENU);
    3575   if(arcname) {
     3434  if (arcname) {
    35763435    DosError(FERR_DISABLEHARDERR);
    3577     if(DosQueryPathInfo(arcname,
    3578                         FIL_QUERYFULLNAME,
    3579                         fullname,
    3580                         sizeof(fullname)))
     3436    if (DosQueryPathInfo(arcname,
     3437                         FIL_QUERYFULLNAME,
     3438                         fullname,
     3439                         sizeof(fullname)))
    35813440      strcpy(fullname,arcname);
    35823441    p = fullname;
    35833442    while(*p) {
    3584       if(*p == '/')
     3443      if (*p == '/')
    35853444        *p = '\\';
    35863445      p++;
    35873446    }
    3588     if(!info)
     3447    if (!info)
    35893448      info = find_type(fullname,
    35903449                       arcsighead);
    3591     if(!info)
     3450    if (!info)
    35923451      return hwndFrame;
    35933452    hwndFrame = WinCreateStdWindow(hwndParent,
     
    36003459                                   ARC_FRAME,
    36013460                                   &hwndClient);
    3602     if(hwndFrame && hwndClient) {
     3461    if (hwndFrame && hwndClient) {
    36033462      id = ARC_FRAME + idinc++;
    3604       if(idinc > 512)
     3463      if (idinc > 512)
    36053464        idinc = 0;
    36063465      WinSetWindowUShort(hwndFrame,QWS_ID,id);
     
    36153474        dcd->type = ARC_FRAME;
    36163475        save_dir2(dcd->workdir);
    3617         if(dcd->workdir[strlen(dcd->workdir) - 1] != '\\')
     3476        if (dcd->workdir[strlen(dcd->workdir) - 1] != '\\')
    36183477          strcat(dcd->workdir,"\\");
    36193478        sprintf(dcd->workdir + strlen(dcd->workdir),"%s.%03x",
    36203479                ArcTempRoot,(clock() & 4095));
    36213480        strcpy(dcd->arcname,fullname);
    3622         if(*extractpath) {
    3623           if(!strcmp(extractpath,"*")) {
     3481        if (*extractpath) {
     3482          if (!strcmp(extractpath,"*")) {
    36243483            p = strrchr(fullname,'\\');
    3625             if(p) {
    3626               if(p < fullname + 3)
     3484            if (p) {
     3485              if (p < fullname + 3)
    36273486                p++;
    36283487              temp = *p;
     
    36353494            strcpy(dcd->directory,extractpath);
    36363495        }
    3637         if(!*dcd->directory &&
    3638            *lastextractpath) {
     3496        if (!*dcd->directory && *lastextractpath) {
    36393497          DosEnterCritSec();
    3640            strcpy(dcd->directory,lastextractpath);
     3498          strcpy(dcd->directory,lastextractpath);
    36413499          DosExitCritSec();
    36423500        }
    3643         if(!*dcd->directory) {
    3644           if(!ParentIsDesktop(hwndParent,hwndParent))
     3501        if (!*dcd->directory) {
     3502          if (!ParentIsDesktop(hwndParent,hwndParent))
    36453503            TopWindowName(hwndParent,
    36463504                          hwndCaller,
    36473505                          dcd->directory);
    3648           if(!*dcd->directory) {
     3506          if (!*dcd->directory) {
    36493507            p = strrchr(fullname,'\\');
    3650             if(p) {
    3651               if(p < fullname + 3)
     3508            if (p) {
     3509              if (p < fullname + 3)
    36523510                p++;
    36533511              *p = 0;
     
    36563514          }
    36573515        }
    3658         if(!*dcd->directory ||
    3659            IsFile(dcd->directory) ||
    3660            (isalpha(*dcd->directory) &&
    3661             (driveflags[toupper(*dcd->directory) - 'A'] & DRIVE_NOTWRITEABLE)))
     3516        if (!*dcd->directory ||
     3517            IsFile(dcd->directory) ||
     3518            (isalpha(*dcd->directory) &&
     3519             (driveflags[toupper(*dcd->directory) - 'A'] & DRIVE_NOTWRITEABLE)))
    36623520          save_dir2(dcd->directory);
    36633521        dcd->hwndParent = (hwndParent) ? hwndParent :
     
    37403598                     MPVOID);
    37413599          WinSetWindowText(dcd->hwndExtract,dcd->directory);
    3742           if(!PostMsg(dcd->hwndCnr,UM_SETUP,MPVOID,MPVOID))
     3600          if (!PostMsg(dcd->hwndCnr,UM_SETUP,MPVOID,MPVOID))
    37433601            WinSendMsg(dcd->hwndCnr,UM_SETUP,MPVOID,MPVOID);
    37443602          if (FrameFlags & FCF_MENU) {
     
    37463604              HWND hwndMenu = WinWindowFromID(hwndFrame,FID_MENU);
    37473605
    3748               if(hwndMenu) {
     3606              if (hwndMenu) {
    37493607                WinSendMsg(hwndMenu,MM_DELETEITEM,
    37503608                           MPFROM2SHORT(IDM_VIEW,FALSE),
     
    37843642
    37853643            WinQueryTaskSizePos(WinQueryAnchorBlock(hwndFrame),0,&swp);
    3786             if(PrfQueryProfileData(fmprof,
     3644            if (PrfQueryProfileData(fmprof,
    37873645                                   appname,
    37883646                                   "AV2SizePos",
     
    37913649              cxScreen = WinQuerySysValue(HWND_DESKTOP,SV_CXSCREEN);
    37923650              cyScreen = WinQuerySysValue(HWND_DESKTOP,SV_CYSCREEN);
    3793               if(swp.x + swpD.cx > cxScreen)
     3651              if (swp.x + swpD.cx > cxScreen)
    37943652                swp.x = cxScreen - swpD.cx;
    3795               if(swp.y + swpD.cy > cyScreen)
     3653              if (swp.y + swpD.cy > cyScreen)
    37963654                swp.y = cyScreen - swpD.cy;
    37973655              swp.cx = swpD.cx;
Note: See TracChangeset for help on using the changeset viewer.