SOL9 2.0 Class: ClientDC

 SOL9 C++ Class Library  SOL9 Samples  SOL9 Tutorial  SOL9 FAQ  SOL9 ClassTree 

Source code

/*
 * ClientDC.h 
 * Copyright (c) 2011 Antillia.com TOSHIYUKI ARAI. ALL RIGHTS RESERVED. 
 */


// SOL++2000
// 2000.02.18
#pragma once

//#include <sol\View.h>
#include <sol\Window.h>

#include <sol\DC.h>

namespace SOL {

class ClientDC :public DC {
private:
    HWND hwnd;

public:
    ClientDC(Window* view)
        :hwnd(NULL)
    {
        if(view) {
            hwnd = view -> getWindow();
            set(::GetDC(hwnd));
        }
    }
    
public:
    ClientDC(Window* view, HRGN clipRgn, DWORD flags)
        :hwnd(NULL)
    {
        if(view) {
            hwnd  = view -> getWindow();
            set(::GetDCEx(hwnd, clipRgn, flags));
        }
    }

public:
    ~ClientDC() {
        ::ReleaseDC(hwnd, get());
    }
};

}



Last modified: 1 Feb 2012

Copyright (c) 2009-2012 Antillia.com ALL RIGHTS RESERVED.