VC:状态栏增加时间显示信息
来源:互联网 发布:windows高级编程 pdf 编辑:程序博客网 时间:2024/06/05 20:27
STEP1:在resource 的 string table中,增加IDS_TIMER
STEP2:在indicators[]数组中,增加 IDS_TIMER 项
STEP3:修改如下函数
static UINT indicators[] =
{
ID_SEPARATOR, // status line indicator
IDS_TIMER,
ID_INDICATOR_CAPS,
ID_INDICATOR_NUM,
ID_INDICATOR_SCRL,
};
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
SetTimer(1,1000,NULL);
CTime t=CTime::GetCurrentTime();
CString str=t.Format("%H:%M:%S");
CClientDC dc(this);
CSize sz=dc.GetTextExtent(str);
int index=0;
index=m_wndStatusBar.CommandToIndex(IDS_TIMER);
m_wndStatusBar.SetPaneInfo(index,IDS_TIMER,SBPS_NORMAL,sz.cx);
m_wndStatusBar.SetPaneText(index,str);
}
void CMainFrame::OnTimer(UINT nIDEvent)
{
// TODO: Add your message handler code here and/or call default
CTime t=CTime::GetCurrentTime();
CString str=t.Format("%H:%M:%S");
CClientDC dc(this);
CSize sz=dc.GetTextExtent(str);
m_wndStatusBar.SetPaneInfo(1,IDS_TIMER,SBPS_NORMAL,sz.cx);
m_wndStatusBar.SetPaneText(1,str);
CFrameWnd::OnTimer(nIDEvent);
}
说明:
m_wndStatusBar.SetPaneInfo(index,IDS_TIMER,SBPS_NORMAL,sz.cx);
上面函数的功能,是使显示的窗口与内容相符。否则,显示内容可能不全。
- VC:状态栏增加时间显示信息
- vc在状态栏显示时间
- 在状态栏显示信息
- 状态栏显示逗留时间
- 状态栏显示时间
- c#状态栏显示时间
- js 状态栏显示时间
- MFC状态栏显示时间
- rcp 状态栏 显示时间
- 状态栏时间显示年月日
- MFC状态栏显示时间
- VC++在状态栏显示时钟
- VC 显示 隐藏 工具栏 状态栏
- 在MFC状态栏显示时间
- 状态栏的时间显示(javascript)
- 在状态栏添加时间显示
- 在MFC状态栏显示时间
- 在MFC状态栏显示时间
- 万能数据库查询分析器与EXCEL强强联合进行数据分析
- memset函数详细说明 http://blog.csdn.net/yangsen2016/article/details/1638503
- win7下笔记本玩游戏不能全屏的解决
- base-kernel-memory-伙伴系统
- application、session、request、cookie
- VC:状态栏增加时间显示信息
- 人生百岁几人得,珍惜在世每一天
- 移动web设计&开发45大实用指南
- DOS命令 批量文件备份
- android 把图片生成圆角
- 查找最新添加数据
- android查看异常技巧
- Android 开发学习笔记 (一)
- VC:增加新的工具栏