Changeset 46
- Timestamp:
- Mar 13, 2001, 9:56:01 AM (24 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/helpers/cnrh.h
r41 r46 390 390 * -- CV_DETAIL: details view without column headers 391 391 * -- 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. 392 399 * 393 400 * <B>Target emphasis:</B> … … 416 423 * CA_TITLERIGHT). 417 424 * 418 * Note that CV_MINI is only supported for "pure" icon view.419 *420 425 *@@added V0.9.0 421 426 */ -
trunk/include/helpers/dosh.h
r43 r46 442 442 * linear executable (LX) header format, 443 443 * which comes after the DOS header in the 444 * EXE file (at DOSEXEHEADER.u sNewHeaderOfs).444 * EXE file (at DOSEXEHEADER.ulNewHeaderOfs). 445 445 */ 446 446 … … 483 483 * linear executable (LX) header format, 484 484 * which comes after the DOS header in the 485 * EXE file (at DOSEXEHEADER.u sNewHeaderOfs).485 * EXE file (at DOSEXEHEADER.ulNewHeaderOfs). 486 486 */ 487 487 … … 542 542 #pragma pack() 543 543 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 544 594 // EXE format 545 595 #define EXEFORMAT_OLDDOS 1 … … 622 672 623 673 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); 624 689 625 690 /******************************************************************** -
trunk/include/helpers/winh.h
r45 r46 637 637 typedef WINHFREE *PWINHFREE; 638 638 639 VOID XWPENTRY winhSleep( HAB hab,ULONG ulSleep);639 VOID XWPENTRY winhSleep(ULONG ulSleep); 640 640 641 641 #define WINH_FOD_SAVEDLG 0x0001 -
trunk/src/helpers/cctl_splitwin.c
r21 r46 246 246 /* 247 247 *@@ TrackSplitBar: 248 * implementation for WM_BUTTON1DOWN in ctl_fnwpSplitBar.248 * implementation for WM_BUTTON1DOWN/WM_BUTTON2DOWN in ctl_fnwpSplitBar. 249 249 * 250 250 *@@added V0.9.1 (2000-02-05) [umoeller] … … 487 487 *@@added V0.9.0 [umoeller] 488 488 *@@changed V0.9.1 (99-12-07): fixed memory leak 489 *@@changed V0.9.9 (2001-02-01) [lafaix]: added MB2 drag 489 490 */ 490 491 … … 519 520 520 521 case WM_BUTTON1DOWN: 522 case WM_BUTTON2DOWN: 521 523 TrackSplitBar(hwndBar, pData); 522 524 break; … … 705 707 PSPLITBARCDATA psbcd) // in: split window control data 706 708 { 707 HWND hwndSplit = NULLHANDLE, 708 hwndBar = NULLHANDLE; 709 HWND hwndSplit = NULLHANDLE, 710 hwndBar = NULLHANDLE; 711 static s_Registered = FALSE; 709 712 710 713 if (psbcd) 711 714 { 712 715 // 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 } 718 725 719 726 hwndSplit = WinCreateWindow(psbcd->hwndParentAndOwner, // parent -
trunk/src/helpers/cnrh.c
r35 r46 774 774 * 775 775 * Invoking this function on a container in Tree view 776 * will result in not much but display flickering anyway s.776 * will result in not much but display flickering anyway. 777 777 * 778 778 * This returns the number of records which were processed. … … 968 968 * 969 969 *@@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 970 971 */ 971 972 … … 1001 1002 1002 1003 // 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)) 1004 1008 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)) ) 1006 1014 return 2; 1007 1015 … … 1016 1024 if (KeepParent) 1017 1025 { 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))) 1019 1030 return 4; 1020 1031 else … … 1036 1047 MPFROM2SHORT(CMA_PARENT, 1037 1048 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] 1052 1050 { 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 } 1055 1069 } 1056 1070 } -
trunk/src/helpers/dosh.c
r45 r46 69 69 #pragma hdrstop 70 70 71 const CHAR G_acDriveLetters[28] = " ABCDEFGHIJKLMNOPQRSTUVWXYZ";71 static const CHAR G_acDriveLetters[28] = " ABCDEFGHIJKLMNOPQRSTUVWXYZ"; 72 72 73 73 /* -
trunk/src/helpers/dosh2.c
r21 r46 792 792 *@@added V0.9.0 [umoeller] 793 793 *@@changed V0.9.1 (2000-02-13) [umoeller]: fixed 32-bits flag 794 *@@changed V0.9.7 (2000-12-20) [lafaix]: fixed ulNewHeaderOfs 794 795 */ 795 796 … … 1195 1196 1196 1197 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 1211 PFSYSMODULE 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 1224 APIRET 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 1244 PFSYSFUNCTION 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 1257 APIRET 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 1274 PFSYSRESOURCE 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 1421 APIRET doshExecFreeResources(PFSYSRESOURCE paResources) 1422 { 1423 free(paResources); 1424 return (NO_ERROR); 1197 1425 } 1198 1426 -
trunk/src/helpers/gpih.c
r38 r46 1380 1380 aptl[2].y = prcl->yBottom; 1381 1381 1382 if (GpiBitBlt(hpsMem, hpsScreen, 1382 if (GpiBitBlt(hpsMem, 1383 hpsScreen, 1383 1384 sizeof(aptl) / sizeof(POINTL), // Number of points in aptl 1384 1385 aptl, -
trunk/src/helpers/winh.c
r45 r46 52 52 #define INCL_WINRECTANGLES 53 53 #define INCL_WINSHELLDATA 54 #define INCL_WINTIMER 54 55 #define INCL_WINSYS 55 56 #define INCL_WINHELP … … 332 333 { 333 334 // now copy all the items in the submenu 334 SHORT cMenuItems = (SHORT)WinSendMsg(mi.hwndSubMenu,335 SHORT cMenuItems = SHORT1FROMMR(WinSendMsg(mi.hwndSubMenu, 335 336 MM_QUERYITEMCOUNT, 336 0, 0) ;337 0, 0)); 337 338 // loop through all entries in the original submenu 338 339 ULONG i; … … 342 343 { 343 344 CHAR szItemText[100]; 344 SHORT id = (SHORT)WinSendMsg(mi.hwndSubMenu,345 SHORT id = SHORT1FROMMR(WinSendMsg(mi.hwndSubMenu, 345 346 MM_ITEMIDFROMPOSITION, 346 347 MPFROMSHORT(i), 347 0) ;348 0)); 348 349 // recurse 349 350 winhCopyMenuItem(hwndSubMenu, … … 361 362 { 362 363 // get the original default item 363 SHORT sDefID = (SHORT)WinSendMsg(mi.hwndSubMenu,364 SHORT sDefID = SHORT1FROMMR(WinSendMsg(mi.hwndSubMenu, 364 365 MM_QUERYDEFAULTITEMID, 365 0, 0) ;366 0, 0)); 366 367 // set "conditional cascade style" on target too 367 368 WinSetWindowBits(hwndSubMenu, … … 383 384 SHORT s; 384 385 mi.iPosition = sTargetPosition; 385 s = (SHORT)WinSendMsg(hmenuTarget,386 s = SHORT1FROMMR(WinSendMsg(hmenuTarget, 386 387 MM_INSERTITEM, 387 388 MPFROMP(&mi), 388 MPFROMP(pszSource)) ;389 MPFROMP(pszSource))); 389 390 if (s != MIT_MEMERROR && s != MIT_ERROR) 390 391 brc = TRUE; … … 447 448 { 448 449 int i; 449 SHORT cMenuItems = (SHORT)WinSendMsg(hmenuSource,450 SHORT cMenuItems = SHORT1FROMMR(WinSendMsg(hmenuSource, 450 451 MM_QUERYITEMCOUNT, 451 0, 0) ;452 0, 0)); 452 453 453 454 // loop through all entries in the original menu 454 455 for (i = 0; i < cMenuItems; i++) 455 456 { 456 SHORT id = (SHORT)WinSendMsg(hmenuSource,457 SHORT id = SHORT1FROMMR(WinSendMsg(hmenuSource, 457 458 MM_ITEMIDFROMPOSITION, 458 459 MPFROMSHORT(i), 459 0) ;460 0)); 460 461 winhCopyMenuItem(hwndNewSubmenu, 461 462 hmenuSource, … … 481 482 * not found. 482 483 * 483 * Returns NULL on error. Use winhFree()484 * Returns NULL on error. Use free() 484 485 * to free the return value. 485 486 * … … 1171 1172 * buffer. 1172 1173 * 1173 * Returns NULL on error. Use winhFree()1174 * Returns NULL on error. Use fre() 1174 1175 * to free the return value. 1175 1176 * … … 1650 1651 * -- "End": scroll rightmost. 1651 1652 * -- "Ctrl+ End": scroll bottommost. 1652 * -- "Ctrl + page up, down": scroll topmost or bottommost.1653 * 1654 * This is roughlyCUA behavior.1653 * -- "Ctrl + page up, down": scroll one screen left or right. 1654 * 1655 * This is CUA behavior. 1655 1656 * 1656 1657 * Returns TRUE if the message has been … … 1658 1659 * 1659 1660 *@@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 1660 1662 */ 1661 1663 … … 1705 1707 1706 1708 case VK_PAGEUP: 1707 ulMsg = WM_VSCROLL;1708 1709 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; 1713 1719 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; 1726 1722 break; 1727 1723 … … 2255 2251 * in a newly allocated buffer. 2256 2252 * 2257 * Returns NULL on error. Use winhFree()2253 * Returns NULL on error. Use free() 2258 2254 * to free the return value. 2259 2255 * … … 3253 3249 * without blocking the message queue. 3254 3250 * 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 * 3255 3256 *@@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 3260 VOID 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); 3274 3294 } 3275 3295 … … 3415 3435 * HWND in a newly allocated buffer. 3416 3436 * 3417 * Returns NULL on error. Use winhFree()3437 * Returns NULL on error. Use free() 3418 3438 * to free the return value. 3419 3439 */ … … 3532 3552 * positioned automatically, using a given 3533 3553 * SWP structure (*pswpFrame). 3554 * 3555 * The frame is created with the specified parent 3556 * (usually HWND_DESKTOP), but no owner. 3534 3557 * 3535 3558 * The client window is created with the frame as … … 4052 4075 * 4053 4076 * Returns NULL on errors. Use 4054 * winhFreeto free the return value.4077 * free() to free the return value. 4055 4078 * 4056 4079 *@@added V0.9.7 (2000-12-06) [umoeller] … … 4285 4308 * See WinEnumObjectClasses() for details. 4286 4309 * 4287 * Returns NULL on error. Use winhFree()4310 * Returns NULL on error. Use free() 4288 4311 * to free the return value. 4289 4312 *
Note:
See TracChangeset
for help on using the changeset viewer.