亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? bttncur.c

?? 英文版的 想要的話可以下載了 為大家服務(wù)
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*
 * BTTNCUR.C
 * Buttons & Cursors
 *
 * Public functions to generate different states of toolbar buttons
 * from a single bitmap.  States are normal, pressed, checked, and
 * disabled.
 *
 * Copyright (c)1992-1995 Microsoft Corporation, All Rights Reserved
 *
 * Kraig Brockschmidt, Microsoft
 * Internet  :  kraigb@microsoft.com
 * Compuserve:  >INTERNET:kraigb@microsoft.com
 */


#include "inoledll.h"

//Cache GDI objects to speed drawing.
HDC     g_hDCGlyphs    = NULL;
HDC     g_hDCMono      = NULL;
HBRUSH  g_hBrushDither = NULL;

//Standard images to use in case caller doesn't provide them
HBITMAP g_rghBmpStandardImages[3];

//Standard button colors.
const COLORREF g_crStandard[4]={ RGB(0, 0, 0)      //STDCOLOR_BLACK
                   , RGB(128, 128, 128)            //STDCOLOR_DKGRAY
                   , RGB(192, 192, 192)            //STDCOLOR_LTGRAY
                   , RGB(255, 255, 255)};          //STDCOLOR_WHITE


COLORREF g_crSys[5];



/*
 * Mapping from image identifier to button type (command/attribute).
 * Version 1.00 of this DLL has no attribute images defined, so
 * the code will only support three states for each command
 * button.  Any state is, however, valid for an application
 * defined image.
 */

UINT mpButtonType[TOOLIMAGE_MAX-TOOLIMAGE_MIN+1]=
        {
        BUTTONTYPE_COMMAND, BUTTONTYPE_COMMAND, BUTTONTYPE_COMMAND,
        BUTTONTYPE_COMMAND, BUTTONTYPE_COMMAND, BUTTONTYPE_COMMAND,
        BUTTONTYPE_COMMAND, BUTTONTYPE_COMMAND, BUTTONTYPE_COMMAND
        };


/*
 * UIToolConfigureForDisplay
 * Public API
 *
 * Purpose:
 *  Initializes the library to scale button images for the display
 *  type.  Without calling this function the library defaults to 96
 *  DPI (VGA).  By calling this function an application acknowledges
 *  that it must use the data returned from this function to
 *  configure itself for the display.
 *
 * Parameters:
 *  lpDD            LPTOOLDISPLAYDATA to fill with the display-
 *                  sensitive size values.
 *
 * Return Value:
 *  BOOL            TRUE if the sizes were obtained, FALSE otherwise.
 */

BOOL WINAPI UIToolConfigureForDisplay(LPTOOLDISPLAYDATA lpDD)
    {
    int         cy;
    HDC         hDC;


    if (NULL==lpDD || IsBadWritePtr(lpDD, sizeof(TOOLDISPLAYDATA)))
        return FALSE;

    /*
     * Determine the aspect ratio of the display we're currently
     * running on and calculate the necessary information.
     *
     * By retrieving the logical Y extent of the display driver, you
     * only have limited possibilities:
     *      LOGPIXELSY      Display
     *      ----------------------------------------
     *         48             CGA    (unsupported)
     *         72             EGA
     *         96             VGA
     *        120             8514/a (i.e. HiRes VGA)
     */

    hDC=GetDC(NULL);

    if (NULL==hDC)
        return FALSE;

    cy=GetDeviceCaps(hDC, LOGPIXELSY);
    ReleaseDC(NULL, hDC);

    /*
     * Instead of single comparisons, check ranges instead, so in
     * case we get something funky, we'll act reasonable.
     */
    if (72 >=cy)
        {
        lpDD->uDPI     =72;
        lpDD->cyBar    =CYBUTTONBAR72;
        lpDD->cxButton =TOOLBUTTON_STD72WIDTH;
        lpDD->cyButton =TOOLBUTTON_STD72HEIGHT;
        lpDD->cxImage  =TOOLBUTTON_STD72IMAGEWIDTH;
        lpDD->cyImage  =TOOLBUTTON_STD72IMAGEHEIGHT;
        lpDD->uIDImages=IDB_STANDARDIMAGES72;
        }
    else
        {
        if (72 < cy && 120 > cy)
            {
            lpDD->uDPI     =96;
            lpDD->cyBar    =CYBUTTONBAR96;
            lpDD->cxButton =TOOLBUTTON_STD96WIDTH;
            lpDD->cyButton =TOOLBUTTON_STD96HEIGHT;
            lpDD->cxImage  =TOOLBUTTON_STD96IMAGEWIDTH;
            lpDD->cyImage  =TOOLBUTTON_STD96IMAGEHEIGHT;
            lpDD->uIDImages=IDB_STANDARDIMAGES96;
            }
        else
            {
            lpDD->uDPI     =120;
            lpDD->cyBar    =CYBUTTONBAR120;
            lpDD->cxButton =TOOLBUTTON_STD120WIDTH;
            lpDD->cyButton =TOOLBUTTON_STD120HEIGHT;
            lpDD->cxImage  =TOOLBUTTON_STD120IMAGEWIDTH;
            lpDD->cyImage  =TOOLBUTTON_STD120IMAGEHEIGHT;
            lpDD->uIDImages=IDB_STANDARDIMAGES120;
            }
        }

    return TRUE;
    }








