Changeset 46


Ignore:
Timestamp:
Mar 13, 2001, 9:56:01 AM (24 years ago)
Author:
umoeller
Message:

Mistc. updates for WarpIN, new features.

Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/helpers/cnrh.h

    r41 r46  
    390390     *      --  CV_DETAIL: details view without column headers
    391391     *      --  CV_DETAIL | CA_DETAILSVIEWTITLES: details view _with_ column headers
     392     *
     393     *      <B>Mini icons:</B>
     394     *
     395     *      This is especially sick. The CV_MINI style in CNRINFO is only
     396     *      supported for "pure" icon view. For details and tree views,
     397     *      you must instead set the (half-documented) CCS_MINICONS style
     398     *      as a _window_ style on the container. Whoever came up with this.
    392399     *
    393400     *      <B>Target emphasis:</B>
     
    416423     *                          CA_TITLERIGHT).
    417424     *
    418      *      Note that CV_MINI is only supported for "pure" icon view.
    419      *
    420425     *@@added V0.9.0
    421426     */
  • trunk/include/helpers/dosh.h

    r43 r46  
    442442     *      linear executable (LX) header format,
    443443     *      which comes after the DOS header in the
    444      *      EXE file (at DOSEXEHEADER.usNewHeaderOfs).
     444     *      EXE file (at DOSEXEHEADER.ulNewHeaderOfs).
    445445     */
    446446
     
    483483     *      linear executable (LX) header format,
    484484     *      which comes after the DOS header in the
    485      *      EXE file (at DOSEXEHEADER.usNewHeaderOfs).
     485     *      EXE file (at DOSEXEHEADER.ulNewHeaderOfs).
    486486     */
    487487
     
    542542    #pragma pack()
    543543
     544    /*
     545     *@@ FSYSMODULE:
     546     *
     547     *@@added V0.9.9 (2001-03-11) [lafaix]
     548     */
     549
     550    typedef struct _FSYSMODULE
     551    {
     552        CHAR achModuleName[128];
     553    } FSYSMODULE, *PFSYSMODULE;
     554
     555    /*
     556     *@@ FSYSFUNCTION:
     557     *
     558     *@@added V0.9.9 (2001-03-11) [lafaix]
     559     */
     560
     561    typedef struct _FSYSFUNCTION
     562    {
     563        ULONG ulOrdinal;
     564        ULONG ulType;
     565        CHAR achFunctionName[128];
     566    } FSYSFUNCTION, *PFSYSFUNCTION;
     567
     568    /*
     569     *@@ FSYSRESOURCE:
     570     *
     571     *@@added V0.9.7 (2000-12-18) [lafaix]
     572     */
     573
     574    typedef struct _FSYSRESOURCE
     575    {
     576        ULONG ulID;                     // resource ID
     577        ULONG ulType;                   // resource type
     578        ULONG ulSize;                   // resource size in bytes
     579        ULONG ulFlag;                   // resource flags
     580    } FSYSRESOURCE, *PFSYSRESOURCE;
     581
     582    // object/segment flags (in NE and LX)
     583    #define OBJWRITE         0x0002L    // Writeable Object
     584    #define OBJDISCARD       0x0010L    // Object is Discardable
     585    #define OBJSHARED        0x0020L    // Object is Shared
     586    #define OBJPRELOAD       0x0040L    // Object has preload pages
     587
     588    // resource flags
     589    #define RNMOVE           0x0010     // Moveable resource
     590    #define RNPURE           0x0020     // Pure (read-only) resource
     591    #define RNPRELOAD        0x0040     // Preloaded resource
     592    #define RNDISCARD        0xF000     // Discard priority level for resource
     593
    544594    // EXE format
    545595    #define EXEFORMAT_OLDDOS        1
     
    622672
    623673    APIRET doshExecQueryBldLevel(PEXECUTABLE pExec);
     674
     675    PFSYSRESOURCE doshExecQueryResources(PEXECUTABLE pExec,
     676                                         PULONG pcResources);
     677
     678    APIRET doshExecFreeResources(PFSYSRESOURCE paResources);
     679
     680    PFSYSMODULE doshExecQueryImportedModules(PEXECUTABLE pExec,
     681                                             PULONG pcModules);
     682
     683    APIRET doshExecFreeImportedModules(PFSYSMODULE paModules);
     684
     685    PFSYSFUNCTION doshExecQueryExportedFunctions(PEXECUTABLE pExec,
     686                                                 PULONG pcFunctions);
     687
     688    APIRET doshExecFreeExportedFunctions(PFSYSFUNCTION paFunctions);
    624689
    625690    /********************************************************************
  • trunk/include/helpers/winh.h

    r45 r46  
    637637    typedef WINHFREE *PWINHFREE;
    638638
    639     VOID XWPENTRY winhSleep(HAB hab, ULONG ulSleep);
     639    VOID XWPENTRY winhSleep(ULONG ulSleep);
    640640
    641641    #define WINH_FOD_SAVEDLG        0x0001
  • trunk/src/helpers/cctl_splitwin.c

    r21 r46  
    246246/*
    247247 *@@ TrackSplitBar:
    248  *      implementation for WM_BUTTON1DOWN in ctl_fnwpSplitBar.
     248 *      implementation for WM_BUTTON1DOWN/WM_BUTTON2DOWN in ctl_fnwpSplitBar.
    249249 *
    250250 *@@added V0.9.1 (2000-02-05) [umoeller]
     
    487487 *@@added V0.9.0 [umoeller]
    488488 *@@changed V0.9.1 (99-12-07): fixed memory leak
     489 *@@changed V0.9.9 (2001-02-01) [lafaix]: added MB2 drag
    489490 */
    490491
     
    519520
    520521            case WM_BUTTON1DOWN:
     522            case WM_BUTTON2DOWN:
    521523                TrackSplitBar(hwndBar, pData);
    522524            break;
     
    705707                          PSPLITBARCDATA psbcd) // in: split window control data
    706708{
    707     HWND hwndSplit = NULLHANDLE,
    708          hwndBar = NULLHANDLE;
     709    HWND    hwndSplit = NULLHANDLE,
     710            hwndBar = NULLHANDLE;
     711    static  s_Registered = FALSE;
    709712
    710713    if (psbcd)
    711714    {
    712715        // register "split window" class
    713         WinRegisterClass(hab,
    714                          WC_SPLITWINDOW,
    715                          ctl_fnwpSplitWindow,
    716                          CS_SIZEREDRAW | CS_SYNCPAINT,
    717                          0);        // additional bytes to reserve
     716        if (!s_Registered)
     717        {
     718            WinRegisterClass(hab,
     719                             WC_SPLITWINDOW,
     720                             ctl_fnwpSplitWindow,
     721                             CS_SIZEREDRAW | CS_SYNCPAINT,
     722                             0);        // additional bytes to reserve
     723            s_Registered = TRUE;
     724        }
    718725
    719726        hwndSplit = WinCreateWindow(psbcd->hwndParentAndOwner,  // parent
  • trunk/src/helpers/cnrh.c

    r35 r46  
    774774 *
    775775 *      Invoking this function on a container in Tree view
    776  *      will result in not much but display flickering anyways.
     776 *      will result in not much but display flickering anyway.
    777777 *
    778778 *      This returns the number of records which were processed.
     
    968968 *
    969969 *@@changed V0.9.4 (2000-08-07) [umoeller]: now posting scroll messages to avoid sync errors
     970 *@@changed V0.9.9 (2001-03-12) [umoeller]: this never worked for root records in tree view if KeepParent == TRUE, fixed
    970971 */
    971972
     
    10011002
    10021003    // query record location and size of container
    1003     if (!WinSendMsg(hwndCnr, CM_QUERYRECORDRECT, &rclRecord, &qRect))
     1004    if (!WinSendMsg(hwndCnr,
     1005                    CM_QUERYRECORDRECT,
     1006                    &rclRecord,
     1007                    &qRect))
    10041008        return 1;
    1005     if (!WinSendMsg(hwndCnr, CM_QUERYVIEWPORTRECT, &rclCnr, MPFROM2SHORT(CMA_WINDOW, FALSE)) )
     1009
     1010    if (!WinSendMsg(hwndCnr,
     1011                    CM_QUERYVIEWPORTRECT,
     1012                    &rclCnr,
     1013                    MPFROM2SHORT(CMA_WINDOW, FALSE)) )
    10061014        return 2;
    10071015
     
    10161024    if (KeepParent)
    10171025    {
    1018         if (!WinSendMsg(hwndCnr, CM_QUERYCNRINFO, (MPARAM)&CnrInfo, (MPARAM)sizeof(CnrInfo)))
     1026        if (!WinSendMsg(hwndCnr,
     1027                        CM_QUERYCNRINFO,
     1028                        (MPARAM)&CnrInfo,
     1029                        (MPARAM)sizeof(CnrInfo)))
    10191030            return 4;
    10201031        else
     
    10361047                                                 MPFROM2SHORT(CMA_PARENT,
    10371048                                                              CMA_ITEMORDER));
    1038         qRect2.fsExtent = fsExtent;
    1039 
    1040         // now query PARENT record location and size of container
    1041         if (!WinSendMsg(hwndCnr, CM_QUERYRECORDRECT, &rclParentRecord, &qRect2))
    1042             return 5;
    1043 
    1044         ptlParentRecord.x = (rclParentRecord.xLeft);
    1045         ptlParentRecord.y = (rclParentRecord.yTop);
    1046         // ptlParentRecord.x = (rclParentRecord.xLeft + rclParentRecord.xRight) / 2;
    1047         // ptlParentRecord.y = (rclParentRecord.yBottom + rclParentRecord.yTop) / 2;
    1048         rclCnr2 = rclCnr;
    1049         WinOffsetRect(hab, &rclCnr2, 0, -lYOfs);
    1050         // if ( (rclParentRecord.yBottom - rclRecord.yBottom) > (rclCnr.yTop - rclCnr.yBottom) )
    1051         if (!(WinPtInRect(hab, &rclCnr2, &ptlParentRecord)))
     1049        if (qRect2.pRecord)     // V0.9.9 (2001-03-12) [umoeller]
    10521050        {
    1053             lYOfs = (rclCnr.yTop - rclParentRecord.yTop) // this would suffice
    1054                   - (rclRecord.yTop - rclRecord.yBottom);  // but we make the previous rcl visible too
     1051            qRect2.fsExtent = fsExtent;
     1052
     1053            // now query PARENT record location and size of container
     1054            if (!WinSendMsg(hwndCnr, CM_QUERYRECORDRECT, &rclParentRecord, &qRect2))
     1055                return 5;
     1056
     1057            ptlParentRecord.x = (rclParentRecord.xLeft);
     1058            ptlParentRecord.y = (rclParentRecord.yTop);
     1059            // ptlParentRecord.x = (rclParentRecord.xLeft + rclParentRecord.xRight) / 2;
     1060            // ptlParentRecord.y = (rclParentRecord.yBottom + rclParentRecord.yTop) / 2;
     1061            rclCnr2 = rclCnr;
     1062            WinOffsetRect(hab, &rclCnr2, 0, -lYOfs);
     1063            // if ( (rclParentRecord.yBottom - rclRecord.yBottom) > (rclCnr.yTop - rclCnr.yBottom) )
     1064            if (!(WinPtInRect(hab, &rclCnr2, &ptlParentRecord)))
     1065            {
     1066                lYOfs = (rclCnr.yTop - rclParentRecord.yTop) // this would suffice
     1067                      - (rclRecord.yTop - rclRecord.yBottom);  // but we make the previous rcl visible too
     1068            }
    10551069        }
    10561070    }
  • trunk/src/helpers/dosh.c

    r45 r46  
    6969#pragma hdrstop
    7070
    71 const CHAR  G_acDriveLetters[28] = " ABCDEFGHIJKLMNOPQRSTUVWXYZ";
     71static const CHAR  G_acDriveLetters[28] = " ABCDEFGHIJKLMNOPQRSTUVWXYZ";
    7272
    7373/*
  • trunk/src/helpers/dosh2.c

    r21 r46  
    792792 *@@added V0.9.0 [umoeller]
    793793 *@@changed V0.9.1 (2000-02-13) [umoeller]: fixed 32-bits flag
     794 *@@changed V0.9.7 (2000-12-20) [lafaix]: fixed ulNewHeaderOfs
    794795 */
    795796
     
    11951196
    11961197    return (arc);
     1198}
     1199
     1200/*
     1201 *@@ doshExecQueryImportedModules:
     1202 *      returns an array of FSYSMODULE structure describing all
     1203 *      imported modules.
     1204 *
     1205 *      *pcModules receives the # of items in the array (not the
     1206 *      array size!).  Use doshFreeImportedModules to clean up.
     1207 *
     1208 *@@added V0.9.9 (2001-03-11) [lafaix]
     1209 */
     1210
     1211PFSYSMODULE doshExecQueryImportedModules(PEXECUTABLE pExec,
     1212                                         PULONG pcModules)
     1213{
     1214    return (NULL);
     1215}
     1216
     1217/*
     1218 *@@ doshExecFreeImportedModules:
     1219 *      frees resources allocated by doshExecQueryImportedModules.
     1220 *
     1221 *@@added V0.9.9 (2001-03-11)
     1222 */
     1223
     1224APIRET doshExecFreeImportedModules(PFSYSMODULE paModules)
     1225{
     1226    free(paModules);
     1227    return (NO_ERROR);
     1228}
     1229
     1230/*
     1231 *@@ doshExecQueryExportedFunctions:
     1232 *      returns an array of FSYSFUNCTION structure describing all
     1233 *      exported functions.
     1234 *
     1235 *      *pcFunctions receives the # of items in the array (not the
     1236 *      array size!).  Use doshFreeExportedFunctions to clean up.
     1237 *
     1238 *      Note that the returned array only contains entry for exported
     1239 *      functions.  Empty export entries are _not_ included.
     1240 *
     1241 *@@added V0.9.9 (2001-03-11) [lafaix]
     1242 */
     1243
     1244PFSYSFUNCTION doshExecQueryExportedFunctions(PEXECUTABLE pExec,
     1245                                             PULONG pcFunctions)
     1246{
     1247    return (NULL);
     1248}
     1249
     1250/*
     1251 *@@ doshExecFreeExportedFunctions:
     1252 *      frees resources allocated by doshExecQueryExportedFunctions.
     1253 *
     1254 *@@added V0.9.9 (2001-03-11)
     1255 */
     1256
     1257APIRET doshExecFreeExportedFunctions(PFSYSFUNCTION paFunctions)
     1258{
     1259    free(paFunctions);
     1260    return (NO_ERROR);
     1261}
     1262
     1263/*
     1264 *@@ doshExecQueryResources:
     1265 *      returns an array of FSYSRESOURCE structures describing all
     1266 *      available resources in the module.
     1267 *
     1268 *      *pcResources receives the no. of items in the array
     1269 *      (not the array size!). Use doshExecFreeResources to clean up.
     1270 *
     1271 *@@added V0.9.7 (2000-12-18) [lafaix]
     1272 */
     1273
     1274PFSYSRESOURCE doshExecQueryResources(PEXECUTABLE pExec, PULONG pcResources)
     1275{
     1276    ULONG         cResources = 0;
     1277    PFSYSRESOURCE paResources = NULL;
     1278    int i;
     1279
     1280    if (pExec)
     1281    {
     1282        if (pExec->ulOS == EXEOS_OS2)
     1283        {
     1284            ULONG ulDummy;
     1285
     1286            if (pExec->ulExeFormat == EXEFORMAT_LX)
     1287            {
     1288                // It's a 32bit OS/2 executable
     1289                cResources = pExec->pLXHeader->ulResTblCnt;
     1290
     1291                if (cResources)
     1292                {
     1293                    struct rsrc32               /* Resource Table Entry */
     1294                    {
     1295                        unsigned short  type;   /* Resource type */
     1296                        unsigned short  name;   /* Resource name */
     1297                        unsigned long   cb;     /* Resource size */
     1298                        unsigned short  obj;    /* Object number */
     1299                        unsigned long   offset; /* Offset within object */
     1300                    } rs;
     1301
     1302                    struct o32_obj                    /* Flat .EXE object table entry */
     1303                    {
     1304                        unsigned long   o32_size;     /* Object virtual size */
     1305                        unsigned long   o32_base;     /* Object base virtual address */
     1306                        unsigned long   o32_flags;    /* Attribute flags */
     1307                        unsigned long   o32_pagemap;  /* Object page map index */
     1308                        unsigned long   o32_mapsize;  /* Number of entries in object page map */
     1309                        unsigned long   o32_reserved; /* Reserved */
     1310                    } ot;
     1311
     1312                    paResources = (PFSYSRESOURCE)malloc(sizeof(FSYSRESOURCE) * cResources);
     1313
     1314                    DosSetFilePtr(pExec->hfExe,
     1315                                  pExec->pLXHeader->ulResTblOfs
     1316                                    + pExec->pDosExeHeader->ulNewHeaderOfs,
     1317                                  FILE_BEGIN,
     1318                                  &ulDummy);
     1319
     1320                    for (i = 0; i < cResources; i++)
     1321                    {
     1322                        DosRead(pExec->hfExe, &rs, 14, &ulDummy);
     1323                        paResources[i].ulID = rs.name;
     1324                        paResources[i].ulType = rs.type;
     1325                        paResources[i].ulSize = rs.cb;
     1326                        paResources[i].ulFlag = rs.obj; // Temp storage for Object
     1327                                                        // number.  Will be filled
     1328                                                        // with resource flag
     1329                                                        // later.
     1330                    }
     1331
     1332                    for (i = 0; i < cResources; i++)
     1333                    {
     1334                        DosSetFilePtr(pExec->hfExe,
     1335                                      pExec->pLXHeader->ulObjTblOfs
     1336                                        + pExec->pDosExeHeader->ulNewHeaderOfs
     1337                                        + (   sizeof(ot)
     1338                                            * (paResources[i].ulFlag - 1)),
     1339                                      FILE_BEGIN,
     1340                                      &ulDummy);
     1341                        DosRead(pExec->hfExe, &ot, sizeof(ot), &ulDummy);
     1342
     1343                        paResources[i].ulFlag  = (ot.o32_flags & OBJWRITE) ? 0 : RNPURE;
     1344                        paResources[i].ulFlag |= (ot.o32_flags & OBJDISCARD) ? 4096 : 0;
     1345                        paResources[i].ulFlag |= (ot.o32_flags & OBJSHARED) ? RNMOVE : 0;
     1346                        paResources[i].ulFlag |= (ot.o32_flags & OBJPRELOAD) ? RNPRELOAD : 0;
     1347                    }
     1348                }
     1349            }
     1350            else
     1351            if (pExec->ulExeFormat == EXEFORMAT_NE)
     1352            {
     1353               // It's a 16bit OS/2 executable
     1354               cResources = pExec->pNEHeader->usResSegmCount;
     1355
     1356               if (cResources)
     1357               {
     1358                   struct {unsigned short type; unsigned short name;} rti;
     1359                   struct new_seg                          /* New .EXE segment table entry */
     1360                   {
     1361                       unsigned short      ns_sector;      /* File sector of start of segment */
     1362                       unsigned short      ns_cbseg;       /* Number of bytes in file */
     1363                       unsigned short      ns_flags;       /* Attribute flags */
     1364                       unsigned short      ns_minalloc;    /* Minimum allocation in bytes */
     1365                   } ns;
     1366
     1367                   paResources = (PFSYSRESOURCE)malloc(sizeof(FSYSRESOURCE) * cResources);
     1368
     1369                   // We first read the resources IDs and types
     1370                   DosSetFilePtr(pExec->hfExe,
     1371                                 pExec->pNEHeader->usResTblOfs
     1372                                    + pExec->pDosExeHeader->ulNewHeaderOfs,
     1373                                 FILE_BEGIN,
     1374                                 &ulDummy);
     1375
     1376                   for (i = 0; i < cResources; i++)
     1377                   {
     1378                       DosRead(pExec->hfExe, &rti, sizeof(rti), &ulDummy);
     1379                       paResources[i].ulID = rti.name;
     1380                       paResources[i].ulType = rti.type;
     1381                   }
     1382
     1383                   // And we then read their sizes and flags
     1384                   for (i = 0; i < cResources; i++)
     1385                   {
     1386                       DosSetFilePtr(pExec->hfExe,
     1387                                     pExec->pDosExeHeader->ulNewHeaderOfs
     1388                                            + pExec->pNEHeader->usSegTblOfs
     1389                                            + (sizeof(ns)
     1390                                                * (  pExec->pNEHeader->usSegTblEntries
     1391                                                   - pExec->pNEHeader->usResSegmCount
     1392                                                   + i)),
     1393                                     FILE_BEGIN,
     1394                                     &ulDummy);
     1395                       DosRead(pExec->hfExe, &ns, sizeof(ns), &ulDummy);
     1396
     1397                       paResources[i].ulSize = ns.ns_cbseg;
     1398
     1399                       paResources[i].ulFlag  = (ns.ns_flags & OBJPRELOAD) ? RNPRELOAD : 0;
     1400                       paResources[i].ulFlag |= (ns.ns_flags & OBJSHARED) ? RNPURE : 0;
     1401                       paResources[i].ulFlag |= (ns.ns_flags & OBJDISCARD) ? RNMOVE : 0;
     1402                       paResources[i].ulFlag |= (ns.ns_flags & OBJDISCARD) ? 4096 : 0;
     1403                   }
     1404               }
     1405            }
     1406
     1407            *pcResources = cResources;
     1408        }
     1409    }
     1410
     1411    return (paResources);
     1412}
     1413
     1414/*
     1415 *@@ doshExecFreeResources:
     1416 *      frees resources allocated by doshExecQueryResources.
     1417 *
     1418 *@@added V0.9.7 (2000-12-18) [lafaix]
     1419 */
     1420
     1421APIRET doshExecFreeResources(PFSYSRESOURCE paResources)
     1422{
     1423    free(paResources);
     1424    return (NO_ERROR);
    11971425}
    11981426
  • trunk/src/helpers/gpih.c

    r38 r46  
    13801380                aptl[2].y = prcl->yBottom;
    13811381
    1382                 if (GpiBitBlt(hpsMem, hpsScreen,
     1382                if (GpiBitBlt(hpsMem,
     1383                              hpsScreen,
    13831384                              sizeof(aptl) / sizeof(POINTL), // Number of points in aptl
    13841385                              aptl,
  • trunk/src/helpers/winh.c

    r45 r46  
    5252#define INCL_WINRECTANGLES
    5353#define INCL_WINSHELLDATA
     54#define INCL_WINTIMER
    5455#define INCL_WINSYS
    5556#define INCL_WINHELP
     
    332333                    {
    333334                        // now copy all the items in the submenu
    334                         SHORT cMenuItems = (SHORT)WinSendMsg(mi.hwndSubMenu,
     335                        SHORT cMenuItems = SHORT1FROMMR(WinSendMsg(mi.hwndSubMenu,
    335336                                                             MM_QUERYITEMCOUNT,
    336                                                              0, 0);
     337                                                             0, 0));
    337338                        // loop through all entries in the original submenu
    338339                        ULONG i;
     
    342343                        {
    343344                            CHAR szItemText[100];
    344                             SHORT id = (SHORT)WinSendMsg(mi.hwndSubMenu,
     345                            SHORT id = SHORT1FROMMR(WinSendMsg(mi.hwndSubMenu,
    345346                                                         MM_ITEMIDFROMPOSITION,
    346347                                                         MPFROMSHORT(i),
    347                                                          0);
     348                                                         0));
    348349                            // recurse
    349350                            winhCopyMenuItem(hwndSubMenu,
     
    361362                        {
    362363                            // get the original default item
    363                             SHORT sDefID = (SHORT)WinSendMsg(mi.hwndSubMenu,
     364                            SHORT sDefID = SHORT1FROMMR(WinSendMsg(mi.hwndSubMenu,
    364365                                                             MM_QUERYDEFAULTITEMID,
    365                                                              0, 0);
     366                                                             0, 0));
    366367                            // set "conditional cascade style" on target too
    367368                            WinSetWindowBits(hwndSubMenu,
     
    383384                    SHORT s;
    384385                    mi.iPosition = sTargetPosition;
    385                     s = (SHORT)WinSendMsg(hmenuTarget,
     386                    s = SHORT1FROMMR(WinSendMsg(hmenuTarget,
    386387                                          MM_INSERTITEM,
    387388                                          MPFROMP(&mi),
    388                                           MPFROMP(pszSource));
     389                                          MPFROMP(pszSource)));
    389390                    if (s != MIT_MEMERROR && s != MIT_ERROR)
    390391                        brc = TRUE;
     
    447448        {
    448449            int i;
    449             SHORT cMenuItems = (SHORT)WinSendMsg(hmenuSource,
     450            SHORT cMenuItems = SHORT1FROMMR(WinSendMsg(hmenuSource,
    450451                                                 MM_QUERYITEMCOUNT,
    451                                                  0, 0);
     452                                                 0, 0));
    452453
    453454            // loop through all entries in the original menu
    454455            for (i = 0; i < cMenuItems; i++)
    455456            {
    456                 SHORT id = (SHORT)WinSendMsg(hmenuSource,
     457                SHORT id = SHORT1FROMMR(WinSendMsg(hmenuSource,
    457458                                             MM_ITEMIDFROMPOSITION,
    458459                                             MPFROMSHORT(i),
    459                                              0);
     460                                             0));
    460461                winhCopyMenuItem(hwndNewSubmenu,
    461462                                 hmenuSource,
     
    481482 *      not found.
    482483 *
    483  *      Returns NULL on error. Use winhFree()
     484 *      Returns NULL on error. Use free()
    484485 *      to free the return value.
    485486 *
     
    11711172 *      buffer.
    11721173 *
    1173  *      Returns NULL on error. Use winhFree()
     1174 *      Returns NULL on error. Use fre()
    11741175 *      to free the return value.
    11751176 *
     
    16501651 *      -- "End": scroll rightmost.
    16511652 *      -- "Ctrl+ End": scroll bottommost.
    1652  *      -- "Ctrl + page up, down": scroll topmost or bottommost.
    1653  *
    1654  *      This is roughly CUA behavior.
     1653 *      -- "Ctrl + page up, down": scroll one screen left or right.
     1654 *
     1655 *      This is CUA behavior.
    16551656 *
    16561657 *      Returns TRUE if the message has been
     
    16581659 *
    16591660 *@@added V0.9.3 (2000-04-29) [umoeller]
     1661 *@@changed V0.9.9 (2001-02-01) [lafaix]: Ctrl+PgUp/Dn now do one screen left/right
    16601662 */
    16611663
     
    17051707
    17061708            case VK_PAGEUP:
    1707                 ulMsg = WM_VSCROLL;
    17081709                if (usFlags & KC_CTRL)
    1709                 {
    1710                     sPos = 0;
    1711                     usCmd = SB_SLIDERPOSITION;
    1712                 }
     1710                    ulMsg = WM_HSCROLL;
     1711                 else
     1712                    ulMsg = WM_VSCROLL;
     1713                usCmd = SB_PAGEUP;
     1714            break;
     1715
     1716            case VK_PAGEDOWN:
     1717                if (usFlags & KC_CTRL)
     1718                    ulMsg = WM_HSCROLL;
    17131719                else
    1714                     usCmd = SB_PAGEUP;
    1715             break;
    1716 
    1717             case VK_PAGEDOWN:
    1718                 ulMsg = WM_VSCROLL;
    1719                 if (usFlags & KC_CTRL)
    1720                 {
    1721                     sPos = ulVertMax;
    1722                     usCmd = SB_SLIDERPOSITION;
    1723                 }
    1724                 else
    1725                     usCmd = SB_PAGEDOWN;
     1720                    ulMsg = WM_VSCROLL;
     1721                usCmd = SB_PAGEDOWN;
    17261722            break;
    17271723
     
    22552251 *      in a newly allocated buffer.
    22562252 *
    2257  *      Returns NULL on error. Use winhFree()
     2253 *      Returns NULL on error. Use free()
    22582254 *      to free the return value.
    22592255 *
     
    32533249 *      without blocking the message queue.
    32543250 *
     3251 *      NOTE: This function is a bit expensive because
     3252 *      it creates a temporary object window. If you
     3253 *      need to sleep several times, you should rather
     3254 *      use a private timer.
     3255 *
    32553256 *@@added V0.9.4 (2000-07-11) [umoeller]
    3256  */
    3257 
    3258 VOID winhSleep(HAB hab,
    3259                ULONG ulSleep)    // in: sleep time in milliseconds
    3260 {
    3261     ULONG ul = 0;
    3262     QMSG qmsg;
    3263     for (ul = 0;
    3264          ul < (ulSleep / 50);
    3265          ul++)
    3266     {
    3267         DosSleep(50);
    3268         while (WinPeekMsg(hab,
    3269                           &qmsg, 0, 0, 0,
    3270                           PM_REMOVE))
    3271             WinDispatchMsg(hab, &qmsg);
    3272 
    3273     }
     3257 *@@changed V0.9.9 (2001-03-11) [umoeller]: rewritten
     3258 */
     3259
     3260VOID winhSleep(ULONG ulSleep)    // in: sleep time in milliseconds
     3261{
     3262    HWND hwnd = winhCreateObjectWindow(WC_STATIC, NULL);
     3263    if (hwnd)
     3264    {
     3265        QMSG qmsg;
     3266        HAB hab = WinQueryAnchorBlock(hwnd);
     3267        if (WinStartTimer(hab,
     3268                          hwnd,
     3269                          1,
     3270                          ulSleep))
     3271        {
     3272            while (WinGetMsg(hab, &qmsg, NULLHANDLE, 0, 0))
     3273            {
     3274                if (    (qmsg.hwnd == hwnd)
     3275                     && (qmsg.msg == WM_TIMER)
     3276                     && (qmsg.mp1 == (MPARAM)1)     // timer ID
     3277                   )
     3278                    break;
     3279
     3280                WinDispatchMsg(hab, &qmsg);
     3281            }
     3282            WinStopTimer(hab,
     3283                         hwnd,
     3284                         1);
     3285        }
     3286        else
     3287            // timer creation failed:
     3288            DosSleep(ulSleep);
     3289
     3290        WinDestroyWindow(hwnd);
     3291    }
     3292    else
     3293        DosSleep(ulSleep);
    32743294}
    32753295
     
    34153435 *      HWND in a newly allocated buffer.
    34163436 *
    3417  *      Returns NULL on error. Use winhFree()
     3437 *      Returns NULL on error. Use free()
    34183438 *      to free the return value.
    34193439 */
     
    35323552 *      positioned automatically, using a given
    35333553 *      SWP structure (*pswpFrame).
     3554 *
     3555 *      The frame is created with the specified parent
     3556 *      (usually HWND_DESKTOP), but no owner.
    35343557 *
    35353558 *      The client window is created with the frame as
     
    40524075 *
    40534076 *      Returns NULL on errors. Use
    4054  *      winhFree to free the return value.
     4077 *      free() to free the return value.
    40554078 *
    40564079 *@@added V0.9.7 (2000-12-06) [umoeller]
     
    42854308 *      See WinEnumObjectClasses() for details.
    42864309 *
    4287  *      Returns NULL on error. Use winhFree()
     4310 *      Returns NULL on error. Use free()
    42884311 *      to free the return value.
    42894312 *
Note: See TracChangeset for help on using the changeset viewer.