读书人

在状态栏内显示图片,该如何处理

发布时间: 2012-01-18 00:23:26 作者: rapoo

在状态栏内显示图片
BOOL CGobangView::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
{
// TODO: Add your message handler code here and/or call default
if (nHitTest == HTCLIENT)
{
if (m_turn)
{
CMainFrame * myframe = (CMainFrame *)AfxGetApp()-> m_pMainWnd;
CStatusBar *pStaB = &myframe-> m_wndStatusBar;

if (pStaB)
{

pStaB-> GetStatusBarCtrl().SetIcon(0, AfxGetApp()-> LoadCursor(IDI_BLACK)); //这个IDI_BLACK图片就是不能在StatusBar中显示
pStaB-> SetPaneText(0, "黑棋下 "); //这里的文字可以在StatusBar中显示

}
SetCursor(m_blackCur);
}


为什么文字可以显示,图片不能显示,我哪里错了?

[解决办法]
要么放在状态栏的两个不同Pane中,要么自绘。

读书人网 >VC/MFC

热点推荐