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

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

?? winutil.cpp

?? 用DirectX制作高級動畫-[Advanced.Animation.with.DirectX]
?? CPP
?? 第 1 頁 / 共 5 頁
字號:

        SelectPalette(m_hdc,m_hPalette,m_bBackground || bForceBackground);
        SelectPalette(m_MemoryDC,m_hPalette,m_bBackground);
    }

    //  If we grab a critical section here we can deadlock
    //  with the window thread because one of the side effects
    //  of RealizePalette is to send a WM_PALETTECHANGED message
    //  to every window in the system.  In our handling
    //  of WM_PALETTECHANGED we used to grab this CS too.
    //  The really bad case is when our renderer calls DoRealisePalette()
    //  while we're in the middle of processing a palette change
    //  for another window.
    //  So don't hold the critical section while actually realising
    //  the palette.  In any case USER is meant to manage palette
    //  handling - we shouldn't have to serialize everything as well
    ASSERT(CritCheckOut(&m_WindowLock));
    ASSERT(CritCheckOut(&m_PaletteLock));

    EXECUTE_ASSERT(RealizePalette(m_hdc) != GDI_ERROR);
    EXECUTE_ASSERT(RealizePalette(m_MemoryDC) != GDI_ERROR);

    return (GdiFlush() == FALSE ? S_FALSE : S_OK);
}


// This is the global window procedure

LRESULT CALLBACK WndProc(HWND hwnd,         // Window handle
                         UINT uMsg,         // Message ID
                         WPARAM wParam,     // First parameter
                         LPARAM lParam)     // Other parameter
{

    // Get the window long that holds our window object pointer
    // If it is NULL then we are initialising the window in which
    // case the object pointer has been passed in the window creation
    // structure.  IF we get any messages before WM_NCCREATE we will
    // pass them to DefWindowProc.

    CBaseWindow *pBaseWindow = (CBaseWindow *)GetWindowLongPtr(hwnd,0);
    if (pBaseWindow == NULL) {

        // Get the structure pointer from the create struct.
        // We can only do this for WM_NCCREATE which should be one of
        // the first messages we receive.  Anything before this will
        // have to be passed to DefWindowProc (i.e. WM_GETMINMAXINFO)

        // If the message is WM_NCCREATE we set our pBaseWindow pointer
        // and will then place it in the window structure

        // turn off WS_EX_LAYOUTRTL style for quartz windows
        if (uMsg == WM_NCCREATE) {
            SetWindowLong(hwnd, GWL_EXSTYLE, GetWindowLong(hwnd, GWL_EXSTYLE) & ~0x400000);
        }

        if ((uMsg != WM_NCCREATE)
            || (NULL == (pBaseWindow = *(CBaseWindow**) ((LPCREATESTRUCT)lParam)->lpCreateParams)))
        {
            return(DefWindowProc(hwnd, uMsg, wParam, lParam));
        }

        // Set the window LONG to be the object who created us
#ifdef DEBUG
        SetLastError(0);  // because of the way SetWindowLong works
#endif
        LONG_PTR rc = SetWindowLongPtr(hwnd, (DWORD) 0, (LONG_PTR) pBaseWindow);
#ifdef DEBUG
        if (0 == rc) {
            // SetWindowLong MIGHT have failed.  (Read the docs which admit
            // that it is awkward to work out if you have had an error.)
            LONG lasterror = GetLastError();
            ASSERT(0 == lasterror);
            // If this is not the case we have not set the pBaseWindow pointer
            // into the window structure and we will blow up.
        }
#endif

    }
    // See if this is the packet of death
    if (uMsg == MsgDestroy && uMsg != 0) {
        pBaseWindow->DoneWithWindow();
        if (pBaseWindow->m_bDoPostToDestroy) {
            EXECUTE_ASSERT(SetEvent((HANDLE)wParam));
        }
        return 0;
    }
    return pBaseWindow->OnReceiveMessage(hwnd,uMsg,wParam,lParam);
}


// When the window size changes we adjust our member variables that
// contain the dimensions of the client rectangle for our window so
// that we come to render an image we will know whether to stretch

