i have used DrawText() to display time init.i have used DT_CENTER which is display time in center even if window is minimised or maximised.

but how to display it to right side of window but not on the minimise,maximise and close buttons.

i tried DT_RIGHT =it is displaying on those 3 buttons (minimise,maximise and close buttons)

 	     void CMainFrame::OnTimer(UINT_PTR nIDEvent)
	         HWND hWnd;
                 hWnd = ::GetForegroundWindow();
	         CWnd *pWnd;
	         pWnd = CWnd::FromHandle(hWnd);
	         CTime Time = CTime::GetCurrentTime();
	         CString strTime=Time.Format("%H:%M:%S");

	         CWindowDC dc(this);
                 CRect rect;


also i am not able to display time on ActiveWIndow (GetForegroundWindow()) if i use DrawText() .

If i use pWnd->SetWindowText(strTime) ,time is displayed on ActiveWindow(GetForegroundWindow()).

what is the problem.
plzzzzzz help me solve this problem

Last edited by shabbir; 22Jan2010 at 08:13.. Reason: Code blocks