1 /////////////////////////////////////////////////////////////////////////////
2 // Name:        src/msw/dcscreen.cpp
3 // Purpose:     wxScreenDC class
4 // Author:      Julian Smart
5 // Modified by:
6 // Created:     01/02/97
7 // Copyright:   (c) Julian Smart
8 // Licence:     wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
10 
11 // For compilers that support precompilation, includes "wx.h".
12 #include "wx/wxprec.h"
13 
14 
15 #include "wx/msw/dcscreen.h"
16 
17 #ifndef WX_PRECOMP
18    #include "wx/string.h"
19    #include "wx/window.h"
20 #endif
21 
22 #include "wx/msw/private.h"
23 
24 wxIMPLEMENT_ABSTRACT_CLASS(wxScreenDCImpl, wxMSWDCImpl);
25 
26 // Create a DC representing the whole virtual screen (all monitors)
wxScreenDCImpl(wxScreenDC * owner)27 wxScreenDCImpl::wxScreenDCImpl( wxScreenDC *owner ) :
28     wxMSWDCImpl( owner )
29 {
30     m_hDC = (WXHDC) ::GetDC((HWND) NULL);
31 
32     // the background mode is only used for text background and is set in
33     // DrawText() to OPAQUE as required, otherwise always TRANSPARENT
34     ::SetBkMode( GetHdc(), TRANSPARENT );
35 }
36 
37 // Return the size of the whole virtual screen (all monitors)
DoGetSize(int * width,int * height) const38 void wxScreenDCImpl::DoGetSize(int *width, int *height) const
39 {
40     if ( width )
41         *width = ::GetSystemMetrics(SM_CXVIRTUALSCREEN);
42     if ( height )
43         *height = ::GetSystemMetrics(SM_CYVIRTUALSCREEN);
44 }
45