BOOL CBaseWindow::OnSize(LONG Width, LONG Height)
{
    m_Width = Width;
    m_Height = Height;
    return TRUE;
}


// This function handles the WM_CLOSE message

BOOL CBaseWindow::OnClose()
{
    ShowWindow(m_hwnd,SW_HIDE);
    return TRUE;
}


// This is called by the worker window thread when it receives a terminate
// message from the window object destructor to delete all the resources we
// allocated during initialisation. By the time the worker thread exits all
// processing will have been completed as the source filter disconnection
// flushes the image pending sample, therefore the GdiFlush should succeed

HRESULT CBaseWindow::UninitialiseWindow()
{
    // Have we already cleaned up

    if (m_hwnd == NULL) {
        ASSERT(m_hdc == NULL);
        ASSERT(m_MemoryDC == NULL);
        return NOERROR;
    }

    // Release the window resources

    EXECUTE_ASSERT(GdiFlush());

    if (m_hdc)
    {
        EXECUTE_ASSERT(ReleaseDC(m_hwnd,m_hdc));
        m_hdc = NULL;
    }

    if (m_MemoryDC)
    {
        EXECUTE_ASSERT(DeleteDC(m_MemoryDC));
        m_MemoryDC = NULL;
    }

    // Reset the window variables
    m_hwnd = NULL;

    return NOERROR;
}


// This is called by the worker window thread after it has created the main
// window and it wants to initialise the rest of the owner objects window
// variables such as the device contexts. We execute this function with the
// critical section still locked. Nothing in this function must generate any
// SendMessage calls to the window because this is executing on the window
// thread so the message will never be processed and we will deadlock

HRESULT CBaseWindow::InitialiseWindow(HWND hwnd)
{
    // Initialise the window variables

    ASSERT(IsWindow(hwnd));
    m_hwnd = hwnd;

    if (m_bDoGetDC)
    {
        EXECUTE_ASSERT(m_hdc = GetDC(hwnd));
        EXECUTE_ASSERT(m_MemoryDC = CreateCompatibleDC(m_hdc));

        EXECUTE_ASSERT(SetStretchBltMode(m_hdc,COLORONCOLOR));
        EXECUTE_ASSERT(SetStretchBltMode(m_MemoryDC,COLORONCOLOR));
    }

    return NOERROR;
}

HRESULT CBaseWindow::DoCreateWindow()
{
    WNDCLASS wndclass;                  // Used to register classes
    BOOL bRegistered;                   // Is this class registered
    HWND hwnd;                          // Handle to our window

    bRegistered = GetClassInfo(m_hInstance,   // Module instance
                               m_pClassName,  // Window class
                               &wndclass);                 // Info structure

    // if the window is to be used for drawing puposes and we are getting a DC
    // for the entire lifetime of the window then changes the class style to do
    // say so. If we don't set this flag then the DC comes from the cache and is
    // really bad.
    if (m_bDoGetDC)
    {
        m_ClassStyles |= CS_OWNDC;
    }

    if (bRegistered == FALSE) {

        // Register the renderer window class

        wndclass.lpszClassName = m_pClassName;
        wndclass.style         = m_ClassStyles;
        wndclass.lpfnWndProc   = WndProc;
        wndclass.cbClsExtra    = 0;
        wndclass.cbWndExtra    = sizeof(CBaseWindow *);
        wndclass.hInstance     = m_hInstance;
        wndclass.hIcon         = NULL;
        wndclass.hCursor       = LoadCursor (NULL, IDC_ARROW);
        wndclass.hbrBackground = (HBRUSH) NULL;
        wndclass.lpszMenuName  = NULL;

        RegisterClass(&wndclass);
    }

    // Create the frame window.  Pass the pBaseWindow information in the
    // CreateStruct which allows our message handling loop to get hold of
    // the pBaseWindow pointer.

    CBaseWindow *pBaseWindow = this;                      // The owner window object
    hwnd = CreateWindowEx(m_WindowStylesEx,               // Extended styles
                          m_pClassName,                   // Registered name
                          TEXT("ActiveMovie Window"),     // Window title
                          m_WindowStyles,                 // Window styles
                          CW_USEDEFAULT,                  // Start x position
                          CW_USEDEFAULT,                  // Start y position
                          DEFWIDTH,                       // Window width
                          DEFHEIGHT,                      // Window height
                          NULL,                           // Parent handle
                          NULL,                           // Menu handle
                          m_hInstance,                    // Instance handle
                          &pBaseWindow);                  // Creation data

    // If we failed signal an error to the object constructor (based on the
    // last Win32 error on this thread) then signal the constructor thread
    // to continue, release the mutex to let others have a go and exit

    if (hwnd == NULL) {
        DWORD Error = GetLastError();
        return AmHresultFromWin32(Error);
    }

    // Check the window LONG is the object who created us
    ASSERT(GetWindowLongPtr(hwnd, 0) == (LONG_PTR)this);

    // Initialise the window and then signal the constructor so that it can
    // continue and then finally unlock the object's critical section. The
    // window class is left registered even after we terminate the thread
    // as we don't know when the last window has been closed. So we allow
    // the operating system to free the class resources as appropriate

    InitialiseWindow(hwnd);

    DbgLog((LOG_TRACE, 2, TEXT("Created window class (%s) HWND(%8.8X)"),
            m_pClassName, hwnd));

    return S_OK;
}


