1 - Build MFC application single document and chose not to select printing and printing preview
2 - Add resource element in the View menu chose resource simbols and New and name it ID_TIMEARRAY
3-Add handlers in the CmainFrame for ID_VIEW_STATUS_BAR and update handler for it,
4-Replace the previously created indicators array with 3 ID_SEPARATOR to hold second minutes and hours respectively and make m_wndStatusBar data member public instead of private .
5- Replace if (!m_wndStatusBar.Create(this) with this, WS_CHILD | WS_VISIBLE | CBRS_BOTTOM, ID_TIMEARRAY) ;so as not to use the default status bar .
6-
void CMainFrame::OnViewStatusBar()8- ADd the following code to OnLbuttonDown handler in your view class
{
m_wndStatusBar.ShowWindow((m_wndStatusBar.GetStyle() &
WS_VISIBLE) == 0);
RecalcLayout();
}
void CMainFrame::OnUpdateViewStatusBar(CCmdUI* pCmdUI)
{
pCmdUI->SetCheck((m_wndStatusBar.GetStyle() & WS_VISIBLE) != 0);
} in mainframe.cpp
7- Add the following function OnDraw to your View class pDC->TextOut(30, 30 ,Press the left key to see your computer current time on the status bar ");
and add #include "MainFrm.h" near the top of your view class
CTime currenttime = GetCurrentTime();
int sec , min , hours ;
hours = currenttime.GetHour();
min = currenttime.GetMinute();
sec = currenttime.GetSecond();
CMainFrame* pFrame = (CMainFrame*) AfxGetApp()->m_pMainWnd;
CStatusBar* pStatus = &pFrame->m_wndStatusBar;
CStringArray timearray ;
timearray.SetSize(3);
CString strsec ,strmin ,strhours ;
strsec.Format("%d ",sec);
strmin.Format("%d " , min);
strhours.Format("%d " ,hours );
timearray[0] = strsec ;
timearray[1] = strmin ;
timearray[2] = strhours ;
pStatus->SetPaneText(0, timearray[0]);
pStatus->SetPaneText(1 ,timearray[1] );
pStatus->SetPaneText(2 ,timearray[2]);
to download the whole project clock here
to download the Exe file click here
please give example of array with CString only...
ReplyDeleteoakley sunglasses, polo ralph lauren outlet, tiffany jewelry, nike roshe run, louboutin pas cher, tiffany and co, kate spade outlet, oakley sunglasses, oakley sunglasses, nike free, louboutin outlet, prada outlet, christian louboutin outlet, tory burch outlet, ray ban sunglasses, jordan shoes, louis vuitton, longchamp outlet, ralph lauren pas cher, louis vuitton outlet, ugg boots, longchamp pas cher, ray ban sunglasses, oakley sunglasses, replica watches, polo ralph lauren outlet, uggs on sale, air max, louis vuitton outlet, michael kors, louis vuitton, prada handbags, longchamp, nike free, chanel handbags, sac longchamp, burberry, louis vuitton, nike air max, gucci outlet, nike outlet, louboutin, ugg boots, nike air max, replica watches, air jordan pas cher, ray ban sunglasses, louboutin shoes, longchamp outlet, cheap oakley sunglasses
ReplyDeletesee here now look at these guys other pop over to these guys Our site Dior Dolabuy
ReplyDeletesupreme clothing
ReplyDeleteoff white hoodie
off white jordan
off white
yeezy
bapesta shoes
goyard bag
bape
kd 12
goyard bags