📄 geodropwin.cpp
字号:
// GeoDropWin.cpp : implementation file
//
#include "stdafx.h"
#include "MyInsaneBT.h"
#include "GeoDropWin.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CGeoDropWin
CGeoDropWin::CGeoDropWin()
{
m_dropView = NULL;
}
CGeoDropWin::~CGeoDropWin()
{
if(m_dropView != NULL)
{
delete m_dropView;
}
}
BEGIN_MESSAGE_MAP(CGeoDropWin, CWnd)
//{{AFX_MSG_MAP(CGeoDropWin)
ON_WM_SIZE()
ON_WM_NCDESTROY()
ON_WM_ERASEBKGND()
// NOTE - the ClassWizard will add and remove mapping macros here.
//}}AFX_MSG_MAP
ON_MESSAGE(WM_DROPWINPOS,OnDropWnd)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CGeoDropWin message handlers
//创建drop窗体
BOOL CGeoDropWin::CreateNew(CRect rect,CWnd* pParentWnd,UINT nID,UINT nIDMenu,DWORD dwExStyle,DWORD dwStyle)
{
ASSERT_VALID(pParentWnd);
m_ParentWnd = pParentWnd;
m_szClassName = AfxRegisterWndClass(NULL);
BOOL bReturn=CreateEx(dwExStyle,m_szClassName,NULL,dwStyle,rect.left,rect.top,rect.right,rect.bottom,NULL,NULL);
return bReturn;
}
void CGeoDropWin::OnSize(UINT nType, int cx, int cy)
{
CWnd::OnSize(nType,cx,cy);
}
void CGeoDropWin::OnNcDestroy()
{
delete this;
CWnd::OnNcDestroy();
}
BOOL CGeoDropWin::OnEraseBkgnd(CDC* pDC)
{
// TODO: Add your message handler code here and/or call default
CRect rect;
GetClientRect(&rect);
CBrush brush(RGB(255,255,255));
pDC->FillRect(&rect,&brush);
return CWnd::OnEraseBkgnd(pDC);
}
BOOL CGeoDropWin::CreateView()
{
CRect nRect;
GetClientRect(nRect);
nRect.top +=0;
nRect.left+=0;
nRect.right-=0;
nRect.bottom-=0;
m_dropView =new CGeoDropView();
BOOL bReturn=m_dropView->CreateView(m_szClassName,nRect,this,1000);
if(bReturn)
{
m_dropView->ShowWindow(SW_SHOW);
return TRUE;
}
return FALSE;
}
void CGeoDropWin::OnDropWnd(WPARAM wParam,LPARAM lParam)
{
CPoint* point = (CPoint*)lParam;
m_x= point->x;
m_y= point->y;
SetWindowPos(&CWnd::wndTopMost,m_x,m_y,0,0,SWP_NOSIZE|SWP_NOACTIVATE|SWP_NOZORDER);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -