CreateStatusWindow Creates a status window, which is typically used to display the status of an application. The window generally appears at the bottom of the parent window, and it contains the specified text. HWND CreateStatusWindow( LONG style, LPCTSTR lpszText, HWND hwndParent, UINT wID );
创建工具栏窗体CreateToolbarEx
设置参数
主程序处理消息如zPerry(旧日重来) 所说,Platform SDK\user interface services\shell and common control\下有详尽说明
if (!m_wndtoolbar.CreateEx(this,
TBSTYLE_FLAT,
WS_CHILD | WS_VISIBLE | CBRS_ALIGN_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS,
CRect(0,3,0,0))
|| !m_wndtoolbar.LoadToolBar(IDR_TOOLBAR_MAIN))
{
TRACE0("创建工具栏出错!\n");
return false;
}
m_wndtoolbar.ShowWindow(SW_SHOW);
//添加控制状态栏
if (!m_wndStatusBar.Create(this)
|| !m_wndStatusBar.SetIndicators(indicators,
sizeof(indicators)/sizeof(UINT)))
{
TRACE0("创建状态栏出错!\n");
return false;
}
m_wndStatusBar.ShowWindow(SW_SHOW); RepositionBars(AFX_IDW_CONTROLBAR_FIRST, AFX_IDW_CONTROLBAR_LAST, 0);
必须先声明m_wndStatusBar和m_wndtoolbar对象
工具栏还应该先创建工具栏资源。
Creates a status window, which is typically used to display the status of an application. The window generally appears at the bottom of the parent window, and it contains the specified text. HWND CreateStatusWindow(
LONG style,
LPCTSTR lpszText,
HWND hwndParent,
UINT wID
);