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

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

?? chatch.cpp

?? 英文版的 想要的話可以下載了 為大家服務(wù)
?? CPP
字號(hào):
/*
 * CHATCH.CPP
 *
 * Implementation of a class to manage a hatch border around an
 * in-place editing window.
 *
 * Copyright (c)1993-1995 Microsoft Corporation, All Right Reserved
 *
 * Kraig Brockschmidt, Microsoft
 * Internet  :  kraigb@microsoft.com
 * Compuserve:  >INTERNET:kraigb@microsoft.com
 */


#include <windows.h>
#include "classlib.h"


//Hatch pattern brush bits
static WORD g_wHatchBmp[]={0x11, 0x22, 0x44, 0x88, 0x11, 0x22, 0x44, 0x88};

void DrawShading(LPRECT, HDC, UINT);


/*
 * HatchWindowRegister
 *
 * Purpose:
 *  Registers the hatch window class for use with CHatchWin.
 *
 * Parameters:
 *  hInst           HINSTANCE under which to register.
 *
 * Return Value:
 *  BOOL            TRUE if successful, FALSE otherwise.
 */

BOOL HatchWindowRegister(HINSTANCE hInst)
    {
    WNDCLASS    wc;

    //Must have CS_DBLCLKS for border!
    wc.style         = CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS;
    wc.hInstance     = hInst;
    wc.cbClsExtra    = 0;
    wc.lpfnWndProc   = HatchWndProc;
    wc.cbWndExtra    = CBHATCHWNDEXTRA;
    wc.hIcon         = NULL;
    wc.hCursor       = LoadCursor(NULL, IDC_ARROW);
    wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
    wc.lpszMenuName  = NULL;
    wc.lpszClassName = SZCLASSHATCHWIN;

    return RegisterClass(&wc);
        return FALSE;
    }




/*
 * CHatchWin:CHatchWin
 * CHatchWin::~CHatchWin
 *
 * Constructor Parameters:
 *  hInst           HINSTANCE of the application we're in.
 */

CHatchWin::CHatchWin(HINSTANCE hInst)
    : CWindow(hInst)
    {
    m_hWnd=NULL;
    m_hWndKid=NULL;
    m_hWndAssociate=NULL;
    m_uID=0;

    m_dBorderOrg=GetProfileInt(TEXT("windows")
        , TEXT("OleInPlaceBorderWidth")
        , HATCHWIN_BORDERWIDTHDEFAULT);

    m_dBorder=m_dBorderOrg;
    SetRect(&m_rcPos, 0, 0, 0, 0);
    SetRect(&m_rcClip, 0, 0, 0, 0);

    return;
    }


CHatchWin::~CHatchWin(void)
    {
    /*
     * Chances are this was already destroyed when a document
     * was destroyed.
     */
    if (NULL!=m_hWnd && IsWindow(m_hWnd))
        DestroyWindow(m_hWnd);

    return;
    }



/*
 * CHatchWin::Init
 *
 * Purpose:
 *  Instantiates a hatch window within a given parent with a
 *  default rectangle.  This is not initially visible.
 *
 * Parameters:
 *  hWndParent      HWND of the parent of this window
 *  uID             UINT identifier for this window (send in
 *                  notifications to associate window).
 *  hWndAssoc       HWND of the initial associate.
 *
 * Return Value:
 *  BOOL            TRUE if the function succeeded, FALSE otherwise.
 */

BOOL CHatchWin::Init(HWND hWndParent, UINT uID, HWND hWndAssoc)
    {
    m_hWnd=CreateWindowEx(WS_EX_NOPARENTNOTIFY, SZCLASSHATCHWIN
        , SZCLASSHATCHWIN, WS_CHILD | WS_CLIPSIBLINGS
        | WS_CLIPCHILDREN, 0, 0, 100, 100, hWndParent, (HMENU)uID
        , m_hInst, this);

    m_uID=uID;
    m_hWndAssociate=hWndAssoc;

    return (NULL!=m_hWnd);
    }




/*
 * CHatchWin::HwndAssociateSet
 * CHatchWin::HwndAssociateGet
 *
 * Purpose:
 *  Sets (Set) or retrieves (Get) the associate window of the
 *  hatch window.
 *
 * Parameters: (Set only)
 *  hWndAssoc       HWND to set as the associate.
 *
 * Return Value:
 *  HWND            Previous (Set) or current (Get) associate
 *                  window.
 */

HWND CHatchWin::HwndAssociateSet(HWND hWndAssoc)
    {
    HWND    hWndT=m_hWndAssociate;

    m_hWndAssociate=hWndAssoc;
    return hWndT;
    }

HWND CHatchWin::HwndAssociateGet(void)
    {
    return m_hWndAssociate;
    }





/*
 * CHatchWin::RectsSet
 *
 * Purpose:
 *  Changes the size and position of the hatch window and the child
 *  window within it using a position rectangle for the child and
 *  a clipping rectangle for the hatch window and child.  The hatch
 *  window occupies prcPos expanded by the hatch border and clipped
 *  by prcClip.  The child window is fit to prcPos to give the
 *  proper scaling, but it clipped to the hatch window which
 *  therefore clips it to prcClip without affecting the scaling.
 *
 * Parameters:
 *  prcPos          LPRECT providing the position rectangle.
 *  prcClip         LPRECT providing the clipping rectangle.
 *
 * Return Value:
 *  None
 */

void CHatchWin::RectsSet(LPRECT prcPos, LPRECT prcClip)
    {
    RECT    rc;
    RECT    rcPos;

    m_rcPos=*prcPos;
    m_rcClip=*prcClip;

    //Calculate the rectangle for the hatch window, then clip it.
    rcPos=*prcPos;
    InflateRect(&rcPos, m_dBorder, m_dBorder);
    IntersectRect(&rc, &rcPos, prcClip);

    SetWindowPos(m_hWnd, NULL, rc.left, rc.top, rc.right-rc.left
        , rc.bottom-rc.top, SWP_NOZORDER | SWP_NOACTIVATE);

    /*
     * Set the rectangle of the child window to be at m_dBorder
     * from the top and left but with the same size as prcPos
     * contains.  The hatch window will clip it.
     */
    SetWindowPos(m_hWndKid, NULL, rcPos.left-rc.left+m_dBorder
        , rcPos.top-rc.top+m_dBorder, prcPos->right-prcPos->left
        , prcPos->bottom-prcPos->top, SWP_NOZORDER | SWP_NOACTIVATE);

    return;
    }



/*
 * CHatchWin::ChildSet
 *
 * Purpose:
 *  Assigns a child window to this hatch window.
 *
 * Parameters:
 *  hWndKid         HWND of the child window.
 *
 * Return Value:
 *  None
 */

void CHatchWin::ChildSet(HWND hWndKid)
    {
    m_hWndKid=hWndKid;

    if (NULL!=hWndKid)
        {
        SetParent(hWndKid, m_hWnd);

        //Insure this is visible when the hatch window becomes visible.
        ShowWindow(hWndKid, SW_SHOW);
        }

    return;
    }



/*
 * CHatchWin::ShowHatch
 *
 * Purpose:
 *  Turns hatching on and off; turning the hatching off changes
 *  the size of the window to be exactly that of the child, leaving
 *  everything else the same.  The result is that we don't have
 *  to turn off drawing because our own WM_PAINT will never be
 *  called.
 *
 * Parameters:
 *  fHatch          BOOL indicating to show (TRUE) or hide (FALSE)
                    the hatching.
 *
 * Return Value:
 *  None
 */

void CHatchWin::ShowHatch(BOOL fHatch)
    {
    /*
     * All we have to do is set the border to zero and
     * call SetRects again with the last rectangles the
     * child sent to us.
     */
    m_dBorder=fHatch ? m_dBorderOrg : 0;
    RectsSet(&m_rcPos, &m_rcClip);
    return;
    }



/*
 * HatchWndProc
 *
 * Purpose:
 *  Standard window procedure for the Hatch Window
 */

LRESULT APIENTRY HatchWndProc(HWND hWnd, UINT iMsg
    , WPARAM wParam, LPARAM lParam)
    {
    PCHatchWin  phw;
    HDC         hDC;
    PAINTSTRUCT ps;
    RECT        rc;
            
    phw=(PCHatchWin)GetWindowLong(hWnd, HWWL_STRUCTURE);

    switch (iMsg)
        {
        case WM_CREATE:
            phw=(PCHatchWin)((LPCREATESTRUCT)lParam)->lpCreateParams;
            SetWindowLong(hWnd, HWWL_STRUCTURE, (LONG)phw);
            break;


        case WM_PAINT: 
            hDC=BeginPaint(hWnd, &ps);
            GetClientRect(hWnd, &rc);

            //Always draw the hatching.
            DrawShading(&rc, hDC, phw->m_dBorder);

            EndPaint(hWnd, &ps);
            break;


        case WM_SETFOCUS:
            //We need this since the container will SetFocus to us.
            if (NULL!=phw->m_hWndKid)
                SetFocus(phw->m_hWndKid);

            break;


        case WM_LBUTTONDBLCLK:
            /*
             * If the double click was within m_dBorder of an
             * edge, send the HWN_BORDERDOUBLECLICKED notification.
             *
             * Because we're always sized just larger than our child
             * window by the border width, we can only *get* this
             * message when the mouse is on the border.  So we can
             * just send the notification.
             */

            if (NULL!=phw->m_hWndAssociate)
                {
                SendCommand(phw->m_hWndAssociate, phw->m_uID
                    , HWN_BORDERDOUBLECLICKED, hWnd);
                }

            break;


        default:
            return DefWindowProc(hWnd, iMsg, wParam, lParam);
        }
    
    return 0L;
    }



/*
 * DrawShading
 *
 * Purpose:
 *  Draw a hatch border ourside the rectable given.
 *
 * Parameters:
 *  prc             LPRECT containing the rectangle.
 *  hDC             HDC on which to draw.
 *  cWidth          UINT width of the border to draw.  Ignored
 *                  if dwFlags has UI_SHADE_FULLRECT.
 *
 * Return Value:
 *  None
 */

void DrawShading(LPRECT prc, HDC hDC, UINT cWidth)
    {
    HBRUSH      hBR;
    HBRUSH      hBROld;
    HBITMAP     hBM;
    RECT        rc;
    UINT        cx, cy;
    COLORREF    crText;
    COLORREF    crBk;
    const DWORD dwROP=0x00A000C9L;  //DPa

    if (NULL==prc || NULL==hDC)
		return;

    hBM=CreateBitmap(8, 8, 1, 1, g_wHatchBmp);
    hBR=CreatePatternBrush(hBM);
    hBROld=(HBRUSH)SelectObject(hDC, hBR);

    rc=*prc;
    cx=rc.right-rc.left;
    cy=rc.bottom-rc.top;

    crText=SetTextColor(hDC, RGB(255, 255, 255));
    crBk=SetBkColor(hDC, RGB(0, 0, 0));
    PatBlt(hDC, rc.left, rc.top, cx, cWidth, dwROP);
    PatBlt(hDC, rc.left, rc.top, cWidth, cy, dwROP);
    PatBlt(hDC, rc.right-cWidth, rc.top, cWidth, cy, dwROP);
    PatBlt(hDC, rc.left, rc.bottom-cWidth, cx, cWidth, dwROP);

    SetTextColor(hDC, crText);
    SetBkColor(hDC, crBk);
    SelectObject(hDC, hBROld);
    DeleteObject(hBR);
    DeleteObject(hBM);

    return;
    }

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
在线一区二区三区做爰视频网站| 日韩成人午夜电影| 91福利视频在线| 日韩av电影免费观看高清完整版在线观看| 精品盗摄一区二区三区| 欧美亚洲国产一区在线观看网站| 99精品在线观看视频| 激情综合网最新| 亚洲精品高清在线观看| 国产视频在线观看一区二区三区| 精品国产91乱码一区二区三区| 亚洲国产精品v| 日韩精品一区第一页| 老色鬼精品视频在线观看播放| 一区视频在线播放| 国产日产欧产精品推荐色 | 国产乱码字幕精品高清av| 亚洲成精国产精品女| 亚洲欧美激情一区二区| 最好看的中文字幕久久| 日本精品免费观看高清观看| 国产精品影音先锋| 国产精品资源站在线| 国产一区二区三区| 国产福利一区二区| 99精品1区2区| 欧美怡红院视频| 欧美人牲a欧美精品| 日韩精品一区二区三区在线| 精品久久久网站| 亚洲宅男天堂在线观看无病毒 | 91福利精品第一导航| 制服丝袜一区二区三区| 亚洲精选视频在线| 高清不卡在线观看av| 日韩久久久精品| 日韩成人伦理电影在线观看| 日本高清成人免费播放| 国产精品三级视频| 国产成人亚洲综合a∨婷婷图片| 69av一区二区三区| 日本不卡的三区四区五区| 欧美日韩亚洲综合一区二区三区| 日韩精品一区在线| 欧美亚洲高清一区| 亚洲人成影院在线观看| 一区二区欧美视频| 成人激情电影免费在线观看| 欧美日韩在线不卡| 18欧美亚洲精品| 国产一区二区美女诱惑| 欧美日本在线一区| 亚洲视频小说图片| 不卡在线观看av| 国产精品网友自拍| 国产一区二区三区黄视频| 91精品福利在线一区二区三区 | 日本不卡一二三区黄网| 在线亚洲+欧美+日本专区| 国产精品久久夜| 国产精品乡下勾搭老头1| www精品美女久久久tv| 毛片av一区二区三区| 欧美一区欧美二区| 丝袜a∨在线一区二区三区不卡| 国产麻豆精品在线观看| 精品成人a区在线观看| 免费精品99久久国产综合精品| 欧美日韩一区二区三区不卡 | 色一情一伦一子一伦一区| 国产精品少妇自拍| 91亚洲精品乱码久久久久久蜜桃| 国产蜜臀97一区二区三区| 国产福利精品一区| 亚洲卡通欧美制服中文| 欧美影片第一页| 日本不卡一二三| 国产亚洲一区字幕| 91麻豆国产香蕉久久精品| 国产日韩欧美精品一区| 风流少妇一区二区| 国产精品美女久久久久aⅴ| 一本久道久久综合中文字幕| 亚洲va欧美va国产va天堂影院| 欧美一区二区三区四区在线观看| 精品影视av免费| 亚洲人成伊人成综合网小说| 欧美美女bb生活片| 成人免费福利片| 首页综合国产亚洲丝袜| 91免费看片在线观看| 欧美精三区欧美精三区| 日韩精品亚洲一区| 久久精品夜色噜噜亚洲aⅴ| 色菇凉天天综合网| 欧美日本一区二区在线观看| 激情成人午夜视频| 亚洲国产成人av| 国产精品国产自产拍在线| 日韩丝袜美女视频| 欧美自拍偷拍午夜视频| 国产福利一区二区三区| 麻豆精品在线看| 亚洲成人午夜影院| 亚洲美女区一区| 国产精品国产精品国产专区不片| 精品国产制服丝袜高跟| 欧美日韩一区二区三区在线看| 成人午夜看片网址| 激情六月婷婷综合| 精品一区二区在线免费观看| 日日夜夜免费精品| 日韩国产精品久久| 偷窥少妇高潮呻吟av久久免费| 亚洲综合免费观看高清在线观看| 国产精品久久看| 成人欧美一区二区三区1314| 中文字幕免费观看一区| 亚洲国产精品激情在线观看| 国产色综合久久| 国产精品久久久久久妇女6080| 国产精品嫩草99a| 中文字幕一区二区三区在线观看 | 精品乱码亚洲一区二区不卡| 91精品国产福利在线观看| 欧美一级免费大片| 精品国偷自产国产一区| 欧美精品一区二区三区在线 | 欧美一级生活片| 精品第一国产综合精品aⅴ| 国产网红主播福利一区二区| 国产人久久人人人人爽| 亚洲欧美另类小说| 奇米影视一区二区三区| 国产成人自拍在线| 色哟哟一区二区| 正在播放亚洲一区| 日本一区二区三区免费乱视频| 国产精品二区一区二区aⅴ污介绍| 亚洲丝袜制服诱惑| 视频一区二区欧美| 成人中文字幕合集| 在线播放日韩导航| 国产精品国产三级国产aⅴ入口| 亚洲精品免费电影| 亚洲曰韩产成在线| 国产一区二区不卡老阿姨| 色偷偷一区二区三区| 精品国产99国产精品| 亚洲成在人线免费| www.一区二区| 日韩精品一区二区三区中文精品| 中文字幕一区二区三区四区| 七七婷婷婷婷精品国产| 色综合中文字幕| 国产精品不卡在线| 国产成a人亚洲精品| 日韩欧美在线综合网| 亚洲午夜激情网页| 色一情一乱一乱一91av| 国产精品盗摄一区二区三区| 精品亚洲aⅴ乱码一区二区三区| 91美女精品福利| 亚洲欧美综合网| 亚洲乱码日产精品bd| 亚洲狠狠丁香婷婷综合久久久| 国产一区二区剧情av在线| 欧美人妖巨大在线| 午夜欧美大尺度福利影院在线看| 色婷婷久久一区二区三区麻豆| 国产精品久久三区| 99久久精品国产麻豆演员表| 国产精品久久久久永久免费观看 | 国产精品久久久久桃色tv| 国产精品88av| 亚洲国产精品黑人久久久| av成人免费在线观看| 日韩毛片视频在线看| 色综合中文字幕国产| 亚洲色图一区二区三区| 欧美在线一二三| 蜜臀99久久精品久久久久久软件| 日韩亚洲欧美综合| 成人午夜电影久久影院| 亚洲女人****多毛耸耸8| 欧美怡红院视频| 激情都市一区二区| 亚洲日本电影在线| 欧美肥大bbwbbw高潮| 国产乱码精品一区二区三区忘忧草 | 91丨porny丨首页| 亚洲成av人影院在线观看网| 欧美精品一区二区三区蜜桃视频| 99精品热视频| 麻豆一区二区三| 亚洲一区影音先锋| 国产亚洲自拍一区| 欧美一区二区观看视频| www.欧美日韩| 国产一区在线不卡|