void SetupTLBWindow (HWND hDlg) { LV_COLUMN col; DWORD X, Y; col.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM; col.fmt = LVCFMT_LEFT; col.pszText = "Index"; col.cx = 40; col.iSubItem = 0; ListView_InsertColumn ( GetDlgItem(hDlg,IDC_LIST), 0, &col); col.pszText = "Page Mask"; col.cx = 90; col.iSubItem = 1; ListView_InsertColumn ( GetDlgItem(hDlg,IDC_LIST), 1, &col); col.pszText = "Entry Hi"; col.cx = 90; col.iSubItem = 2; ListView_InsertColumn ( GetDlgItem(hDlg,IDC_LIST), 2, &col); col.pszText = "Entry Lo0"; col.cx = 90; col.iSubItem = 3; ListView_InsertColumn ( GetDlgItem(hDlg,IDC_LIST), 3, &col); col.pszText = "Entry Lo1"; col.cx = 90; col.iSubItem = 4; ListView_InsertColumn ( GetDlgItem(hDlg,IDC_LIST), 4, &col); col.pszText = "Index"; col.cx = 40; col.iSubItem = 0; ListView_InsertColumn ( GetDlgItem(hDlg,IDC_LIST2), 0, &col); col.pszText = "Valid"; col.cx = 40; col.iSubItem = 1; ListView_InsertColumn ( GetDlgItem(hDlg,IDC_LIST2), 1, &col); col.pszText = "Dirty"; col.cx = 40; col.iSubItem = 2; ListView_InsertColumn ( GetDlgItem(hDlg,IDC_LIST2), 2, &col); col.pszText = "Rule"; col.cx = 280; col.iSubItem = 3; ListView_InsertColumn ( GetDlgItem(hDlg,IDC_LIST2), 3, &col); RefreshTLBWindow(); SendMessage(GetDlgItem(hDlg,IDC_TLB_ENTRIES),BM_SETCHECK, BST_CHECKED,0); if (GetStoredWinPos( "TLB Window", &X, &Y )) { SetWindowPos(hDlg,NULL,X,Y,0,0, SWP_NOZORDER | SWP_NOSIZE | SWP_SHOWWINDOW); } }
LRESULT CDebugTlb::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) { LV_COLUMN col; col.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM; col.fmt = LVCFMT_LEFT; col.pszText = "Index"; col.cx = 40; col.iSubItem = 0; ListView_InsertColumn(GetDlgItem(IDC_LIST), 0, &col); col.pszText = "Page Mask"; col.cx = 90; col.iSubItem = 1; ListView_InsertColumn(GetDlgItem(IDC_LIST), 1, &col); col.pszText = "Entry Hi"; col.cx = 90; col.iSubItem = 2; ListView_InsertColumn(GetDlgItem(IDC_LIST), 2, &col); col.pszText = "Entry Lo0"; col.cx = 90; col.iSubItem = 3; ListView_InsertColumn(GetDlgItem(IDC_LIST), 3, &col); col.pszText = "Entry Lo1"; col.cx = 90; col.iSubItem = 4; ListView_InsertColumn(GetDlgItem(IDC_LIST), 4, &col); col.pszText = "Index"; col.cx = 40; col.iSubItem = 0; ListView_InsertColumn(GetDlgItem(IDC_LIST2), 0, &col); col.pszText = "Valid"; col.cx = 40; col.iSubItem = 1; ListView_InsertColumn(GetDlgItem(IDC_LIST2), 1, &col); col.pszText = "Dirty"; col.cx = 40; col.iSubItem = 2; ListView_InsertColumn(GetDlgItem(IDC_LIST2), 2, &col); col.pszText = "Rule"; col.cx = 270; col.iSubItem = 3; ListView_InsertColumn(GetDlgItem(IDC_LIST2), 3, &col); RefreshTLBWindow(); SendMessage(GetDlgItem(IDC_TLB_ENTRIES), BM_SETCHECK, BST_CHECKED, 0); // if (Settings().Load(TLBWindowLeft) <= 0) // { // SetWindowPos(NULL,Settings().Load(TLBWindowLeft),Settings().Load(TLBWindowTop),0,0, SWP_NOZORDER | SWP_NOSIZE | SWP_SHOWWINDOW); // } WindowCreated(); return TRUE; }