Ignore:
Timestamp:
Aug 5, 2002, 8:57:15 PM (23 years ago)
Author:
umoeller
Message:

Misc fixes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/helpers/winh.c

    r169 r195  
    28882888
    28892889/*
    2890  *@@ winhQueryPresColor:
     2890 *@@ winhQueryPresColor2:
    28912891 *      returns the specified color. This is queried in the
    28922892 *      following order:
     
    29662966 *@@changed V0.9.0 [umoeller]: added fInherit parameter
    29672967 *@@changed V0.9.7 (2000-12-02) [umoeller]: added lSysColor == -1 support
    2968  */
    2969 
    2970 LONG winhQueryPresColor(HWND    hwnd,       // in: window to query
    2971                         ULONG   ulPP,       // in: PP_* index
    2972                         BOOL    fInherit,   // in: search parent windows too?
    2973                         LONG    lSysColor)  // in: SYSCLR_* index or -1
     2968 *@@changed V0.9.20 (2002-08-04) [umoeller]: added ulPPIndex, renamed func
     2969 */
     2970
     2971LONG winhQueryPresColor2(HWND hwnd,          // in: window to query
     2972                         ULONG ulppRGB,      // in: PP_* index for RGB color
     2973                         ULONG ulppIndex,    // in: PP_* index for color _index_ (can be null)
     2974                         BOOL fInherit,      // in: search parent windows too?
     2975                         LONG lSysColor)     // in: SYSCLR_* index or -1
    29742976{
    29752977    ULONG   ul,
    2976             attrFound,
    2977             abValue[32];
    2978 
    2979     if (ulPP != (ULONG)-1)
     2978            attrFound;
     2979    LONG    lColorFound;
     2980
     2981    if (ulppRGB != (ULONG)-1)
     2982    {
     2983        ULONG fl = 0;
     2984        if (!fInherit)
     2985            fl = QPF_NOINHERIT;
     2986        if (ulppIndex)
     2987            fl |= QPF_ID2COLORINDEX;            // convert indexed color 2 to RGB V0.9.20 (2002-08-04) [umoeller]
     2988
    29802989        if ((ul = WinQueryPresParam(hwnd,
    2981                                     ulPP,
    2982                                     0,
     2990                                    ulppRGB,
     2991                                    ulppIndex,
    29832992                                    &attrFound,
    2984                                     (ULONG)sizeof(abValue),
    2985                                     (PVOID)&abValue,
    2986                                     (fInherit)
    2987                                          ? 0
    2988                                          : QPF_NOINHERIT)))
    2989             return (abValue[0]);
     2993                                    sizeof(lColorFound),
     2994                                    &lColorFound,
     2995                                    fl)))
     2996            return lColorFound;
     2997    }
    29902998
    29912999    // not found: get system color
    29923000    if (lSysColor != -1)
    2993         return (WinQuerySysColor(HWND_DESKTOP, lSysColor, 0));
     3001        return WinQuerySysColor(HWND_DESKTOP, lSysColor, 0);
    29943002
    29953003    return -1;
     3004}
     3005
     3006/*
     3007 *@@ winhQueryPresColor:
     3008 *      compatibility function because this one was
     3009 *      exported.
     3010 *
     3011 *@@added V0.9.20 (2002-08-04) [umoeller]
     3012 */
     3013
     3014LONG XWPENTRY winhQueryPresColor(HWND hwnd,
     3015                                 ULONG ulPP,
     3016                                 BOOL fInherit,
     3017                                 LONG lSysColor)
     3018{
     3019    return winhQueryPresColor2(hwnd,
     3020                               ulPP,
     3021                               0,
     3022                               fInherit,
     3023                               lSysColor);
    29963024}
    29973025
     
    33393367VOID winhSleep(ULONG ulSleep)    // in: sleep time in milliseconds
    33403368{
    3341     HWND hwnd;
     3369    HWND    hwnd;
     3370
    33423371    if (hwnd = winhCreateObjectWindow(WC_STATIC, NULL))
    33433372    {
    3344         QMSG qmsg;
    3345         HAB hab = WinQueryAnchorBlock(hwnd);
    3346         if (WinStartTimer(hab,
    3347                           hwnd,
    3348                           1,
    3349                           ulSleep))
     3373        QMSG    qmsg;
     3374        HAB     hab;
     3375
     3376        if (    (hab = WinQueryAnchorBlock(hwnd))
     3377             && (WinStartTimer(hab,
     3378                               hwnd,
     3379                               1,
     3380                               ulSleep))
     3381           )
    33503382        {
    33513383            while (WinGetMsg(hab, &qmsg, NULLHANDLE, 0, 0))
Note: See TracChangeset for help on using the changeset viewer.