资源简介
VC 类似迅雷的悬浮窗 源码
很好很强大的,对vc学习很有帮助
代码片段和文件信息
//Download by http://www.NewXing.com
// FloatWnd.cpp : implementation file
//
#include “stdafx.h“
#include “Main.h“
#include “FloatWnd.h“
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CFloatWnd dialog
CFloatWnd::CFloatWnd(CWnd* pParent /*=NULL*/)
: CDialog(CFloatWnd::IDD pParent)
{
//{{AFX_DATA_INIT(CFloatWnd)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CFloatWnd::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CFloatWnd)
DDX_Control(pDX IDC_LOGO m_Logo);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CFloatWnd CDialog)
//{{AFX_MSG_MAP(CFloatWnd)
ON_WM_NCHITTEST()
ON_WM_RBUTTONUP()
ON_COMMAND(ID_EXIT OnExit)
ON_COMMAND(ID_SHOW OnShow)
ON_WM_NCLBUTTONDBLCLK()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CFloatWnd message handlers
BOOL CFloatWnd::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
CBitmap m_Bitmap;
HBITMAP hBitmap = m_Logo.GetBitmap();
ASSERT(hBitmap);
m_Bitmap.Attach(hBitmap);
BITMAP bmp;
m_Bitmap.GetBitmap(&bmp);
int nX = bmp.bmWidth;
int nY = bmp.bmHeight;
MoveWindow(00nXnY);
m_Logo.MoveWindow(00nXnY);
CenterWindow();
::SetWindowPos(m_hWndHWND_TOPMOST0000SWP_NOMOVE | SWP_NOSIZE);
m_Bitmap.Detach();
//加入WS_EX_layerED扩展属性
SetWindowLong(m_hWndGWL_EXstyleGetWindowLong(this->GetSafeHwnd()GWL_EXstyle)^0x80000);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
UINT CFloatWnd::OnNcHitTest(CPoint pt)
{
UINT nHitTest = CDialog::OnNcHitTest(pt);
if (nHitTest == HTCLIENT &&
::GetAsyncKeyState(MK_LBUTTON) < 0) // 如果鼠标左键按下,GetAsyncKeyState函数的返回值小于0
nHitTest = HTCAPTION;
return nHitTest;
}
void CFloatWnd::OnOK()
{
// TODO: Add extra cleanup here
//OnOK();
}
void CFloatWnd::OnCancel()
{
// TODO: Add extra cleanup here
// CDialog::OnCancel();
}
void CFloatWnd::OnRButtonUp(UINT nFlags CPoint point)
{
// TODO: Add your message handler code here and/or call default
CMenu m_Right;
m_Right.LoadMenu(IDR_MENU1);
CMenu *pSub = m_Right.GetSubMenu(0);
ClientToScreen(&point);
pSub->TrackPopupMenu(TPM_LEFTALIGNpoint.xpoint.ythisNULL);
CDialog::OnRButtonUp(nFlags point);
}
void CFloatWnd::OnExit()
{
// TODO: Add your command handler code here
CWnd *pParent = GetParent();
ASSERT(pParent);
pParent->PostMessage(WM_QUIT00);
}
void CFloatWnd::OnShow()
{
// TODO: Add your command handler code here
CWnd *pParent = GetParent();
ASSERT(pParent);
if(pParent->IsWindowVisible())
pParent->ShowWindow(SW_HIDE);
else
pPar
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
....... 34064 2009-05-02 16:30 www.NewXing.com\FloatWnd\Main.aps
....... 12342 2007-12-09 23:26 www.NewXing.com\FloatWnd\logo.bmp
....... 1540 2009-05-02 16:30 www.NewXing.com\FloatWnd\Main.clw
文件 3797 2011-07-11 16:29 www.NewXing.com\FloatWnd\FloatWnd.cpp
文件 2072 2011-07-11 16:29 www.NewXing.com\FloatWnd\Main.cpp
文件 5569 2011-07-11 16:29 www.NewXing.com\FloatWnd\MainDlg.cpp
文件 244 2011-07-11 16:29 www.NewXing.com\FloatWnd\StdAfx.cpp
....... 4313 2007-12-09 21:49 www.NewXing.com\FloatWnd\Main.dsp
....... 531 2007-12-09 21:23 www.NewXing.com\FloatWnd\Main.dsw
文件 1510 2011-07-11 16:29 www.NewXing.com\FloatWnd\FloatWnd.h
文件 1337 2011-07-11 16:29 www.NewXing.com\FloatWnd\Main.h
文件 1522 2011-07-11 16:29 www.NewXing.com\FloatWnd\MainDlg.h
文件 1089 2011-07-11 16:29 www.NewXing.com\FloatWnd\resource.h
文件 1092 2011-07-11 16:29 www.NewXing.com\FloatWnd\StdAfx.h
....... 1078 2007-12-09 21:23 www.NewXing.com\FloatWnd\res\Main.ico
....... 53760 2009-05-02 16:30 www.NewXing.com\FloatWnd\Main.opt
....... 1632 2009-05-02 16:30 www.NewXing.com\FloatWnd\Main.plg
....... 6351 2007-12-10 08:30 www.NewXing.com\FloatWnd\Main.rc
....... 396 2007-12-09 21:23 www.NewXing.com\FloatWnd\res\Main.rc2
....... 3543 2007-12-09 21:23 www.NewXing.com\FloatWnd\ReadMe.txt
目录 0 2007-12-10 00:03 www.NewXing.com\FloatWnd\res
目录 0 2011-07-11 16:29 www.NewXing.com\FloatWnd
----------- --------- ---------- ----- ----
137782 22
相关资源
- SoCKit_RevC.pdf
- 机械革命ALC269VC带低音炮机型黑苹果仿
- 台达PLC通信程序VC
- VC-easyx绘图游戏简易教程
- 国密sm2算法c实现
- 传智播客 最新版淘淘商城视频教程及
- .NET MVC 中使用 kindeditor 中图片上传和
- vmware vsphere7.0全套
- VMware vsphere 6.7.0
- SSM完整框架
- 2015_MLDN_mybatis_hibernate_springmvc_等视频
- maven+springMVC集成的neo4j
- 打印模板工具
- MVC外文文獻中文翻译对照毕设论文翻
- CAN-通信vc通讯源代码
- springMVC+多线程+kafka的 demo基于maven
- springmvc+poi 导入导出文件controller以及
- unity基于MVC的ui框架
- VCE文件教程
- 车辆管理系统(vc下可运行)
- hevc测试序列
- 排课表程序拓扑排序
- vc rdp远程桌面代填密码
- RTL8214FC-VC-CG规格书
- 一种基于TMS320VC5509的音频采集与回放
- VC用HOOK拦截数据包的
- ge VC opc server
- vc 内存中加载运行exe
- VC ++ Gzip解压缩代码
- 图像识别vc代码,验证码识别
评论
共有 条评论