Previous 15994 Revisions Next

r7113 Thursday 21st January, 2010 at 19:46:49 UTC by Miodrag Milanović
MESSUI X64 builds without warning
[src/mess/osd/winui]messui.c propertiesms.c softwarepicker.c
[src/osd/winui]columnedit.c dialogs.c directories.c picker.c tabview.c treeview.c winui.c

src/osd/winui/tabview.c
r7112r7113
212212
213213void TabView_UpdateSelection(HWND hwndTabView)
214214{
215   TabCtrl_SetCurSel(hwndTabView, TabView_GetCurrentTabIndex(hwndTabView));
215   HRESULT res;
216   res = TabCtrl_SetCurSel(hwndTabView, TabView_GetCurrentTabIndex(hwndTabView));
216217}
217218
218219
r7112r7113
274275   TC_ITEM tci;
275276   int i;
276277   TCHAR* t_text;
278   HRESULT res;
277279
278280   pTabViewInfo = GetTabViewInfo(hwndTabView);
279281
280   TabCtrl_DeleteAllItems(hwndTabView);
282   res = TabCtrl_DeleteAllItems(hwndTabView);
281283
282284   memset(&tci, 0, sizeof(tci));
283285   tci.mask = TCIF_TEXT;
r7112r7113
291293         if( !t_text )
292294            return;
293295         tci.pszText = t_text;
294         TabCtrl_InsertItem(hwndTabView, i, &tci);
296         res = TabCtrl_InsertItem(hwndTabView, i, &tci);
295297         global_free(t_text);
296298      }
297299   }
src/osd/winui/columnedit.c
r7112r7113
3838   LV_ITEM lvi;
3939   TCHAR   buf[80];
4040   int    nFrom, nTo;
41   HRESULT res;
4142
4243   nFrom = ListView_GetItemCount(hFrom);
4344   nTo   = ListView_GetItemCount(hTo);
r7112r7113
5758   if (ListView_GetItem(hFrom, &lvi))
5859   {
5960      // Add this item to the Show and delete it from Available
60      ListView_DeleteItem(hFrom, lvi.iItem);
61      res = ListView_DeleteItem(hFrom, lvi.iItem);
6162      lvi.iItem = ListView_GetItemCount(hTo);
62      ListView_InsertItem(hTo, &lvi);
63      res = ListView_InsertItem(hTo, &lvi);
6364      ListView_SetItemState(hTo, lvi.iItem,
6465                       LVIS_FOCUSED | LVIS_SELECTED,
6566                       LVIS_FOCUSED | LVIS_SELECTED);
r7112r7113
7475   LV_ITEM lvi;
7576   TCHAR   buf[80];
7677   int    nMaxpos;
78   HRESULT res;
7779   
7880   lvi.iItem = ListView_GetNextItem(hWnd, -1, LVIS_SELECTED | LVIS_FOCUSED);
7981   nMaxpos = ListView_GetItemCount(hWnd);
r7112r7113
9294   if (ListView_GetItem(hWnd, &lvi))
9395   {
9496      // Add this item to the Show and delete it from Available
95      ListView_DeleteItem(hWnd, lvi.iItem);
97      res = ListView_DeleteItem(hWnd, lvi.iItem);
9698      lvi.iItem += (bDown) ? 1 : -1;
97      ListView_InsertItem(hWnd,&lvi);
99      res = ListView_InsertItem(hWnd,&lvi);
98100      ListView_SetItemState(hWnd, lvi.iItem,
99101                       LVIS_FOCUSED | LVIS_SELECTED,
100102                       LVIS_FOCUSED | LVIS_SELECTED);
r7112r7113
126128   int         i, nCount = 0;
127129   LV_ITEM     lvi;
128130   DWORD dwShowStyle, dwAvailableStyle, dwView;
131   HRESULT res;
129132
130133   switch (Msg)
131134   {
r7112r7113
177180         if (shown[order[i]])
178181         {
179182            lvi.iItem = nShown;
180            ListView_InsertItem(hShown, &lvi);
183            res = ListView_InsertItem(hShown, &lvi);
181184            nShown++;
182185         }
183186         else
184187         {
185188            lvi.iItem = nAvail;
186            ListView_InsertItem(hAvailable, &lvi);
189            res = ListView_InsertItem(hAvailable, &lvi);
187190            nAvail++;
188191         }
189192      }
r7112r7113
408411                  lvi.mask     = LVIF_PARAM;
409412                  lvi.pszText  = 0;
410413                  lvi.iItem    = i;
411                  ListView_GetItem(hShown, &lvi);
414                  res = ListView_GetItem(hShown, &lvi);
412415                  order[nCount++]   = lvi.lParam;
413416                  shown[lvi.lParam] = TRUE;
414417               }
r7112r7113
418421                  lvi.mask     = LVIF_PARAM;
419422                  lvi.pszText  = 0;
420423                  lvi.iItem    = i;
421                  ListView_GetItem(hAvailable, &lvi);
424                  res = ListView_GetItem(hAvailable, &lvi);
422425                  order[nCount++]   = lvi.lParam;
423426                  shown[lvi.lParam] = FALSE;
424427               }
src/osd/winui/directories.c
r7112r7113
214214   LV_ITEM Item;
215215   HWND   hList  = GetDlgItem(hDlg, IDC_DIR_LIST);
216216   HWND   hCombo = GetDlgItem(hDlg, IDC_DIR_COMBO);
217   HRESULT res;
217218
218219   /* Remove previous */
219220
220   ListView_DeleteAllItems(hList);
221   res = ListView_DeleteAllItems(hList);
221222
222223   /* Update list */
223224
r7112r7113
228229   if (IsMultiDir(nType))
229230   {
230231      Item.pszText = (TCHAR*) TEXT(DIRLIST_NEWENTRYTEXT);
231      ListView_InsertItem(hList, &Item);
232      res = ListView_InsertItem(hList, &Item);
232233      for (i = DirInfo_NumDir(g_pDirInfo, nType) - 1; 0 <= i; i--)
233234      {
234235         Item.pszText = DirInfo_Path(g_pDirInfo, nType, i);
235         ListView_InsertItem(hList, &Item);
236         res = ListView_InsertItem(hList, &Item);
236237      }
237238   }
238239   else
239240   {
240241      Item.pszText = DirInfo_Dir(g_pDirInfo, nType);
241      ListView_InsertItem(hList, &Item);
242      res = ListView_InsertItem(hList, &Item);
242243   }
243244
244245   /* select first one */
r7112r7113
273274   TCHAR       *token;
274275   TCHAR       buf[MAX_PATH * MAX_DIRS];
275276   TCHAR*      t_s = NULL;
277   HRESULT    res;
276278
277279   /* count how many dirinfos there are */
278280   nDirInfoCount = 0;
r7112r7113
302304   LVCol.mask     = LVCF_WIDTH;
303305   LVCol.cx     = rectClient.right - rectClient.left - GetSystemMetrics(SM_CXHSCROLL);
304306   
305   ListView_InsertColumn(GetDlgItem(hDlg, IDC_DIR_LIST), 0, &LVCol);
307   res = ListView_InsertColumn(GetDlgItem(hDlg, IDC_DIR_LIST), 0, &LVCol);
306308
307309   /* Keep a temporary copy of the directory strings in g_pDirInfo. */
308310   for (i = 0; i < nDirInfoCount; i++)
src/osd/winui/picker.c
r7112r7113
339339   int shown_columns;
340340   LVCOLUMN col;
341341   struct PickerInfo *pPickerInfo;
342   HRESULT res;
342343
343344   pPickerInfo = GetPickerInfo(hWnd);
344345
r7112r7113
371372      {
372373         nColumn = Picker_GetRealColumnFromViewColumn(hWnd, i++);
373374         widths[nColumn] = col.cx;
374         ListView_DeleteColumn(hWnd, 0);
375         res = ListView_DeleteColumn(hWnd, 0);
375376      }
376377
377378      pPickerInfo->pCallbacks->pfnSetColumnWidths(widths);
r7112r7113
390391         lvc.iSubItem = nColumn;
391392         lvc.cx = widths[order[i]];
392393         lvc.fmt = LVCFMT_LEFT;
393         ListView_InsertColumn(hWnd, nColumn, &lvc);
394         res = ListView_InsertColumn(hWnd, nColumn, &lvc);
394395         pPickerInfo->pnColumnsOrder[nColumn] = order[i];
395396
396397         dprintf("Visible column %d: Logical column %d; Width=%d\n", nColumn, order[i], widths[order[i]]);
r7112r7113
412413   }
413414
414415   if (GetListFontColor() == RGB(255, 255, 255))
415      ListView_SetTextColor(hWnd, RGB(240, 240, 240));
416      res = ListView_SetTextColor(hWnd, RGB(240, 240, 240));
416417   else
417      ListView_SetTextColor(hWnd, GetListFontColor());
418      res = ListView_SetTextColor(hWnd, GetListFontColor());
418419
419420done:
420421   if (widths)
r7112r7113
507508   struct PickerInfo *pPickerInfo;
508509   int i;
509510   LONG_PTR l;
511   HRESULT res;
510512
511513   assert(hwndPicker);
512514
r7112r7113
561563   SetWindowLongPtr(hwndPicker, GWLP_USERDATA, (LONG_PTR) pPickerInfo);
562564   SetWindowLongPtr(hwndPicker, GWLP_WNDPROC, (LONG_PTR) ListViewWndProc);
563565
564   ListView_SetExtendedListViewStyle(hwndPicker, LVS_EX_FULLROWSELECT | LVS_EX_HEADERDRAGDROP |
566   res = ListView_SetExtendedListViewStyle(hwndPicker, LVS_EX_FULLROWSELECT | LVS_EX_HEADERDRAGDROP |
565567      LVS_EX_UNDERLINEHOT | LVS_EX_UNDERLINECOLD | LVS_EX_LABELTIP);
566568
567569   Picker_InternalResetColumnDisplay(hwndPicker, TRUE);
r7112r7113
656658   POINTS         p;
657659   DWORD         res = GetMessagePos();
658660   LVHITTESTINFO   htInfo;
661   HRESULT result;
659662
660663    memset(&htInfo, 0, sizeof(htInfo));
661664   p = MAKEPOINTS(res);
662665   GetWindowRect(hWnd, &rect);
663666   htInfo.pt.x = p.x - rect.left;
664667   htInfo.pt.y = p.y - rect.top;
665   ListView_HitTest(hWnd, &htInfo);
668   result = ListView_HitTest(hWnd, &htInfo);
666669
667670   return (! (htInfo.flags & LVHT_NOWHERE));
668671}
r7112r7113
673676{
674677   int nItem;
675678   LV_ITEM lvi;
679   HRESULT res;
676680
677681   nItem = ListView_GetNextItem(hWnd, -1, LVIS_SELECTED | LVIS_FOCUSED);
678682   if (nItem < 0)
r7112r7113
681685   memset(&lvi, 0, sizeof(lvi));
682686   lvi.iItem = nItem;
683687   lvi.mask = LVIF_PARAM;
684   ListView_GetItem(hWnd, &lvi);
688   res = ListView_GetItem(hWnd, &lvi);
685689   return lvi.lParam;
686690}
687691
r7112r7113
689693
690694void Picker_SetSelectedPick(HWND hWnd, int nIndex)
691695{
696   HRESULT res;
697   
692698   if (nIndex < 0)
693699      nIndex = 0;
694700
695701   ListView_SetItemState(hWnd, nIndex, LVIS_FOCUSED | LVIS_SELECTED,
696702      LVIS_FOCUSED | LVIS_SELECTED);
697   ListView_EnsureVisible(hWnd, nIndex, FALSE);
703   res = ListView_EnsureVisible(hWnd, nIndex, FALSE);
698704}
699705
700706
r7112r7113
753759   HWND hwndHeader;
754760   HD_ITEM hdi;
755761   int i, nViewColumn;
762   HRESULT res;
756763
757764   pPickerInfo = GetPickerInfo(hwndPicker);
758765
r7112r7113
764771   for (i = 0; i < pPickerInfo->nColumnCount; i++)
765772   {
766773      if (i != pPickerInfo->pCallbacks->pfnGetSortColumn())
767         Header_SetItem(hwndHeader, Picker_GetViewColumnFromRealColumn(hwndPicker, i), &hdi);
774         res = Header_SetItem(hwndHeader, Picker_GetViewColumnFromRealColumn(hwndPicker, i), &hdi);
768775   }
769776
770777   if (GetUseXPControl())
r7112r7113
782789   }
783790
784791   nViewColumn = Picker_GetViewColumnFromRealColumn(hwndPicker, pPickerInfo->pCallbacks->pfnGetSortColumn());
785   Header_SetItem(hwndHeader, nViewColumn, &hdi);
792   res = Header_SetItem(hwndHeader, nViewColumn, &hdi);
786793}
787794
788795
r7112r7113
922929   struct PickerInfo *pPickerInfo;
923930   struct CompareProcParams params;
924931   int nItem;
932   HRESULT res;
925933
926934   pPickerInfo = GetPickerInfo(hwndPicker);
927935
928936   // populate the CompareProcParams structure
929937   Picker_PopulateCompareProcParams(hwndPicker, &params);
930938
931   ListView_SortItems(hwndPicker, Picker_CompareProc, (LPARAM) &params);
939   res = ListView_SortItems(hwndPicker, Picker_CompareProc, (LPARAM) &params);
932940
933941   Picker_ResetHeaderSortIcon(hwndPicker);
934942
r7112r7113
937945   lvfi.lParam = Picker_GetSelectedItem(hwndPicker);
938946   nItem = ListView_FindItem(hwndPicker, -1, &lvfi);
939947
940   ListView_EnsureVisible(hwndPicker, nItem, FALSE);
948   res = ListView_EnsureVisible(hwndPicker, nItem, FALSE);
941949}
942950
943951
r7112r7113
949957   struct CompareProcParams params;
950958   int nCompareResult;
951959   LVITEM lvi;
960   HRESULT res;
952961
953962   pPickerInfo = GetPickerInfo(hwndPicker);
954963
r7112r7113
965974      memset(&lvi, 0, sizeof(lvi));
966975      lvi.mask = LVIF_PARAM;
967976      lvi.iItem = nMid;
968      ListView_GetItem(hwndPicker, &lvi);
977      res = ListView_GetItem(hwndPicker, &lvi);
969978
970979      nCompareResult = Picker_CompareProc(nParam, lvi.lParam, (LPARAM) &params);
971980
r7112r7113
12351244   int         nParent;
12361245   HBITMAP      hBackground = GetBackgroundBitmap();
12371246   MYBITMAPINFO *pbmDesc = GetBackgroundInfo();
1247   HRESULT res;
12381248
12391249   pPickerInfo = GetPickerInfo(hWnd);
12401250
r7112r7113
12501260   else
12511261   {
12521262      /* Get the Column Order and save it */
1253      ListView_GetColumnOrderArray(hWnd, nColumnMax, order);
1263      res = ListView_GetColumnOrderArray(hWnd, nColumnMax, order);
12541264
12551265      /* Disallow moving column 0 */
12561266      if (order[0] != 0)
r7112r7113
12631273               order[0] = 0;
12641274            }
12651275         }
1266         ListView_SetColumnOrderArray(hWnd, nColumnMax, order);
1276         res = ListView_SetColumnOrderArray(hWnd, nColumnMax, order);
12671277      }
12681278   }
12691279
r7112r7113
12781288   lvi.pszText      = szBuff;
12791289   lvi.cchTextMax = sizeof(szBuff) / sizeof(szBuff[0]);
12801290   lvi.stateMask  = 0xFFFF;      /* get all state flags */
1281   ListView_GetItem(hWnd, &lvi);
1291   res = ListView_GetItem(hWnd, &lvi);
12821292
12831293   bSelected = ((lvi.state & LVIS_DROPHILITED) || ( (lvi.state & LVIS_SELECTED)
12841294      && ((bFocus) || (GetWindowLong(hWnd, GWL_STYLE) & LVS_SHOWSELALWAYS))));
r7112r7113
12971307      {
12981308         lvi.mask = LVIF_PARAM;
12991309         lvi.iItem = i;
1300         ListView_GetItem(hWnd, &lvi);
1310         res = ListView_GetItem(hWnd, &lvi);
13011311
13021312         if (lvi.lParam == nParent)
13031313         {
r7112r7113
13221332      }
13231333   }
13241334
1325   ListView_GetItemRect_Modified(hWnd, nItem, &rcAllLabels, LVIR_BOUNDS);
1326   ListView_GetItemRect_Modified(hWnd, nItem, &rcLabel, LVIR_LABEL);
1335   res = ListView_GetItemRect_Modified(hWnd, nItem, &rcAllLabels, LVIR_BOUNDS);
1336   res = ListView_GetItemRect_Modified(hWnd, nItem, &rcLabel, LVIR_LABEL);
13271337
13281338   rcAllLabels.left = rcLabel.left;
13291339
r7112r7113
13621372         RealizePalette(htempDC);
13631373      }
13641374
1365      ListView_GetItemRect_Modified(hWnd, 0, &rcFirstItem, LVIR_BOUNDS);
1375      res = ListView_GetItemRect_Modified(hWnd, 0, &rcFirstItem, LVIR_BOUNDS);
13661376
13671377      for (i = rcFirstItem.left; i < rcClient.right; i += pbmDesc->bmWidth)
13681378         for (j = rcFirstItem.top; j < rcClient.bottom; j +=  pbmDesc->bmHeight)
r7112r7113
13841394   {
13851395      RECT rect;
13861396
1387      ListView_GetItemRect_Modified(hWnd, nItem, &rect, LVIR_ICON);
1397      res = ListView_GetItemRect_Modified(hWnd, nItem, &rect, LVIR_ICON);
13881398
13891399      /* indent width of icon + the space between the icon and text
13901400       * so left of clone icon starts at text of parent
r7112r7113
14721482         ImageList_Draw(hImageList, nImage, hDC, rcItem.left, rcItem.top, ILD_TRANSPARENT);
14731483   }
14741484
1475   ListView_GetItemRect_Modified(hWnd, nItem, &rcIcon, LVIR_ICON);
1485   res = ListView_GetItemRect_Modified(hWnd, nItem, &rcIcon, LVIR_ICON);
14761486
14771487   rcIcon.left += indent_space;
14781488
1479   ListView_GetItemRect_Modified(hWnd, nItem, &rcItem, LVIR_LABEL);
1489   res = ListView_GetItemRect_Modified(hWnd, nItem, &rcItem, LVIR_LABEL);
14801490
14811491   hImageList = ListView_GetImageList(hWnd, LVSIL_SMALL);
14821492   if (hImageList)
r7112r7113
14891499      }
14901500   }
14911501
1492   ListView_GetItemRect_Modified(hWnd, nItem, &rcItem, LVIR_LABEL);
1502   res = ListView_GetItemRect_Modified(hWnd, nItem, &rcItem, LVIR_LABEL);
14931503
14941504   pszText = MakeShortString(hDC, szBuff, rcItem.right - rcItem.left, 2*offset + indent_space);
14951505
r7112r7113
15071517      LV_ITEM lvItem;
15081518
15091519      lvc.mask = LVCF_FMT | LVCF_WIDTH;
1510      ListView_GetColumn(hWnd, order[nColumn], &lvc);
1520      res = ListView_GetColumn(hWnd, order[nColumn], &lvc);
15111521
15121522      lvItem.mask      = LVIF_TEXT;
15131523      lvItem.iItem     = nItem;
r7112r7113
16081618   int *tmpOrder;
16091619   int nColumnMax, i;
16101620   BOOL bSuccess = FALSE;
1621   HRESULT res;
16111622
16121623   pPickerInfo = GetPickerInfo(hwndPicker);
16131624
r7112r7113
16411652   else
16421653   {
16431654      /* Get the Column Order and save it */
1644      ListView_GetColumnOrderArray(hwndPicker, nColumnMax, tmpOrder);
1655      res = ListView_GetColumnOrderArray(hwndPicker, nColumnMax, tmpOrder);
16451656
16461657      for (i = 0; i < nColumnMax; i++)
16471658      {
src/osd/winui/dialogs.c
r7112r7113
628628{
629629    static LPTREEFOLDER default_selection = NULL;
630630   static int driver_index;
631   HRESULT res;
631632
632633   switch (Msg)
633634   {
r7112r7113
696697#endif                     
697698                     hti_child = TreeView_InsertItem(GetDlgItem(hDlg,IDC_CUSTOM_TREE),&tvis);
698699                     if (folders[jj] == default_selection)
699                         TreeView_SelectItem(GetDlgItem(hDlg,IDC_CUSTOM_TREE),hti_child);
700                         res = TreeView_SelectItem(GetDlgItem(hDlg,IDC_CUSTOM_TREE),hti_child);
700701                  }
701702               }
702703
703704               /*TreeView_Expand(GetDlgItem(hDlg,IDC_CUSTOM_TREE),hti,TVE_EXPAND);*/
704705               if (first_entry || folders[i] == default_selection)
705706               {
706                   TreeView_SelectItem(GetDlgItem(hDlg,IDC_CUSTOM_TREE),hti);
707                   res = TreeView_SelectItem(GetDlgItem(hDlg,IDC_CUSTOM_TREE),hti);
707708                  first_entry = FALSE;
708709               }
709710
src/osd/winui/treeview.c
r7112r7113
13271327   int i;
13281328   TVITEM tvi;
13291329   TVINSERTSTRUCT   tvs;
1330   HRESULT res;
13301331
13311332   HTREEITEM shti; // for current child branches
13321333
r7112r7113
13341335   HTREEITEM hti_parent = NULL;
13351336   int index_parent = -1;         
13361337
1337   TreeView_DeleteAllItems(hTreeView);
1338   res = TreeView_DeleteAllItems(hTreeView);
13381339
13391340   //dprintf("Adding folders to tree ui indices %i to %i",start_index,end_index);
13401341
r7112r7113
13901391
13911392            tvi.hItem = hti_parent;
13921393            tvi.mask = TVIF_PARAM;
1393            TreeView_GetItem(hTreeView,&tvi);
1394            res= TreeView_GetItem(hTreeView,&tvi);
13941395            if (((LPTREEFOLDER)tvi.lParam) == treeFolders[treeFolders[i]->m_nParent])
13951396               break;
13961397
r7112r7113
14271428   HWND hTreeView = GetTreeView();
14281429   HTREEITEM hti;
14291430   TVITEM tvi;
1431   HRESULT res;
14301432
14311433   memset(&tvi,0,sizeof(tvi));
14321434
r7112r7113
14381440
14391441      tvi.hItem = hti;
14401442      tvi.mask = TVIF_PARAM;
1441      TreeView_GetItem(hTreeView,&tvi);
1443      res = TreeView_GetItem(hTreeView,&tvi);
14421444
14431445      if (((LPTREEFOLDER)tvi.lParam)->m_nFolderId == folder_id)
14441446      {
1445         TreeView_SelectItem(hTreeView,tvi.hItem);
1447         res = TreeView_SelectItem(hTreeView,tvi.hItem);
14461448         SetCurrentFolder((LPTREEFOLDER)tvi.lParam);
14471449         return;
14481450      }
r7112r7113
14651467   // make sure we select something
14661468   tvi.hItem = TreeView_GetRoot(hTreeView);
14671469   tvi.mask = TVIF_PARAM;
1468   TreeView_GetItem(hTreeView,&tvi);
1470   res = TreeView_GetItem(hTreeView,&tvi);
14691471
1470   TreeView_SelectItem(hTreeView,tvi.hItem);
1472   res = TreeView_SelectItem(hTreeView,tvi.hItem);
14711473   SetCurrentFolder((LPTREEFOLDER)tvi.lParam);
14721474
14731475}
r7112r7113
16641666   if (ImageList_GetImageCount (hTreeSmall) < ICON_MAX)
16651667   {
16661668      ErrorMsg("Error with icon list--too few images.  %i < %i",
1667             ImageList_GetImageCount(hTreeSmall),ICON_MAX);
1669             ImageList_GetImageCount(hTreeSmall),(INT)ICON_MAX);
16681670      return FALSE;
16691671   }
16701672
src/osd/winui/winui.c
r7112r7113
10401040   int tmpOrder[COLUMN_MAX];
10411041   int nColumnMax;
10421042   int i;
1043   HRESULT res;
10431044
10441045   nColumnMax = Picker_GetNumColumns(hwndList);
10451046
10461047   /* Get the Column Order and save it */
10471048   if (!oldControl)
10481049   {
1049      ListView_GetColumnOrderArray(hwndList, nColumnMax, tmpOrder);
1050      res = ListView_GetColumnOrderArray(hwndList, nColumnMax, tmpOrder);
10501051
10511052      for (i = 0; i < nColumnMax; i++)
10521053      {
r7112r7113
21392140   MINMAXINFO   *mminfo;
21402141   int       i;
21412142   TCHAR szClass[128];
2143   HRESULT res;
21422144
21432145   switch (message)
21442146   {
r7112r7113
24492451         i = ListView_FindItem(hwndList, -1, &lvfi);
24502452         if (i != -1)
24512453         {
2452            ListView_RedrawItems(hwndList, i, i);
2454            res = ListView_RedrawItems(hwndList, i, i);
24532455         }
24542456      }
24552457      break;
r7112r7113
25312533   LV_FINDINFO lvfi;
25322534   int nCount = ListView_GetItemCount(hwndList);
25332535   BOOL changed = FALSE;
2536   HRESULT res;
25342537
25352538   MSG msg;
25362539   for(i=0; i<nCount;i++)
r7112r7113
25402543      lvi.iItem = i;
25412544      lvi.iSubItem = 0;
25422545      lvi.mask    = LVIF_PARAM;
2543      ListView_GetItem(hwndList, &lvi);
2546      res = ListView_GetItem(hwndList, &lvi);
25442547      nGameIndex  = lvi.lParam;
25452548      SetRomAuditResults(nGameIndex, UNKNOWN);
25462549      SetSampleAuditResults(nGameIndex, UNKNOWN);
r7112r7113
25622565      lvi.iItem = i;
25632566      lvi.iSubItem = 0;
25642567      lvi.mask    = LVIF_PARAM;
2565      ListView_GetItem(hwndList, &lvi);
2568      res = ListView_GetItem(hwndList, &lvi);
25662569      nGameIndex  = lvi.lParam;
25672570      if (GetRomAuditResults(nGameIndex) == UNKNOWN)
25682571      {
r7112r7113
25822585      i = ListView_FindItem(hwndList, -1, &lvfi);
25832586      if (changed && i != -1);
25842587      {
2585         ListView_RedrawItems(hwndList, i, i);
2588         res = ListView_RedrawItems(hwndList, i, i);
25862589         while( PeekMessage( &msg, hwndList, 0, 0, PM_REMOVE ) != 0)
25872590         {
25882591            TranslateMessage(&msg);
r7112r7113
26052608   LV_FINDINFO lvfi;
26062609   int i;
26072610   BOOL changed = FALSE;
2611   HRESULT res;
26082612
26092613   if (game_index == 0)
26102614      ProgressBarShow();
r7112r7113
26342638
26352639   i = ListView_FindItem(hwndList, -1, &lvfi);
26362640   if (changed && i != -1);
2637      ListView_RedrawItems(hwndList, i, i);
2641      res = ListView_RedrawItems(hwndList, i, i);
26382642   if ((game_index % progBarStep) == 0)
26392643      ProgressBarStep();
26402644   game_index++;
r7112r7113
38093813   LV_ITEM lvi;
38103814   BOOL   no_selection = FALSE;
38113815   LPTREEFOLDER lpFolder = GetCurrentFolder();
3816   HRESULT res;
38123817
38133818   if (!lpFolder)
38143819    {
r7112r7113
38253830
38263831   SetWindowRedraw(hwndList,FALSE);
38273832
3828   ListView_DeleteAllItems(hwndList);
3833   res = ListView_DeleteAllItems(hwndList);
38293834
38303835   // hint to have it allocate it all at once
38313836   ListView_SetItemCount(hwndList,driver_list_get_count(drivers));
r7112r7113
38483853         lvi.lParam    = i;
38493854         lvi.pszText  = LPSTR_TEXTCALLBACK;
38503855         lvi.iImage    = I_IMAGECALLBACK;
3851         ListView_InsertItem(hwndList, &lvi);
3856         res = ListView_InsertItem(hwndList, &lvi);
38523857      }
38533858   } while (i != -1);
38543859
r7112r7113
39573962   CHOOSEFONT cf;
39583963   TCHAR szClass[128];
39593964   HWND hWnd;
3965   HRESULT res;
39603966
39613967   GetListFont(&font);
39623968   font.lfQuality = DEFAULT_QUALITY;
r7112r7113
39923998         {
39933999            if (!_tcscmp(szClass, TEXT("SysListView32")))
39944000            {
3995               ListView_SetTextColor(hWnd, textColor);
4001               res = ListView_SetTextColor(hWnd, textColor);
39964002            }
39974003            else if (!_tcscmp(szClass, TEXT("SysTreeView32")))
39984004            {
3999               TreeView_SetTextColor(hTreeView, textColor);
4005               res = TreeView_SetTextColor(hTreeView, textColor);
40004006            }
40014007         }
40024008         hWnd = GetWindow(hWnd, GW_HWNDNEXT);
r7112r7113
40414047   int i;
40424048   LPTREEFOLDER folder;
40434049   char* t_szFile;
4050   HRESULT res;
40444051   
40454052   switch (id)
40464053   {
r7112r7113
45954602         /* enter key */
45964603         if (g_in_treeview_edit)
45974604         {
4598            TreeView_EndEditLabelNow(hTreeView, FALSE);
4605            res = TreeView_EndEditLabelNow(hTreeView, FALSE);
45994606            return TRUE;
46004607         }
46014608         else
r7112r7113
46064613
46074614   case IDCANCEL : /* esc key */
46084615      if (g_in_treeview_edit)
4609         TreeView_EndEditLabelNow(hTreeView, TRUE);
4616         res = TreeView_EndEditLabelNow(hTreeView, TRUE);
46104617      break;
46114618
46124619   case IDC_PLAY_GAME :
r7112r7113
46824689
46834690   case ID_CONTEXT_RESET_PLAYTIME:
46844691      ResetPlayTime( Picker_GetSelectedItem(hwndList) );
4685      ListView_RedrawItems(hwndList, GetSelectedPick(), GetSelectedPick());
4692      res = ListView_RedrawItems(hwndList, GetSelectedPick(), GetSelectedPick());
46864693      break;
46874694
46884695   case ID_CONTEXT_RESET_PLAYCOUNT:
46894696      ResetPlayCount( Picker_GetSelectedItem(hwndList) );
4690      ListView_RedrawItems(hwndList, GetSelectedPick(), GetSelectedPick());
4697      res = ListView_RedrawItems(hwndList, GetSelectedPick(), GetSelectedPick());
46914698      break;
46924699
46934700   case ID_CONTEXT_RENAME_CUSTOM :
r7112r7113
49174924   LVBKIMAGE bki;
49184925   TCHAR path[MAX_PATH];
49194926   TCHAR* t_bgdir;
4927   HRESULT res;
49204928
49214929   static const struct PickerCallbacks s_gameListCallbacks =
49224930   {
r7112r7113
49564964   opts.ppszColumnNames = column_names;
49574965   SetupPicker(hwndList, &opts);
49584966
4959   ListView_SetTextBkColor(hwndList, CLR_NONE);
4960   ListView_SetBkColor(hwndList, CLR_NONE);
4967   res = ListView_SetTextBkColor(hwndList, CLR_NONE);
4968   res = ListView_SetBkColor(hwndList, CLR_NONE);
49614969   t_bgdir = tstring_from_utf8(GetBgDir());
49624970   if( !t_bgdir )
49634971      return;
r7112r7113
49654973   bki.ulFlags = LVBKIF_SOURCE_URL | LVBKIF_STYLE_TILE;
49664974   bki.pszImage = path;
49674975   if( hBackground )   
4968      ListView_SetBkImage(hwndList, &bki);
4976      res = ListView_SetBkImage(hwndList, &bki);
49694977
49704978   CreateIcons();
49714979
r7112r7113
53565364static HICON GetSelectedPickItemIcon()
53575365{
53585366   LV_ITEM lvi;
5367   HRESULT res;
53595368
53605369   lvi.iItem = GetSelectedPick();
53615370   lvi.iSubItem = 0;
53625371   lvi.mask = LVIF_IMAGE;
5363   ListView_GetItem(hwndList, &lvi);
5372   res = ListView_GetItem(hwndList, &lvi);
53645373
53655374   return ImageList_GetIcon(hLarge, lvi.iImage, ILD_TRANSPARENT);
53665375}
r7112r7113
59605969static void MamePlayGameWithOptions(int nGame, const play_options *playopts)
59615970{
59625971   DWORD dwExitCode;
5972   HRESULT res;
59635973
59645974#ifdef MESS
59655975   if (!MessApproveImageList(hMain, nGame))
r7112r7113
59775987   if (dwExitCode == 0)
59785988   {
59795989      IncrementPlayCount(nGame);
5980      ListView_RedrawItems(hwndList, GetSelectedPick(), GetSelectedPick());
5990      res = ListView_RedrawItems(hwndList, GetSelectedPick(), GetSelectedPick());
59815991   }
59825992   else
59835993   {
r7112r7113
60256035   COLORREF textColor;
60266036   TCHAR szClass[128];
60276037   HWND hWnd;
6038   HRESULT res;
60286039
60296040   /* WM_SETTINGCHANGE also */
60306041   xtraX  = GetSystemMetrics(SM_CXFIXEDFRAME); /* Dialog frame width */
r7112r7113
60526063      {
60536064         if (!_tcscmp(szClass, TEXT("SysListView32")))
60546065         {
6055            ListView_SetBkColor(hWnd, GetSysColor(COLOR_WINDOW));
6056            ListView_SetTextColor(hWnd, textColor);
6066            res = ListView_SetBkColor(hWnd, GetSysColor(COLOR_WINDOW));
6067            res = ListView_SetTextColor(hWnd, textColor);
60576068         }
60586069         else if (!_tcscmp(szClass, TEXT("SysTreeView32")))
60596070         {
6060            TreeView_SetBkColor(hTreeView, GetSysColor(COLOR_WINDOW));
6061            TreeView_SetTextColor(hTreeView, textColor);
6071            res = TreeView_SetBkColor(hTreeView, GetSysColor(COLOR_WINDOW));
6072            res = TreeView_SetTextColor(hTreeView, textColor);
60626073         }
60636074      }
60646075      hWnd = GetWindow(hWnd, GW_HWNDNEXT);
r7112r7113
61616172   HMENU hMenu;
61626173   TVHITTESTINFO hti;
61636174   POINT pt;
6175   HRESULT res;
61646176
61656177   if ((HWND)wParam != GetDlgItem(hWnd, IDC_TREE))
61666178      return FALSE;
r7112r7113
61756187   ScreenToClient(hTreeView,&hti.pt);
61766188   (void)TreeView_HitTest(hTreeView,&hti);
61776189   if ((hti.flags & TVHT_ONITEM) != 0)
6178      TreeView_SelectItem(hTreeView,hti.hItem);
6190      res = TreeView_SelectItem(hTreeView,hti.hItem);
61796191
61806192   hTreeMenu = LoadMenu(hInst,MAKEINTRESOURCE(IDR_CONTEXT_TREE));
61816193
r7112r7113
66936705{
66946706    LV_ITEM lvi;
66956707   POINT pt;
6708   HRESULT res;
66966709
66976710   lvi.iItem = pnmv->iItem;
66986711   lvi.mask    = LVIF_PARAM;
6699   ListView_GetItem(hwndList, &lvi);
6712   res = ListView_GetItem(hwndList, &lvi);
67006713
67016714   game_dragged = lvi.lParam;
67026715
r7112r7113
67286741{
67296742   HTREEITEM htiTarget;
67306743   TV_HITTESTINFO tvht;
6744   HRESULT res;
67316745
67326746   POINT pt;
67336747   pt.x = p.x;
r7112r7113
67466760   {
67476761      ImageList_DragShowNolock(FALSE);
67486762      if (htiTarget != NULL)
6749         TreeView_SelectDropTarget(hTreeView,htiTarget);
6763         res = TreeView_SelectDropTarget(hTreeView,htiTarget);
67506764      else
6751         TreeView_SelectDropTarget(hTreeView,NULL);
6765         res = TreeView_SelectDropTarget(hTreeView,NULL);
67526766      ImageList_DragShowNolock(TRUE);
67536767     
67546768      prev_drag_drop_target = htiTarget;
r7112r7113
67616775    HTREEITEM htiTarget;
67626776   TV_HITTESTINFO tvht;
67636777   TVITEM tvi;
6778   HRESULT res;
67646779   
67656780   ReleaseCapture();
67666781
r7112r7113
67686783    ImageList_EndDrag();
67696784   ImageList_Destroy(himl_drag);
67706785
6771   TreeView_SelectDropTarget(hTreeView,NULL);
6786   res = TreeView_SelectDropTarget(hTreeView,NULL);
67726787
67736788   g_listview_dragging = FALSE;
67746789
r7112r7113
68256840{
68266841   HTREEITEM htree;
68276842   TVITEM tvi;
6843   HRESULT res;
68286844   htree = TreeView_GetSelection(hTreeView);
68296845   if(htree != NULL)
68306846   {
68316847      tvi.hItem = htree;
68326848      tvi.mask = TVIF_PARAM;
6833      TreeView_GetItem(hTreeView,&tvi);
6849      res = TreeView_GetItem(hTreeView,&tvi);
68346850      return (LPTREEFOLDER)tvi.lParam;
68356851   }
68366852   return NULL;
r7112r7113
68426858   TVITEM tvi;
68436859   HIMAGELIST hSmall_icon;
68446860   LPTREEFOLDER folder;
6861   HRESULT res;
68456862   htree = TreeView_GetSelection(hTreeView);
68466863
68476864   if (htree != NULL)
68486865   {
68496866      tvi.hItem = htree;
68506867      tvi.mask = TVIF_PARAM;
6851      TreeView_GetItem(hTreeView,&tvi);
6868      res = TreeView_GetItem(hTreeView,&tvi);
68526869     
68536870      folder = (LPTREEFOLDER)tvi.lParam;
68546871      //hSmall_icon = TreeView_GetImageList(hTreeView,(int)tvi.iImage);
r7112r7113
68616878/* Updates all currently displayed Items in the List with the latest Data*/
68626879void UpdateListView(void)
68636880{
6881   HRESULT res;
68646882   if( (GetViewMode() == VIEW_GROUPED) || (GetViewMode() == VIEW_DETAILS ) )
6865      ListView_RedrawItems(hwndList,ListView_GetTopIndex(hwndList),
6883      res = ListView_RedrawItems(hwndList,ListView_GetTopIndex(hwndList),
68666884                      ListView_GetTopIndex(hwndList)+ ListView_GetCountPerPage(hwndList) );
68676885}
68686886
src/mess/osd/winui/messui.c
r7112r7113
13151315   HWND hwndSoftwarePicker;
13161316   HWND hwndSoftwareDevView;
13171317   RECT rMain, rSoftwareTabView, rClient, rTab;
1318   HRESULT res;
13181319
13191320   hwndSoftwareTabView = GetDlgItem(GetMainWindow(), IDC_SWTAB);
13201321   hwndSoftwarePicker = GetDlgItem(GetMainWindow(), IDC_SWLIST);
r7112r7113
13351336   // not being covered up
13361337   if (GetWindowLong(hwndSoftwareTabView, GWL_STYLE) & WS_VISIBLE)
13371338   {
1338      TabCtrl_GetItemRect(hwndSoftwareTabView, 0, &rTab);
1339      res = TabCtrl_GetItemRect(hwndSoftwareTabView, 0, &rTab);
13391340      rClient.top += rTab.bottom - rTab.top + 4;
13401341   }
13411342
src/mess/osd/winui/softwarepicker.c
r7112r7113
240240   unsigned int nLength;
241241   HANDLE hFile, hFileMapping;
242242   LVFINDINFO lvfi;
243   HRESULT res;
243244
244245   pPickerInfo = GetSoftwarePickerInfo(hwndPicker);
245246   assert((nIndex >= 0) && (nIndex < pPickerInfo->file_index_length));
r7112r7113
315316      lvfi.lParam = nIndex;
316317      nIndex = ListView_FindItem(hwndPicker, -1, &lvfi);
317318      if (nIndex > 0)
318         ListView_RedrawItems(hwndPicker, nIndex, nIndex);
319         res = ListView_RedrawItems(hwndPicker, nIndex, nIndex);
319320   }
320321
321322   return rc;
r7112r7113
589590void SoftwarePicker_Clear(HWND hwndPicker)
590591{
591592   software_picker_info *pPickerInfo;
593   HRESULT res;
592594   pPickerInfo = GetSoftwarePickerInfo(hwndPicker);
593595   SoftwarePicker_InternalClear(pPickerInfo);
594   ListView_DeleteAllItems(hwndPicker);
596   res = ListView_DeleteAllItems(hwndPicker);
595597}
596598
597599
src/mess/osd/winui/propertiesms.c
r7112r7113
5858static void AppendList(HWND hList, LPCTSTR lpItem, int nItem)
5959{
6060    LV_ITEM Item;
61   HRESULT res;
6162   memset(&Item, 0, sizeof(LV_ITEM));
6263   Item.mask = LVIF_TEXT;
6364   Item.pszText = (LPTSTR) lpItem;
6465   Item.iItem = nItem;
65   ListView_InsertItem(hList, &Item);
66   res = ListView_InsertItem(hList, &Item);
6667}
6768
6869
r7112r7113
7475    TCHAR outbuf[MAX_PATH];
7576    HWND hList;
7677   LPTSTR lpIn;
78   HRESULT res;
7779
7880   g_bModifiedSoftwarePaths = TRUE;
7981
r7112r7113
105107
106108   AppendList(hList, lpItem, nItem);
107109   if (bBrowse)
108      ListView_DeleteItem(hList, nItem+1);
110      res = ListView_DeleteItem(hList, nItem+1);
109111   MarkChanged(hDlg);
110112   return TRUE;
111113}
r7112r7113
118120    int     nSelect;
119121    int     nItem;
120122    HWND    hList = GetDlgItem(hDlg, IDC_DIR_LIST);
123   HRESULT res;
121124
122125   g_bModifiedSoftwarePaths = TRUE;
123126
r7112r7113
130133    if (nItem == ListView_GetItemCount(hList) - 1)
131134        return FALSE;
132135
133   ListView_DeleteItem(hList, nItem);
136   res = ListView_DeleteItem(hList, nItem);
134137
135138    nCount = ListView_GetItemCount(hList);
136139    if (nCount <= 1)
r7112r7113
282285   TCHAR buffer[2048];
283286   char *dir_list;
284287   int i, pos, driver_index;
288   HRESULT res;
285289
286290   // determine the directory count; note that one item is the "<    >" entry
287291   directory_count = ListView_GetItemCount(control);
r7112r7113
303307      lvi.iItem = i;
304308      lvi.pszText = &buffer[pos];
305309      lvi.cchTextMax = ARRAY_LENGTH(buffer) - pos;
306      ListView_GetItem(control, &lvi);
310      res = ListView_GetItem(control, &lvi);
307311
308312      // advance the position
309313      pos += _tcslen(&buffer[pos]);
r7112r7113
329333   TCHAR *s;
330334   LV_COLUMN lvc;
331335   RECT r;
336   HRESULT res;
332337
333338   // access the directory list, and convert to TCHARs
334339   driver_index = PropertiesCurrentGame(dialog);
r7112r7113
338343      return FALSE;
339344
340345   // delete all items in the list control
341   ListView_DeleteAllItems(control);
346   res = ListView_DeleteAllItems(control);
342347
343348   // add the column
344349   GetClientRect(control, &r);
345350   memset(&lvc, 0, sizeof(LVCOLUMN));
346351   lvc.mask = LVCF_WIDTH;
347352   lvc.cx = r.right - r.left - GetSystemMetrics(SM_CXHSCROLL);
348   ListView_InsertColumn(control, 0, &lvc);
353   res = ListView_InsertColumn(control, 0, &lvc);
349354
350355   // add each of the directories
351356   pos = 0;

Previous 15994 Revisions Next


© 1998-2018 The MESS Team