Changeset 46 for trunk/src/helpers/winh.c
- Timestamp:
- Mar 13, 2001, 9:56:01 AM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.