| 36 | } |
| 37 | |
| 38 | void CDateTimeWnd::Init(CDateTimeUI* pOwner) |
| 39 | { |
| 40 | m_pOwner = pOwner; |
| 41 | m_pOwner->m_nDTUpdateFlag = DT_NONE; |
| 42 | |
| 43 | if (m_hWnd == NULL) |
| 44 | { |
| 45 | RECT rcPos = CalPos(); |
| 46 | UINT uStyle = WS_CHILD; |
| 47 | Create(m_pOwner->GetManager()->GetPaintWindow(), NULL, uStyle, 0, rcPos); |
| 48 | SetWindowFont(m_hWnd, m_pOwner->GetManager()->GetFontInfo(m_pOwner->GetFont())->hFont, TRUE); |
| 49 | } |
| 50 | |
| 51 | if (m_pOwner->GetText().IsEmpty()) |
| 52 | ::GetLocalTime(&m_pOwner->m_sysTime); |
| 53 | |
| 54 | ::SendMessage(m_hWnd, DTM_SETSYSTEMTIME, 0, (LPARAM)&m_pOwner->m_sysTime); |
| 55 | ::ShowWindow(m_hWnd, SW_SHOWNOACTIVATE); |
| 56 | ::SetFocus(m_hWnd); |
| 57 | |
| 58 | m_bInit = true; |
| 59 | } |
| 60 | |
| 61 | RECT CDateTimeWnd::CalPos() |
| 62 | { |
no test coverage detected