| 97 | } |
| 98 | |
| 99 | int QueueWindow::PopQueueItem(QueueOperation * op) { |
| 100 | if (!ValidType(op->GetType())) |
| 101 | return -1; |
| 102 | |
| 103 | int index = GetNrItems()-1; |
| 104 | if (index == -1) |
| 105 | return -1; |
| 106 | |
| 107 | LVITEM lvi; |
| 108 | lvi.iItem = 0; |
| 109 | lvi.iSubItem = 0; |
| 110 | lvi.mask = LVIF_PARAM; |
| 111 | BOOL res = ListView_GetItem(m_hwnd, &lvi); |
| 112 | if (res == FALSE) |
| 113 | return -1; |
| 114 | |
| 115 | if ((QueueOperation*)lvi.lParam != op) |
| 116 | return -1; |
| 117 | |
| 118 | res = ListView_DeleteItem(m_hwnd,index); |
| 119 | if (res == FALSE) |
| 120 | return -1; |
| 121 | |
| 122 | return 0; |
| 123 | } |
| 124 | |
| 125 | int QueueWindow::RemoveQueueItem(QueueOperation * op) { |
| 126 | if (!ValidType(op->GetType())) |