MCPcopy Create free account
hub / github.com/KangLin/RabbitRemoteControl / CDesktopWindows

Method CDesktopWindows

Service/DesktopWindows.cpp:42–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40Q_LOGGING_CATEGORY(logDW, "DesktopWindows")
41
42CDesktopWindows::CDesktopWindows(QObject *parent) : CDesktop(parent)
43{
44 m_DC = GetDesktopDC();
45 m_MemDC = NULL;
46 m_Bitmap = m_DesktopBitmap = NULL;
47 m_Width = m_Height = 0;
48
49 m_MemDC = CreateCompatibleDC(m_DC);
50 if(m_MemDC)
51 {
52 m_DesktopBitmap = CreateCompatibleBitmap(m_DC, Width(), Height());
53 if(NULL == m_DesktopBitmap)
54 qCritical(logDW,
55 "CreateCompatibleBitmap fail: %d",
56 GetLastError());
57 } else
58 qCritical(logDW,
59 "CreateCompatibleDC fail: %d",
60 GetLastError());
61
62 if(m_DesktopBitmap)
63 {
64 HGDIOBJ oldBitmap = SelectObject(m_MemDC, m_DesktopBitmap);
65 if(NULL == oldBitmap)
66 qCritical(logDW, "SelectObject fail: %d", GetLastError());
67
68 m_Desktop = QImage(Width(), Height(), QImage::Format_ARGB32);
69 }
70}
71
72CDesktopWindows::~CDesktopWindows()
73{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected