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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? polyline.c

?? 英文版的 想要的話可以下載了 為大家服務
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*
 * POLYLINE.C
 *
 * Window procedure for the polyline drawing window and support functions.
 * This window is not complicated.  On creation it allocates a block of
 * memory for a POLYLINE structure that contains 20 POINTs.  We do not
 * attempt to reallocate this array at all just to maintain simplicity.
 * This sample is to demonstrate OLE, not LocalReAlloc.
 *
 * Copyright(c) Microsoft Corp. 1992-1994 All Rights Reserved
 * Win32 version, January 1994
 */


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

/*
 * HACK:  To fix some Invalid hDC rips, we need to supress certain
 * operations on metafile DC's: GetMapMode, DPtoLP, LPtoDP.
 * We use this flag to indicate supression.
 */
BOOL fMetaDC=FALSE;



/*
 * HPolylineWindowCreate
 *
 * Purpose:
 *  Creates a Polyline window within the client area of hWndParent.
 *
 * Parameters:
 *  hWndParent      HWND of the parent window.
 *  hInstance       HINSTANCE of the application instance.
 *
 * Return Value:
 *  HWND            Result of the CreateWindowEx call.
 *
 */

HWND WINAPI HPolylineWindowCreate(HWND hWndParent, HINSTANCE hInstance)
    {
    RECT        rc;
    HWND        hWndT;

    /*
     * Create the secondary window for this application in a
     * shrunk client area.
     */
    GetClientRect(hWndParent, &rc);
    InflateRect(&rc, -8, -8);

    //Create the editor window.
    hWndT=CreateWindowEx(WS_EX_NOPARENTNOTIFY, rgpsz[IDS_CLASSPOLYLINE]
        , rgpsz[IDS_CLASSPOLYLINE], WS_CHILD | WS_VISIBLE, rc.left
        , rc.top, rc.right-rc.left, rc.bottom-rc.top
        , hWndParent, (HMENU)ID_POLYLINE, hInstance, NULL);

    return hWndT;
    }





/*
 * PolylineWndProc
 *
 * Purpose:
 *  Window procedure for the polyline drawing window.
 *
 * Parameters:
 *  The standard.
 *
 * Return Value:
 *  Standard.
 */

LRESULT WINAPI PolylineWndProc(HWND hWnd, UINT iMsg
    , WPARAM wParam, LPARAM lParam)
    {
    PAINTSTRUCT     ps;
    HDC             hDC;
    HWND            hWndParent;
    HLOCAL          hMem;
    LPPOLYLINE      ppl;
    RECT            rc;
    DWORD           dwRet=0L;

   #ifdef WIN32
    ppl=(LPPOLYLINE)(PSTR)GetWindowLong(hWnd, 0);
   #else
    ppl=(LPPOLYLINE)(PSTR)GetWindowWord(hWnd, 0);
   #endif

    if (WM_USER <= iMsg)
        return LPolylineUserMessage(hWnd, iMsg, wParam, lParam, ppl);


    switch (iMsg)
        {

        case WM_NCCREATE:
            hMem=LocalAlloc(LPTR, CBPOLYLINE);

            if (NULL==hMem)
                return 0L;

           #ifdef WIN32
            SetWindowLong(hWnd, 0, (LONG)hMem);
           #else
            SetWindowWord(hWnd, 0, (WORD)hMem);
           #endif
            return DefWindowProc(hWnd, iMsg, wParam, lParam);


        case WM_NCDESTROY:
           #ifdef WIN32
            hMem=(HLOCAL)GetWindowLong(hWnd, 0);
           #else
            hMem=(HLOCAL)GetWindowWord(hWnd, 0);
           #endif
            LocalFree(hMem);
            return DefWindowProc(hWnd, iMsg, wParam, lParam);


        case WM_CREATE:
            //Stash away the current window rectangle.
            GetClientRect(hWnd, &rc);
            RECTTORECTS(rc, ppl->rc);

            ppl->wVerMaj=VERSIONMAJOR;
            ppl->wVerMin=VERSIONMINOR;
            ppl->cPoints=0;
            break;


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

            if (0!=ppl->cPoints)
                {
                ppl->fDrawEntire=TRUE;
                PolylineDraw(hWnd, hDC, ppl);
                }

            EndPaint(hWnd, &ps);
            break;

        case WM_LBUTTONDOWN:
            //Stop if we are already at the limit.
            if (CPOLYLINEPOINTS==ppl->cPoints)
                {
                MessageBeep(0);
                break;
                }

            //Stuff the new point in the array.
            ppl->rgpt[ppl->cPoints].x=LOWORD(lParam);
            ppl->rgpt[ppl->cPoints].y=HIWORD(lParam);

            ppl->cPoints++;

            //Draw the lines to this new point only.
            hDC=GetDC(hWnd);

            ppl->fDrawEntire=FALSE;
            PolylineDraw(hWnd, hDC, ppl);

            ReleaseDC(hWnd, hDC);

            hWndParent=GetParent(hWnd);

           #ifdef WIN32
            SendMessage(hWndParent, WM_COMMAND
                , MAKELONG(ID_POLYLINE, PLN_POINTCHANGE), (LPARAM)hWnd);
           #else
            SendMessage(hWndParent, WM_COMMAND
                , ID_POLYLINE, MAKELONG(hWnd, PLN_POINTCHANGE));
           #endif
            break;


        default:
            dwRet=DefWindowProc(hWnd, iMsg, wParam, lParam);
            break;
        }

    return dwRet;
    }







/*
 * LPolylineUserMessage
 *
 * Purpose:
 *  Handles all window-specific messages WM_USER and greater,
 *  for the Polyline window:
 *
 *  PLM_RECTSET:        Changes the size of the window and scales the
 *                      data points.
 *
 *  PLM_POLYLINESET:    Sets the current data points and the rectangle
 *                      used to generate the figure.
 *
 *  PLM_POLYLINEGET:    Retrieves the current data points and rectangle
 *                      used to generate the figure.
 *
 *  PLM_POLYLINENEW:    Resets the data points to defaults, meaning
 *                      a blank figure.
 *
 *  PLM_BACKUPUNDO:     Backs the figure up one point.
 *
 *  PLM_BITMAPGET:      Retrieves a bitmap (DDB) of the current image.
 *
 *  PLM_METAFILEGET:    Retrieves a metafile for the current image.
 *
 *  PLM_METAFILEPICTGET:Retrieves a METAFILEPICT structure of the image for
 *                      use in clipboard I/O.
 *
 * Parameters:
 *  hWnd            HWND of the Polyline window.
 *  iMsg            UINT message to process.
 *  wParam          WPARAM parameter of the message.
 *  lParam          LPARAM pameter of the message.
 *  ppl             LPPOLYLINE to the window's extra data structure.
 *
 * Return Value:
 *  DWORD           Value to return from the window procedure
 *                  that recieved the message.
 */

