📄 baseminiframe.cpp
字号:
// BaseMiniFrame.cpp : implementation file
//
#include "stdafx.h"
#include "VisualJava.h"
#include "BaseMiniFrame.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CBaseMiniFrame
IMPLEMENT_DYNCREATE(CBaseMiniFrame, CMiniFrameWnd)
CBaseMiniFrame::CBaseMiniFrame()
{
}
CBaseMiniFrame::~CBaseMiniFrame()
{
}
BEGIN_MESSAGE_MAP(CBaseMiniFrame, CMiniFrameWnd)
//{{AFX_MSG_MAP(CBaseMiniFrame)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CBaseMiniFrame message handlers
void CBaseMiniFrame::MouseClick(CPoint pt)
{
CPoint point(pt);
//ScreenToClient(&point);
CRect rcWindow;
GetWindowRect(rcWindow);
if(!rcWindow.PtInRect(point))
SendMessage(WM_CLOSE);
}
BOOL CBaseMiniFrame::Create(CWnd* pWndParent,int x,int y)
{
static CString strClassName;
CPoint ptLocation;
if(strClassName.IsEmpty ())
{
strClassName = ::AfxRegisterWndClass (
CS_SAVEBITS,
::LoadCursor(NULL, IDC_ARROW),
(HBRUSH)(COLOR_BTNFACE + 1), NULL);
}
if(x == -1 && y == -1) // Undefined position
{
if (pWndParent != NULL)
{
CRect rectParent;
pWndParent->GetClientRect (&rectParent);
pWndParent->ClientToScreen (&rectParent);
ptLocation = CPoint (rectParent.left + 5, rectParent.top + 5);
}
else
{
ptLocation = CPoint (0, 0);
}
}
else
{
ptLocation = CPoint (x, y);
}
DWORD dwStyle = WS_POPUP|WS_BORDER;//| WS_SYSMENU|WS_CAPTION;
/**
if (m_pMenuCustomizationPage != NULL)
{
dwStyle |= (WS_CAPTION | WS_SYSMENU);
}
BOOL bIsAnimate = (m_AnimationType != NO_ANIMATION) &&
!CBCGToolBar::IsCustomizeMode ();
**/
CRect rect(x, y,x+200, y+200);
pWndParent->ClientToScreen(rect);
BOOL bCreated = CMiniFrameWnd::CreateEx (
0,
strClassName,_T(""),
dwStyle, rect,
pWndParent->GetOwner() == NULL ?
pWndParent : pWndParent->GetOwner());
if(!bCreated)
return FALSE;
//ShowWindow(SW_SHOWNOACTIVATE);
return TRUE;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -