CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/external/source/vncdll/winvnc/SharedDesktopArea.h
Views: 11777
1
// Copyright (C) 2004-2006 TightVNC Group. All Rights Reserved.
2
//
3
// TightVNC is free software; you can redistribute it and/or modify
4
// it under the terms of the GNU General Public License as published by
5
// the Free Software Foundation; either version 2 of the License, or
6
// (at your option) any later version.
7
//
8
// This program is distributed in the hope that it will be useful,
9
// but WITHOUT ANY WARRANTY; without even the implied warranty of
10
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
// GNU General Public License for more details.
12
//
13
// You should have received a copy of the GNU General Public License
14
// along with this program; if not, write to the Free Software
15
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
16
// USA.
17
//
18
// TightVNC homepage on the Web: http://www.tightvnc.com/
19
20
// SharedDesktopArea.h: interface for the SharedDesktopArea class.
21
22
#ifndef SHAREDDESKTOPAREA_H__
23
#define SHAREDDESKTOPAREA_H__
24
25
class SharedDesktopArea;
26
27
#include "resource.h"
28
29
#include "vncServer.h"
30
#include "vncProperties.h"
31
#include "MatchWindow.h"
32
33
class SharedDesktopArea
34
{
35
public:
36
SharedDesktopArea(HWND hwnd, CMatchWindow *matchwindow, vncServer *server);
37
virtual ~SharedDesktopArea();
38
39
void Validate();
40
bool Apply();
41
42
protected:
43
// FIXME: hwndShared instead of hWnd argument?
44
void SetWindowCaption(HWND hWnd);
45
46
private:
47
void Init();
48
void SetupMatchWindow();
49
static void DrawFrameAroundWindow(HWND hWnd);
50
static LRESULT CALLBACK BmpWndProc(HWND, UINT, WPARAM, LPARAM);
51
52
void EnableWinSelectionControls(BOOL bEnable, LPCTSTR szWinText);
53
54
inline void Enable(int id, BOOL enable) {
55
EnableWindow(GetDlgItem(m_hwnd, id), enable);
56
}
57
inline void SetChecked(int id, BOOL checked) {
58
SendDlgItemMessage(m_hwnd, id, BM_SETCHECK, checked, 0);
59
}
60
inline BOOL IsChecked(int id) {
61
return (SendDlgItemMessage(m_hwnd, id, BM_GETCHECK, 0, 0) == BST_CHECKED);
62
}
63
inline void SetText(int id, LPCTSTR szText) {
64
::SetWindowText(GetDlgItem(m_hwnd, id), szText);
65
}
66
67
HWND m_hwnd;
68
LONG m_OldBmpWndProc;
69
BOOL m_bCaptured;
70
HWND m_KeepHandle;
71
HWND m_hwndShared;
72
vncServer *m_server;
73
74
CMatchWindow *m_pMatchWindow;
75
bool m_deleteMatchWindow;
76
};
77
78
#endif
79
80