// The base class provides some default handling and calls DefWindowProc

LRESULT CBaseWindow::OnReceiveMessage(HWND hwnd,         // Window handle
                                      UINT uMsg,         // Message ID
                                      WPARAM wParam,     // First parameter
                                      LPARAM lParam)     // Other parameter
{
    ASSERT(IsWindow(hwnd));

    if (PossiblyEatMessage(uMsg, wParam, lParam))
        return 0;

    // This is sent by the IVideoWindow SetWindowForeground method. If the
    // window is invisible we will show it and make it topmost without the
    // foreground focus. If the window is visible it will also be made the
    // topmost window without the foreground focus. If wParam is TRUE then
    // for both cases the window will be forced into the foreground focus

    if (uMsg == m_ShowStageMessage) {

        BOOL bVisible = IsWindowVisible(hwnd);
        SetWindowPos(hwnd, HWND_TOP, 0, 0, 0, 0,
                     SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW |
                     (bVisible ? SWP_NOACTIVATE : 0));

        // Should we bring the window to the foreground
        if (wParam == TRUE) {
            SetForegroundWindow(hwnd);
        }
        return (LRESULT) 1;
    }

    // When we go fullscreen we have to add the WS_EX_TOPMOST style to the
    // video window so that it comes out above any task bar (this is more
    // relevant to WindowsNT than Windows95). However the SetWindowPos call
    // must be on the same thread as that which created the window. The
    // wParam parameter can be TRUE or FALSE to set and reset the topmost

    if (uMsg == m_ShowStageTop) {
        HWND HwndTop = (wParam == TRUE ? HWND_TOPMOST : HWND_NOTOPMOST);
        BOOL bVisible = IsWindowVisible(hwnd);
        SetWindowPos(hwnd, HwndTop, 0, 0, 0, 0,
                     SWP_NOMOVE | SWP_NOSIZE |
                     (wParam == TRUE ? SWP_SHOWWINDOW : 0) |
                     (bVisible ? SWP_NOACTIVATE : 0));
        return (LRESULT) 1;
    }

    // New palette stuff
    if (uMsg == m_RealizePalette) {
        ASSERT(m_hwnd == hwnd);
        return OnPaletteChange(m_hwnd,WM_QUERYNEWPALETTE);
    }

    switch (uMsg) {

        // Repaint the window if the system colours change

    case WM_SYSCOLORCHANGE:

        InvalidateRect(hwnd,NULL,FALSE);
        return (LRESULT) 1;

    // Somebody has changed the palette
    case WM_PALETTECHANGED:

        OnPaletteChange((HWND)wParam,uMsg);
        return (LRESULT) 0;

        // We are about to receive the keyboard focus so we ask GDI to realise
        // our logical palette again and hopefully it will be fully installed
        // without any mapping having to be done during any picture rendering

    case WM_QUERYNEWPALETTE:
        ASSERT(m_hwnd == hwnd);
        return OnPaletteChange(m_hwnd,uMsg);

    // do NOT fwd WM_MOVE. the parameters are the location of the parent
    // window, NOT what the renderer should be looking at.  But we need
    // to make sure the overlay is moved with the parent window, so we
    // do this.
    case WM_MOVE:
        if (IsWindowVisible(m_hwnd)) {
            PostMessage(m_hwnd,WM_PAINT,0,0);
        }
        break;

    // Store the width and height as useful base class members

    case WM_SIZE:

        OnSize(LOWORD(lParam), HIWORD(lParam));
        return (LRESULT) 0;

    // Intercept the WM_CLOSE messages to hide the window

    case WM_CLOSE:

        OnClose();
        return (LRESULT) 0;
    }
    return DefWindowProc(hwnd,uMsg,wParam,lParam);
}


// This handles the Windows palette change messages - if we do realise our
// palette then we return TRUE otherwise we return FALSE. If our window is
// foreground application then we should get first choice of colours in the
// system palette entries. We get best performance when our logical palette
// includes the standard VGA colours (at the beginning and end) otherwise
// GDI may have to map from our palette to the device palette while drawing

LRESULT CBaseWindow::OnPaletteChange(HWND hwnd,UINT Message)
{
    // First check we are not changing the palette during closedown

    if (m_hwnd == NULL || hwnd == NULL) {
        return (LRESULT) 0;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
99视频国产精品| 国产美女精品人人做人人爽 | 一区二区三区中文字幕在线观看| 久久久蜜臀国产一区二区| 精品日韩av一区二区| 欧美一区二区二区| 精品欧美一区二区三区精品久久 | 制服丝袜中文字幕亚洲| 欧美日韩日本视频| 日韩午夜精品视频| www欧美成人18+| 亚洲国产精品高清| 伊人一区二区三区| 丝袜亚洲另类欧美综合| 青青青伊人色综合久久| 久草这里只有精品视频| 大白屁股一区二区视频| 色婷婷久久久久swag精品| 欧美日韩国产在线播放网站| 欧美日韩国产精品成人| 精品美女一区二区三区| 欧美国产精品v| 亚洲午夜在线电影| 精一区二区三区| 成人一区二区三区视频| 欧美在线制服丝袜| 亚洲精品在线三区| 成人免费在线观看入口| 亚洲午夜精品在线| 国产成人鲁色资源国产91色综| 91在线免费看| 精品国产一区二区三区av性色| 国产精品丝袜在线| 日日夜夜免费精品| 99在线精品免费| 欧美一区二区三区免费观看视频 | 色婷婷久久久久swag精品| 欧美一区二区三区婷婷月色| 国产精品久久久久一区| 久久国产精品99久久人人澡| 91色综合久久久久婷婷| 精品久久久久久久久久久久久久久| 国产精品素人视频| 久久99国产精品麻豆| 一本到高清视频免费精品| 欧美成人三级电影在线| 一区二区久久久久| 丁香五精品蜜臀久久久久99网站| 欧美日韩高清在线| 亚洲欧洲性图库| 国产美女av一区二区三区| 欧美日韩精品一区二区三区| 国产精品亲子乱子伦xxxx裸| 欧美aⅴ一区二区三区视频| 在线观看亚洲成人| 亚洲免费在线看| 粉嫩一区二区三区性色av| 欧美本精品男人aⅴ天堂| 亚洲午夜视频在线观看| 97精品久久久久中文字幕| 久久精品亚洲精品国产欧美kt∨| 天天综合日日夜夜精品| 欧美午夜精品一区二区三区| 亚洲女同女同女同女同女同69| 国产成人精品影院| 久久久久国产精品人| 精品一区二区三区免费播放| 日韩一区二区不卡| 美女高潮久久久| 日韩精品资源二区在线| 蜜桃视频一区二区| 精品三级在线看| 精品一区二区综合| 2020国产精品久久精品美国| 久久99热99| 欧美mv和日韩mv国产网站| 另类中文字幕网| 久久亚洲免费视频| 国产精品一区二区三区四区| 精品国产一区二区三区四区四| 美日韩一区二区三区| 欧美成人伊人久久综合网| 韩国精品主播一区二区在线观看 | 精品视频全国免费看| 一区二区三区蜜桃网| 欧美性xxxxxxxx| 视频一区二区中文字幕| 日韩视频免费观看高清在线视频| 男人操女人的视频在线观看欧美| 日韩三级伦理片妻子的秘密按摩| 久久精品国产精品亚洲精品| 国产欧美日产一区| 91在线视频播放地址| 日韩综合一区二区| 精品国免费一区二区三区| 成人av电影免费观看| 亚洲一区二区3| 精品av久久707| 91在线观看成人| 美女视频黄久久| 欧美激情综合五月色丁香小说| 91麻豆成人久久精品二区三区| 亚洲第一福利视频在线| 精品三级av在线| 91国产丝袜在线播放| 久久精品999| 一区二区不卡在线视频 午夜欧美不卡在| 欧美日韩一二区| 国产精品一区二区久久精品爱涩| 亚洲欧美日韩电影| 精品日本一线二线三线不卡| 91免费看`日韩一区二区| 全国精品久久少妇| 中文字幕亚洲区| 欧美精品一区二区三区久久久| 色综合久久久久综合99| 精品亚洲国内自在自线福利| 亚洲丝袜制服诱惑| 亚洲精品在线三区| 色999日韩国产欧美一区二区| 精品一区二区在线免费观看| 亚洲一区二区三区自拍| 国产亚洲精品bt天堂精选| 欧美人牲a欧美精品| 9i在线看片成人免费| 韩国中文字幕2020精品| 午夜电影久久久| 亚洲激情六月丁香| 中国色在线观看另类| 欧美一卡二卡在线| 日本国产一区二区| 成人精品一区二区三区四区| 久久97超碰国产精品超碰| 亚洲丰满少妇videoshd| 自拍偷自拍亚洲精品播放| 久久网这里都是精品| 欧美一级理论性理论a| 欧美主播一区二区三区| 91久久一区二区| 色婷婷av一区二区三区gif| 成人国产精品视频| 国产一区欧美日韩| 蜜乳av一区二区三区| 首页国产欧美久久| 视频一区中文字幕国产| 亚洲高清不卡在线| 亚洲一区二区成人在线观看| 亚洲另类中文字| 亚洲精品中文字幕乱码三区 | 欧美一区三区四区| 欧美日韩国产首页在线观看| 欧美午夜一区二区| 色婷婷久久综合| 欧美系列亚洲系列| 欧美日韩国产综合一区二区| 欧美日韩一区国产| 51久久夜色精品国产麻豆| 欧美精品一卡两卡| 日韩一级片在线播放| 欧美成人精品福利| 久久综合九色综合久久久精品综合| 欧美电影免费观看高清完整版在| 日韩精品在线一区二区| 久久蜜桃一区二区| 久久综合狠狠综合| 日本一区二区久久| 综合久久久久久| 午夜欧美大尺度福利影院在线看| 亚洲高清视频在线| 奇米精品一区二区三区在线观看 | 精品国内二区三区| 国产目拍亚洲精品99久久精品| 中文字幕一区二区三区不卡在线| 一区二区三区四区在线| 亚洲va天堂va国产va久| 久久精品久久精品| a在线欧美一区| 欧美日韩亚洲丝袜制服| 欧美变态tickle挠乳网站| 国产精品毛片大码女人| 亚洲成精国产精品女| 国产一区二区三区四区在线观看| 波多野结衣欧美| 欧美日韩国产另类一区| 国产欧美久久久精品影院| 亚洲激情在线播放| 国产在线乱码一区二区三区| 色综合久久天天综合网| 精品日韩一区二区三区免费视频| 国产精品人人做人人爽人人添| 亚洲成在人线在线播放| 国产在线一区观看| 欧美日韩中字一区| 久久久精品免费观看| 亚洲风情在线资源站| 国产91丝袜在线播放| 在线播放中文一区| 日韩伦理av电影| 国产精品一区二区久久不卡| 欧美日韩久久不卡|