/*
 * ToolButtonInit
 * Internal
 *
 * Purpose:
 *  Initializes GDI objects for drawing images through
 *  UIToolButtonDraw. If the function fails, the function has
 *  already performed proper cleanup.
 *
 * Parameters:
 *  hInst           HINSTANCE of the DLL
 *
 * Return Value:
 *  BOOL            TRUE if initialization succeeded.  FALSE
 *                  otherwise.
 */

BOOL ToolButtonInit(HINSTANCE hInst)
    {
    UINT        i;

    //DC for BitBltting the image (the glyph)
    g_hDCGlyphs=CreateCompatibleDC(NULL);

    //Create a monochrome DC and a brush for doing pattern dithering.
    g_hDCMono=CreateCompatibleDC(NULL);

    g_hBrushDither=HBrushDitherCreate(GetSysColor(COLOR_BTNFACE)
        , GetSysColor(COLOR_BTNHIGHLIGHT));

    for (i=0; i < 3; i++)
        {
        g_rghBmpStandardImages[i]=LoadBitmap(hInst
            , MAKEINTRESOURCE(IDB_STANDARDIMAGESMIN+i));
        }

    if (NULL==g_hDCGlyphs || NULL==g_hDCMono
        || NULL==g_hBrushDither || NULL==g_rghBmpStandardImages[0])
        {
        //On failure, cleanup whatever might have been allocated.
        ToolButtonFree();
        return FALSE;
        }

    return TRUE;
    }





/*
 * ToolButtonFree
 * Internal
 *
 * Purpose:
 *  Free all GDI allocations made during initialization.
 *
 * Parameters:
 *  None
 *
 * Return Value:
 *  None
 */

void ToolButtonFree(void)
    {
    UINT        i;

    if (NULL!=g_hDCMono)
        DeleteDC(g_hDCMono);

    g_hDCMono=NULL;

    if (NULL!=g_hDCGlyphs)
        DeleteDC(g_hDCGlyphs);

    g_hDCGlyphs=NULL;

    if (NULL!=g_hBrushDither)
        DeleteObject(g_hBrushDither);

    g_hBrushDither=NULL;

    for (i=0; i < 3; i++)
        {
        if (NULL!=g_rghBmpStandardImages[i])
            DeleteObject(g_rghBmpStandardImages[i]);

        g_rghBmpStandardImages[i]=NULL;
        }

    return;
    }





/*
 * HBrushDitherCreate
 * Internal
 *
 * Purpose:
 *  Creates and returns a handle to a pattern brush created from
 *  an 8*8 monochrome pattern bitmap.  We use the button face and
 *  highlight colors to indicate the resulting colors of a PatBlt
 *  using this brush.
 *
 * Parameters:
 *  rgbFace         COLORREF of the button face color.
 *  rgbHilight      COLORREF of the button highlight color.
 *
 * Return Value:
 *  HBITMAP         Handle to the dither bitmap.
 */

HBRUSH HBrushDitherCreate(COLORREF rgbFace, COLORREF rgbHilight)
    {
    struct  //BITMAPINFO with 16 colors
        {
        BITMAPINFOHEADER    bmiHeader;
        RGBQUAD             bmiColors[16];
        } bmi;

    HBRUSH          hBrush=NULL;
    DWORD           patGray[8];
    HDC             hDC;
    HBITMAP         hBmp;
    static COLORREF rgbFaceOld   =0xFFFFFFFF;  //Initially impossible
    static COLORREF rgbHilightOld=0xFFFFFFFF;  //Initially impossible

    /*
     * If the colors haven't changed from last time, just return the
     * existing brush.
     */
    if (rgbFace==rgbFaceOld && rgbHilight==rgbHilightOld)
        return g_hBrushDither;

    rgbFaceOld=rgbFace;
    rgbHilightOld=rgbHilight;

    /*
     * We're going to create an 8*8 brush for PatBlt using the
     * button face color and button highlight color.  We use this
     * brush to affect the pressed state and the disabled state.
     */
    bmi.bmiHeader.biSize         = sizeof(BITMAPINFOHEADER);
    bmi.bmiHeader.biWidth        = 8;
    bmi.bmiHeader.biHeight       = 8;
    bmi.bmiHeader.biPlanes       = 1;
    bmi.bmiHeader.biBitCount     = 1;
    bmi.bmiHeader.biCompression  = BI_RGB;
    bmi.bmiHeader.biSizeImage    = 0;
    bmi.bmiHeader.biXPelsPerMeter= 0;
    bmi.bmiHeader.biYPelsPerMeter= 0;
    bmi.bmiHeader.biClrUsed      = 0;
    bmi.bmiHeader.biClrImportant = 0;

    bmi.bmiColors[0].rgbBlue     = GetBValue(rgbFace);
    bmi.bmiColors[0].rgbGreen    = GetGValue(rgbFace);
    bmi.bmiColors[0].rgbRed      = GetRValue(rgbFace);
    bmi.bmiColors[0].rgbReserved = 0;

    bmi.bmiColors[1].rgbBlue     = GetBValue(rgbHilight);
    bmi.bmiColors[1].rgbGreen    = GetGValue(rgbHilight);
    bmi.bmiColors[1].rgbRed      = GetRValue(rgbHilight);
    bmi.bmiColors[1].rgbReserved = 0;

    //Create the byte array for CreateDIBitmap.
    patGray[6]=patGray[4]=patGray[2]=patGray[0]=0x5555AAAAL;
    patGray[7]=patGray[5]=patGray[3]=patGray[1]=0xAAAA5555L;

    //Create the bitmap
    hDC=GetDC(NULL);
    hBmp=CreateDIBitmap(hDC, &bmi.bmiHeader, CBM_INIT, patGray
                        , (LPBITMAPINFO)&bmi, DIB_RGB_COLORS);
    ReleaseDC(NULL, hDC);

    //Create the brush from the bitmap
    if (NULL!=hBmp)
        {
        hBrush=CreatePatternBrush(hBmp);
        DeleteObject(hBmp);
        }

    /*
     * If we could recreate a brush, clean up and make it the current
     * pattern.  Otherwise the best we can do it return the old one,
     * which will be colored wrong, but at least it works.
     */
    if (NULL!=hBrush)
        {
        if (NULL!=g_hBrushDither)
            DeleteObject(g_hBrushDither);

        g_hBrushDither=hBrush;
        }

    return g_hBrushDither;
    }





/*
 * UIToolButtonDraw
 * Public API
 *
 * Purpose:
 *  Draws the complete image of a toolbar-style button with a given
 *  image in the center and in a specific state.  The button is drawn
 *  on a specified hDC at a given location, so this function is
 *  useful on standard owner-draw buttons as well as on toolbar
 *  controls that have only one window but show images of multiple
 *  buttons.
 *
 * Parameters:
 *  hDC             HDC on which to draw.
 *  x, y            int coordinates at which to draw.
 *  dx, dy          int dimensions of the *button*, not the image.
 *  hBmp            HBITMAP from which to draw the image.
 *  bmx, bmy        int dimensions of each bitmap in hBmp.  If hBmp
 *                  is NULL then these are forced to the standard
 *                  sizes.
 *  iImage          int index to the image to draw in the button
 *  uStateIn        UINT containing the state index for the button
 *                  and the color control bits.
 *  pTDD            LPTOOLDISPLAYDATA containing display
 *                  configuration. Can be NULL if hBmp is non-NULL.
 *
 * Return Value:
 *  BOOL            TRUE if drawing succeeded, FALSE otherwise
 *                  meaning that hDC is NULL or hBmp is NULL and
 *                  iImage is not a valid index for a standard image.
 */

