-
Notifications
You must be signed in to change notification settings - Fork 38
/
PluginDlg.cpp
113 lines (97 loc) · 2.48 KB
/
PluginDlg.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
// PluginDlg.cpp : implementation file
//
#include "stdafx.h"
#include "WebRobot.h"
#include "PluginDlg.h"
#include "WebRobotDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
extern CWebRobotDlg* g_pWebRobotDlg;
/////////////////////////////////////////////////////////////////////////////
// CPluginDlg dialog
IMPLEMENT_DYNCREATE(CPluginDlg, CDialog)
CPluginDlg::CPluginDlg(CWnd* pParent /*=NULL*/)
: CDialog(CPluginDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CPluginDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CPluginDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CPluginDlg)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CPluginDlg, CDialog)
//{{AFX_MSG_MAP(CPluginDlg)
ON_WM_SIZE()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CPluginDlg message handlers
BOOL CPluginDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
__inline VOID MyOutputDebugString(LPCTSTR ptzFormat, ...)
{
va_list vlArgs;
TCHAR tzText[1024];
va_start(vlArgs, ptzFormat);
wvsprintf(tzText, ptzFormat, vlArgs);
OutputDebugString(tzText);
va_end(vlArgs);
}
void CPluginDlg::OnSize(UINT nType, int cx, int cy)
{
CDialog::OnSize(nType, cx, cy);
// TODO: Add your message handler code here
HWND hWnd = ::FindWindowEx(this->m_hWnd, NULL, "#32770", "");
if (hWnd != NULL)
{
if (::IsWindowVisible(hWnd))
{
if (g_pWebRobotDlg->m_TabCtrl.m_hWnd != NULL)
{
RECT rc;
g_pWebRobotDlg->m_TabCtrl.GetClientRect(&rc);
rc.top += 2;
MoveWindow(&rc);
::PostMessage(hWnd, WM_SIZE, 0, 0);
}
}
}
}
PreTM m_PreTM = NULL;//导出函数指针
BOOL CPluginDlg::PreTranslateMessage(MSG* pMsg)
{
// TODO: Add your specialized code here and/or call the base class
if (m_PreTM != NULL)
{
if(m_PreTM(pMsg))
return true;
}
if (pMsg->message == WM_KEYDOWN)
{
int nVirtKey = (int)pMsg->wParam;
if (nVirtKey == VK_RETURN)
{
//如果是回车在这里做你要做的事情,或者什么也不作
return TRUE;
}
else if (nVirtKey == VK_ESCAPE)
{
//如果是ESC在这里做你要做的事情,或者什么也不作
return TRUE;
}
}
return CDialog::PreTranslateMessage(pMsg);
}