DWORD PASCAL LPolylineUserMessage(HWND hWnd, UINT iMsg, WPARAM wParam
    , LPARAM lParam, LPPOLYLINE ppl)
    {
    DWORD           dwRet=0L;
    HWND            hWndParent;
    HBITMAP         hBmp, hBmpT;
    HDC             hDC, hMemDC;
    LPPOLYLINE      pplT;
    LPMETAFILEPICT  pMF;
    HGLOBAL         hMem;
    HMETAFILE       hMF;
    RECT            rc;
    LPRECT          pRect;
    UINT            i;
    LONG            l, cx, cy, cxT, cyT;

    hWndParent=GetParent(hWnd);

    switch (iMsg)
        {
        case PLM_RECTSET:
            /*
             * Resize the window to the given size, letting WM_SIZE handlers
             * take care of the rest.
             */
            pRect=(LPRECT)lParam;

            /*
             * Scale all the current points to new dimensions.  ppl->rc
             * has the old dimensions, pRect points to the new.  We
             * force each of cx and cy to 1 if they are zero to prevent
             * exceptions.
             */

            RECTSTORECT(ppl->rc, rc);
            cxT=rc.right  - rc.left;
            cyT=rc.bottom - rc.top;

            RECTTORECTS(ppl->rc, *pRect);
            cx=pRect->right  - pRect->left;
            cy=pRect->bottom - pRect->top;

            //Prevent crashes
            if (0L==cxT)
                cxT=1;

            if (0L==cyT)
                cyT=1;

            //Loop through each point, scaling if necessary.
            for (i=0; i< ppl->cPoints; i++)
                {
                //Must use DWORD to insure proper scaling.
                if (cx!=cxT)
                    {
                    l=((LONG)ppl->rgpt[i].x*cx);
                    ppl->rgpt[i].x=(short)(l/cxT);
                    }

                if (cy!=cyT)
                    {
                    l=((LONG)ppl->rgpt[i].y*cy);
                    ppl->rgpt[i].y=(short)(l/cyT);
                    }
                }


            SetWindowPos(hWnd, NULL, pRect->left, pRect->top, (int)cx
                , (int)cy, SWP_NOMOVE | SWP_NOZORDER);


            //Check if we need to notify the parent.
            if (0!=wParam)
                {
               #ifdef WIN32
                SendMessage(hWndParent, WM_COMMAND
                    , MAKELONG(ID_POLYLINE, PLN_SIZECHANGE), (LPARAM)hWnd);
               #else
                SendMessage(hWndParent, WM_COMMAND
                    , ID_POLYLINE, MAKELONG(hWnd, PLN_SIZECHANGE));

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美国产一区视频在线观看| 久久成人综合网| 日韩精品乱码免费| 粉嫩一区二区三区性色av| 欧美伦理视频网站| 中文字幕av一区二区三区高| 美女视频黄 久久| 欧美日韩综合在线免费观看| 中文一区二区在线观看| 久久成人免费网| 欧美日韩国产精品成人| 亚洲精品视频一区二区| 国产久卡久卡久卡久卡视频精品| 欧美日韩国产美女| 亚洲少妇中出一区| 国产成人av自拍| 久久综合九色综合欧美亚洲| 天天色 色综合| 91国偷自产一区二区使用方法| 国产日韩亚洲欧美综合| 久久精品久久精品| 日韩一区二区电影| 蜜桃av一区二区| 91麻豆精品国产91久久久久久久久 | 国产一本一道久久香蕉| 91精品国产品国语在线不卡| 亚洲国产欧美另类丝袜| 91福利在线免费观看| 亚洲免费三区一区二区| aaa亚洲精品一二三区| 国产视频一区二区三区在线观看| 精品一区二区在线播放| 精品人在线二区三区| 国内国产精品久久| 国产性色一区二区| 东方欧美亚洲色图在线| 中文字幕精品一区二区精品绿巨人| 国产精品白丝av| 中文字幕av不卡| 99久久99久久精品国产片果冻| 亚洲日本在线a| 欧美性猛片xxxx免费看久爱| 亚洲一区二区在线观看视频| 欧美日产在线观看| 久久99蜜桃精品| 久久蜜桃一区二区| 91亚洲男人天堂| 亚洲成人资源网| 精品国产免费人成在线观看| 国产福利一区二区| 亚洲视频一区二区在线观看| 欧美怡红院视频| 另类欧美日韩国产在线| 亚洲国产精品成人综合色在线婷婷| aaa亚洲精品| 日韩在线卡一卡二| 欧美激情在线免费观看| 日本精品一级二级| 美腿丝袜亚洲一区| 国产精品初高中害羞小美女文| 色狠狠色狠狠综合| 另类小说色综合网站| 亚洲国产成人一区二区三区| 日本韩国欧美一区二区三区| 日日摸夜夜添夜夜添亚洲女人| 久久久99精品免费观看不卡| 日本道精品一区二区三区| 日本成人中文字幕| 中文字幕一区在线观看视频| 欧美精品日韩精品| 成人一级视频在线观看| 亚洲不卡一区二区三区| 亚洲国产精品av| 7777精品伊人久久久大香线蕉经典版下载| 激情成人午夜视频| 亚洲国产一区视频| 中文字幕中文字幕中文字幕亚洲无线| 欧美另类videos死尸| 不卡一区二区三区四区| 人人爽香蕉精品| 亚洲国产毛片aaaaa无费看| 欧美国产欧美综合| 精品国产百合女同互慰| 欧美视频一二三区| www.亚洲免费av| 久久不见久久见中文字幕免费| 一区二区三区加勒比av| 亚洲国产成人在线| 久久中文字幕电影| 欧美一级黄色片| 在线一区二区视频| 92国产精品观看| 成人一区二区三区视频在线观看| 久久激情五月婷婷| 日本网站在线观看一区二区三区 | 国产亚洲婷婷免费| 56国语精品自产拍在线观看| 91成人国产精品| 91成人免费在线视频| 99re热这里只有精品视频| 国产精品综合一区二区三区| 久久疯狂做爰流白浆xx| 另类的小说在线视频另类成人小视频在线| 亚洲欧美日韩一区二区三区在线观看| 久久久99精品免费观看| 久久天堂av综合合色蜜桃网| 日韩三级电影网址| 日韩一区二区三区高清免费看看| 欧美午夜一区二区三区免费大片| 一本高清dvd不卡在线观看| 不卡av免费在线观看| 99久久夜色精品国产网站| 成人高清视频在线| 99热精品国产| 91久久精品一区二区| 91视视频在线观看入口直接观看www | 51久久夜色精品国产麻豆| 欧美日韩一区二区不卡| 欧美日韩国产a| 欧美精品乱人伦久久久久久| 日韩一区二区在线观看| 26uuu精品一区二区在线观看| 精品精品国产高清一毛片一天堂| 2020日本不卡一区二区视频| 久久婷婷国产综合国色天香| 久久亚洲欧美国产精品乐播| 久久久久国产一区二区三区四区| 国产午夜精品理论片a级大结局 | 亚洲电影第三页| 舔着乳尖日韩一区| 美女视频第一区二区三区免费观看网站 | 国产精品一线二线三线精华| 国产一区二区免费看| 丁香激情综合五月| 91麻豆产精品久久久久久| 91国内精品野花午夜精品| 337p亚洲精品色噜噜噜| 久久综合精品国产一区二区三区| 国产欧美一区二区在线| 亚洲色图欧洲色图婷婷| 天天综合日日夜夜精品| 国产精一区二区三区| 99re在线视频这里只有精品| 777午夜精品视频在线播放| 久久亚洲精品国产精品紫薇| 亚洲欧美日韩国产手机在线| 日韩有码一区二区三区| 成人国产视频在线观看| 欧美日韩精品二区第二页| 亚洲视频一二三区| 日韩综合小视频| www.性欧美| 欧美成人r级一区二区三区| 国产精品午夜在线观看| 亚洲第一成年网| 国产成人精品免费| 7777精品伊人久久久大香线蕉完整版 | 天堂成人国产精品一区| 国产乱子伦视频一区二区三区| 99国产精品视频免费观看| 欧美成人高清电影在线| 一区二区三区欧美日韩| 国产精品99久久久| 日韩欧美亚洲国产另类| 亚洲蜜臀av乱码久久精品蜜桃| 精品一区二区成人精品| 欧美性受极品xxxx喷水| 欧美国产日本韩| 人妖欧美一区二区| 欧美午夜精品久久久久久孕妇| 久久免费精品国产久精品久久久久| 亚洲国产综合91精品麻豆| 国产成人av一区二区三区在线| 欧美夫妻性生活| 亚洲精品国产a| 福利91精品一区二区三区| 日韩精品一区二区三区视频| 一区二区三区欧美亚洲| 波多野结衣欧美| 久久久久久久久伊人| 久久精品国产在热久久| 欧美午夜寂寞影院| 亚洲激情在线激情| 99精品欧美一区二区蜜桃免费| 国产清纯白嫩初高生在线观看91| 免费在线视频一区| 制服.丝袜.亚洲.中文.综合| 亚洲乱码国产乱码精品精98午夜| 国产成a人亚洲精| 久久亚洲精品国产精品紫薇| 麻豆精品视频在线| 国产网站一区二区三区| 国产精品一区久久久久| 亚洲精品在线免费播放| 美日韩一区二区三区| 欧美一级免费观看| 免费看日韩a级影片| 日韩欧美国产精品一区| 久久97超碰国产精品超碰| 欧美一级电影网站|