| 102 | #define COLUMN_STATE_SIZE 0.49f |
| 103 | |
| 104 | void CMyListCtrl::Initialize(void) { |
| 105 | ModifyStyleEx(0, LVS_EX_FULLROWSELECT); |
| 106 | |
| 107 | RECT rect; |
| 108 | GetWindowRect(&rect); |
| 109 | int width = rect.right - rect.left; |
| 110 | int ret; |
| 111 | |
| 112 | ret = InsertColumn(COLUMN_NAME, "Name", LVCFMT_LEFT, (int)(width * COLUMN_NAME_SIZE)); |
| 113 | ret = InsertColumn(COLUMN_STATE, "State", LVCFMT_LEFT, (int)(width * COLUMN_STATE_SIZE)); |
| 114 | } |
| 115 | |
| 116 | int CMyListCtrl::AddItem(char *name, int num) { |
| 117 | int item_count = GetItemCount(); |