BOOL WINAPI UIToolButtonDraw(HDC hDC, int x, int y, int dx, int dy
    , HBITMAP hBmp, int bmx, int bmy, int iImage, UINT uStateIn
    , LPTOOLDISPLAYDATA pTDD)
    {
    UINT            uState=(UINT)LOBYTE((WORD)uStateIn);
    UINT            uColors=(UINT)HIBYTE((WORD)uStateIn
                        & PRESERVE_ALL);
    int             xOffsetGlyph, yOffsetGlyph;
    int             i, iSaveDC;
    HDC             hMemDC;
    HGDIOBJ         hObj;
    HBRUSH          hBR;
    HBITMAP         hBmpT;
    HBITMAP         hBmpMono;
    HBITMAP         hBmpMonoOrg;
    HBITMAP         hBmpSave=NULL;
    TOOLDISPLAYDATA tdd;

    if (NULL==hDC)
        return FALSE;

    if (NULL==pTDD)
        {
        pTDD=&tdd;
        UIToolConfigureForDisplay(pTDD);
        }

    /*
     * If we're given no image bitmap, then use the standard and
     * validate the image index.  We also enforce the standard
     * bitmap size and the size of the button (as requested by
     * User Interface designers).
     */
    if (NULL==hBmp && !(uState & BUTTONGROUP_BLANK))
        {
        i=pTDD->uIDImages-IDB_STANDARDIMAGESMIN;
        hBmp=g_rghBmpStandardImages[i];

        bmx=pTDD->cxImage;            //Force bitmap dimensions
        bmy=pTDD->cyImage;

        dx=pTDD->cxButton;            //Force button dimensions
        dy=pTDD->cyButton;

        if (iImage > TOOLIMAGE_MAX)
            return FALSE;

        /*
         * If we are using a standard command button, verify that
         * the state does not contain the LIGHTFACE group which
         * only applies to attribute buttons.
         */
        if (BUTTONTYPE_COMMAND==mpButtonType[iImage]
            && (uState & BUTTONGROUP_LIGHTFACE))

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩欧美第一区| 91精品国产欧美日韩| 亚洲gay无套男同| 久久午夜国产精品| 欧美日本乱大交xxxxx| 成人自拍视频在线| 美女www一区二区| 亚洲第一主播视频| 中文字幕高清一区| 精品成人a区在线观看| 欧美日免费三级在线| 成人污视频在线观看| 另类综合日韩欧美亚洲| 亚洲一级片在线观看| 国产精品久久久久国产精品日日| 欧美一区二区精品| 欧美精品在线一区二区| 在线看日韩精品电影| yourporn久久国产精品| 国产精品18久久久久久久网站| 日韩av电影免费观看高清完整版| 一区二区成人在线观看| 中文字幕在线观看一区| 欧美国产日韩一二三区| 久久久国产午夜精品 | 91在线视频免费观看| 精品一区二区三区的国产在线播放| 亚洲国产cao| 一区二区三区免费看视频| 国产精品毛片大码女人| 国产亚洲午夜高清国产拍精品 | 国产福利精品导航| 久久福利资源站| 黑人巨大精品欧美一区| 日韩av一二三| 久久不见久久见免费视频7| 蜜桃av一区二区在线观看| 免费欧美高清视频| 美女一区二区三区| 狠狠色综合色综合网络| 久久精品99久久久| 韩国精品久久久| 国产成人h网站| 99久久免费视频.com| 色综合婷婷久久| 在线观看亚洲精品| 欧美日韩国产电影| 国产精品久久久久久久久搜平片| 久久亚洲综合色一区二区三区| 久久久国产一区二区三区四区小说 | 国产精品乱码妇女bbbb| 中文一区二区完整视频在线观看| 91麻豆精品国产91久久久更新时间| 欧美蜜桃一区二区三区| 欧美成人激情免费网| 欧美精品一区二区久久婷婷| 欧美激情一区二区三区| 亚洲欧美日韩国产中文在线| 亚洲曰韩产成在线| 日韩在线一区二区三区| 免费在线看一区| 国内久久婷婷综合| 成人av网在线| 欧美精品 日韩| 欧美精品一区二区三区四区 | 婷婷国产在线综合| 麻豆91免费看| 丁香另类激情小说| 色婷婷亚洲精品| 91精品国产综合久久久久| 日韩午夜在线观看视频| 国产精品久久一卡二卡| 亚洲国产日韩a在线播放性色| 欧美bbbbb| 91亚洲国产成人精品一区二三| 欧美日韩专区在线| 久久噜噜亚洲综合| 亚洲最新视频在线观看| 国产在线乱码一区二区三区| 99久久国产综合精品色伊| 91精品欧美综合在线观看最新| 久久久国产精华| 亚洲一区二区三区四区五区黄| 久久av老司机精品网站导航| 成人国产精品免费观看视频| 欧美日韩精品一区视频| 久久久精品tv| 午夜精品久久久久久久久久久 | 国产喷白浆一区二区三区| 一区二区三区资源| 国产在线播放一区三区四| 欧美优质美女网站| 国产亚洲一区二区三区四区| 婷婷综合五月天| 91网站在线播放| 26uuu亚洲综合色欧美| 亚洲一区二区在线视频| 欧美日本视频在线| 日本一区二区三区在线不卡| 偷拍日韩校园综合在线| 不卡的av网站| 国产欧美综合在线| 日韩不卡手机在线v区| 色噜噜狠狠色综合欧洲selulu| 久久综合久久综合九色| 日日夜夜免费精品视频| 色婷婷一区二区| 日本一区二区三区dvd视频在线| 秋霞午夜av一区二区三区| 色综合一个色综合亚洲| 国产精品国产三级国产普通话蜜臀 | 久久久精品天堂| 日韩二区三区在线观看| 在线观看日韩毛片| 1024精品合集| 粉嫩av亚洲一区二区图片| 欧美一区二区精品| 日韩中文字幕区一区有砖一区| 99综合影院在线| 亚洲国产精品成人综合色在线婷婷| 久久99九九99精品| 欧美草草影院在线视频| 日韩主播视频在线| 制服丝袜亚洲精品中文字幕| 亚洲成av人在线观看| 欧美专区日韩专区| 亚洲综合精品久久| 在线视频国内一区二区| 亚洲自拍与偷拍| 欧美主播一区二区三区美女| 亚洲一级不卡视频| 欧美日韩高清一区| 日韩黄色免费电影| 91精品国产麻豆国产自产在线 | 国产精品色哟哟网站| 韩国av一区二区三区在线观看| 日韩午夜中文字幕| 韩国欧美国产一区| 日本一区二区三区久久久久久久久不| 国产河南妇女毛片精品久久久| 精品国产成人在线影院| 国产精品18久久久久久久久 | 成人在线视频一区| 国产精品国产三级国产专播品爱网 | 国产成人精品aa毛片| 国产精品婷婷午夜在线观看| 日韩一二三四区| 美女脱光内衣内裤视频久久影院| 欧美成人女星排行榜| 国产精品一区在线| 国产精品二三区| 在线观看免费成人| 秋霞av亚洲一区二区三| 久久久精品国产免费观看同学| 成人免费观看男女羞羞视频| 一区二区久久久| 日韩一区二区三区四区五区六区| 国产一区二区不卡| 国产精品成人免费精品自在线观看 | 欧美精品一区二区蜜臀亚洲| 丰满白嫩尤物一区二区| 亚洲精品日韩一| 欧美一级视频精品观看| 国产精品一区二区三区四区| 椎名由奈av一区二区三区| 欧美色综合网站| 国产一区二区剧情av在线| 亚洲男人的天堂av| 日韩三级精品电影久久久| 国产成人精品网址| 亚洲综合免费观看高清完整版在线 | 日韩欧美久久一区| 成人的网站免费观看| 亚洲成年人影院| 国产校园另类小说区| 在线亚洲免费视频| 国内精品写真在线观看| 亚洲精品国久久99热| 欧美大片一区二区| 一本色道a无线码一区v| 美女一区二区视频| 亚洲老司机在线| 国产亚洲污的网站| 欧美乱熟臀69xxxxxx| 丁香激情综合五月| 日韩精品国产欧美| 亚洲免费观看高清完整| 精品欧美乱码久久久久久| 色哟哟一区二区三区| 国产乱人伦精品一区二区在线观看| 一二三区精品视频| 中文文精品字幕一区二区| 在线观看91av| 色综合咪咪久久| 国产成人激情av| 精品午夜久久福利影院| 亚洲永久精品大片| 国产精品你懂的在线| 欧美videos中文字幕| 欧美日韩一区二区三区四区|