| 437 | } |
| 438 | |
| 439 | LRESULT CWindowsView::OnTimer(UINT, WPARAM id, LPARAM, BOOL&) { |
| 440 | if (id == 1) { |
| 441 | Refresh(); |
| 442 | } |
| 443 | else if (id == 3) { |
| 444 | KillTimer(3); |
| 445 | m_Selected = m_Tree.GetSelectedItem(); |
| 446 | m_SelectedHwnd.Detach(); |
| 447 | auto hWnd = (HWND)m_Selected.GetData(); |
| 448 | if (!::IsWindow(hWnd)) // window is probably destroyed |
| 449 | m_Selected.Delete(); |
| 450 | else { |
| 451 | m_SelectedHwnd.Attach(hWnd); |
| 452 | UpdateList(); |
| 453 | } |
| 454 | } |
| 455 | return 0; |
| 456 | } |
| 457 | |
| 458 | LRESULT CWindowsView::OnNodeExpanding(int, LPNMHDR hdr, BOOL&) { |
| 459 | auto tv = (NMTREEVIEW*)hdr; |