资源简介
Duilib来实现的登录窗口,VS2010开发平台。
功能不多,只为理解程序与xml。
代码片段和文件信息
//2012.10.16 by l0g1n。
#include “stdafx.h“
class CframeWindowWnd:public CWindowWndpublic INotifyUI
{
public:
CframeWindowWnd(){};
LPCTSTR GetWindowClassName() const { return _T(“UIMainframe“); }
void OnPrepare()
{
}
void Notify(TNotifyUI& msg)
{
if(msg.sType==_T(“windowinit“))
OnPrepare();
else if(msg.sType==_T(“click“))
{
if(msg.pSender==m_pCloseBtn)
{
PostQuitMessage(0);
return;
}else if(msg.pSender==m_pRegisterBtn)
{
MessageBox(NULLm_pNameEdit->GetText()+_T(“\n“)+m_pPasswdEdit->GetText()_T(“注册“)MB_OK);
return;
}else if(msg.pSender==m_pLoginBtn)
{
MessageBox(NULLm_pNameEdit->GetText()+_T(“\n“)+m_pPasswdEdit->GetText()_T(“登录“)MB_OK);
return;
}
}
}
void Init()
{
m_pCloseBtn = static_cast(m_pm.FindControl(_T(“closebtn“)));
m_pRegisterBtn=static_cast(m_pm.FindControl(_T(“registerbtn“)));
m_pLoginBtn=static_cast(m_pm.FindControl(_T(“loginbtn“)));
m_pNameEdit=static_cast(m_pm.FindControl(_T(“nameedit“)));
m_pPasswdEdit=static_cast(m_pm.FindControl(_T(“passwdedit“)));
}
LRESULT OnCreate(UINT uMsg WPARAM wParam LPARAM lParam BOOL& bHandled)
{
LONG styleValue = ::GetWindowLong(*this GWL_style);
styleValue &= ~WS_CAPTION;
::SetWindowLong(*this GWL_style styleValue | WS_CLIPSIBLINGS | WS_CLIPCHILDREN);
m_pm.Init(m_hWnd);
//m_pm.SetTransparent(100);
CDialogBuilder builder;
CControlUI* pRoot = builder.Create(_T(“login.xml“) (UINT)0 NULL &m_pm);
ASSERT(pRoot && “Failed to parse xml“);
m_pm.AttachDialog(pRoot);
m_pm.AddNotifier(this);
Init();
return 0;
}
LRESULT OnSize(UINT uMsg WPARAM wParam LPARAM lParam BOOL& bHandled)
{
SIZE szRoundCorner = m_pm.GetRoundCorner();//这个是圆角,是椭圆的半径
//这里有个很巧妙的用法,在xml文件中一定要设置圆角(roundcorner),
//不然不会进入下面的if,也就会出现标题栏。
if( !::IsIconic(*this) && (szRoundCorner.cx != 0 || szRoundCorner.cy != 0) ) {
CRect rcWnd;
::GetWindowRect(*this &rcWnd);
rcWnd.Offset(-rcWnd.left -rcWnd.top);
rcWnd.right++; rcWnd.bottom++;
RECT rc = { rcWnd.left rcWnd.top + szRoundCorner.cx rcWnd.right rcWnd.bottom };
HRGN hRgn1 = ::CreateRectRgnIndirect( &rc );
HRGN hRgn2 = ::CreateRoundRectRgn(rcWnd.left rcWnd.top rcWnd.right rcWnd.bottom - szRoundCorner.cx szRoundCorner.cx szRoundCorner.cy);
::CombineRgn( hRgn1 hRgn1 hRgn2 RGN_OR );
::SetWindowRgn(*this hRgn1 TRUE);
::Deleteobject(hRgn1);
::Deleteobject(hRgn2);
}
bHandled = FALSE;
return 0;
}
LRESULT OnGetMinMaxInfo(UINT uMsg WPARAM wParam LPARAM lParam BOOL& bHandled)
{
MONITORINFO oMonitor = {};
oMonitor.cbSize = sizeof(oMonitor);
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 48640 2012-10-16 21:33 Login\Debug\Login.exe
文件 89467 2012-10-16 16:34 Login\Debug\skin\bk_image.png
文件 2358 2010-01-23 22:10 Login\Debug\skin\fr
文件 2358 2012-10-16 21:18 Login\Debug\skin\fr
文件 2358 2012-10-16 21:17 Login\Debug\skin\fr
文件 1182 2012-10-16 21:30 Login\Debug\skin\login.xm
文件 566 2012-10-16 21:33 Login\Login\Debug\cl.command.1.tlog
文件 15124 2012-10-16 21:33 Login\Login\Debug\CL.read.1.tlog
文件 208 2012-10-16 21:33 Login\Login\Debug\CL.write.1.tlog
文件 2 2012-10-16 21:33 Login\Login\Debug\li
文件 2 2012-10-16 21:33 Login\Login\Debug\li
文件 2 2012-10-16 21:33 Login\Login\Debug\li
文件 2 2012-10-16 21:33 Login\Login\Debug\li
文件 2 2012-10-16 21:33 Login\Login\Debug\li
文件 2 2012-10-16 21:33 Login\Login\Debug\li
文件 1246 2012-10-16 21:33 Login\Login\Debug\li
文件 2502 2012-10-16 21:33 Login\Login\Debug\li
文件 480 2012-10-16 21:33 Login\Login\Debug\li
文件 406 2012-10-16 20:13 Login\Login\Debug\Login.exe.em
文件 472 2012-10-16 20:13 Login\Login\Debug\Login.exe.em
文件 381 2012-10-16 21:33 Login\Login\Debug\Login.exe.intermediate.manifest
文件 44 2012-10-16 21:33 Login\Login\Debug\Login.lastbuildstate
文件 1986 2012-10-16 21:33 Login\Login\Debug\Login.log
文件 64234 2012-10-16 21:33 Login\Login\Debug\login.obj
文件 200 2012-10-16 19:48 Login\Login\Debug\Login_manifest.rc
文件 328 2012-10-16 21:33 Login\Login\Debug\mt.command.1.tlog
文件 222 2012-10-16 21:33 Login\Login\Debug\mt.read.1.tlog
文件 222 2012-10-16 21:33 Login\Login\Debug\mt.write.1.tlog
文件 420 2012-10-16 20:13 Login\Login\Debug\rc.command.1.tlog
文件 194 2012-10-16 20:13 Login\Login\Debug\rc.read.1.tlog
............此处省略66个文件信息
相关资源
- qt4帮助文档——中文版
- duilib界面库,库ListCtrl可以添加check
- RichEditDemo(DuiLib版)
- Google API开发详解源代码Google earth sa
- windows编程实现俄罗斯方块
- ping命令程序设计
- Qt制作的记事本软件
- pthreads-w32-2.9.1-release.zip
- 武汉大学数字图像处理期末实习代码
- 一卡通乘车系统
-
Pla
yer.zip - TFIDF算法实现
- 算法训练营题目合集-已转档.pdf
- 独立任务最优调度问题+算法设计
- funcode——黄金矿工
- 图书馆管理系统程序+全套开发文档系
- windows 程序设计 高清版
- SVM分类算法代码及实验报告
- vc做的小游戏 —— 彩色泡泡
- 五子棋算法比较强悍
- md3loader,导入md3模型源程序
- ARIMA 预测软件
- modbus上位机测试源码
- TradeX.dll 演示程序
- duilib 日历程序
- 人事考勤管理系统
- Canny算子源代码
- VS2017+OpenGL配置所需文件.rar
- ftp源码
- Givens矩阵分解
评论
共有 条评论