Ignore:
Timestamp:
Oct 29, 2002, 1:19:36 PM (23 years ago)
Author:
sandervl
Message:

Wine resync

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/comctl32/propsheet.c

    r8515 r9370  
    2525
    2626#include <string.h>
     27
    2728#include "winbase.h"
    2829#include "commctrl.h"
     
    3031#include "winnls.h"
    3132#include "comctl32.h"
     33#include "heap.h"
     34
    3235#include "wine/debug.h"
    33 #include "heap.h"
    34 
     36#include "wine/unicode.h"
    3537
    3638/******************************************************************************
    3739 * Data structures
    3840 */
     41#include "pshpack2.h"
     42
    3943typedef struct
    4044{
     
    4549  DWORD style;
    4650} MyDLGTEMPLATEEX;
     51
     52typedef struct
     53{
     54  DWORD helpid;
     55  DWORD exStyle;
     56  DWORD style;
     57  short x;
     58  short y;
     59  short cy;
     60  DWORD id;
     61} MyDLGITEMTEMPLATEEX;
     62#include "poppack.h"
    4763
    4864typedef struct tagPropPageInfo
     
    89105 */
    90106
    91 const WCHAR PropSheetInfoStr[] = 
     107const WCHAR PropSheetInfoStr[] =
    92108    {'P','r','o','p','e','r','t','y','S','h','e','e','t','I','n','f','o',0 };
    93109
     
    139155                                int skipdir,
    140156                                HPROPSHEETPAGE hpage);
     157static void PROPSHEET_SetCurSelId(HWND hwndDlg, int id);
    141158static LRESULT PROPSHEET_QuerySiblings(HWND hwndDlg,
    142159                                       WPARAM wParam, LPARAM lParam);
     
    210227
    211228/******************************************************************************
     229 *            PROPSHEET_GetPageRect
     230 *
     231 * Retrieve rect from tab control and map into the dialog for SetWindowPos
     232 */
     233static void PROPSHEET_GetPageRect(const PropSheetInfo * psInfo, HWND hwndDlg, RECT *rc)
     234{
     235    HWND hwndTabCtrl = GetDlgItem(hwndDlg, IDC_TABCONTROL);
     236
     237    GetClientRect(hwndTabCtrl, rc);
     238    SendMessageW(hwndTabCtrl, TCM_ADJUSTRECT, FALSE, (LPARAM)rc);
     239    MapWindowPoints(hwndTabCtrl, hwndDlg, (LPPOINT)rc, 2);
     240}
     241
     242/******************************************************************************
    212243 *            PROPSHEET_FindPageByResId
    213244 *
     
    262293
    263294  memcpy(&psInfo->ppshheader,lppsh,dwSize);
    264   TRACE("\n** PROPSHEETHEADER **\ndwSize\t\t%ld\ndwFlags\t\t%08lx\nhwndParent\t%04x\nhInstance\t%08x\npszCaption\t'%s'\nnPages\t\t%d\npfnCallback\t%p\n",
     295  TRACE("\n** PROPSHEETHEADER **\ndwSize\t\t%ld\ndwFlags\t\t%08lx\nhwndParent\t%p\nhInstance\t%p\npszCaption\t'%s'\nnPages\t\t%d\npfnCallback\t%p\n",
    265296        lppsh->dwSize, lppsh->dwFlags, lppsh->hwndParent, lppsh->hInstance,
    266297        debugstr_a(lppsh->pszCaption), lppsh->nPages, lppsh->pfnCallback);
     
    313344
    314345  memcpy(&psInfo->ppshheader,lppsh,dwSize);
    315   TRACE("\n** PROPSHEETHEADER **\ndwSize\t\t%ld\ndwFlags\t\t%08lx\nhwndParent\t%04x\nhInstance\t%08x\npszCaption\t'%s'\nnPages\t\t%d\npfnCallback\t%p\n",
     346  TRACE("\n** PROPSHEETHEADER **\ndwSize\t\t%ld\ndwFlags\t\t%08lx\nhwndParent\t%p\nhInstance\t%p\npszCaption\t'%s'\nnPages\t\t%d\npfnCallback\t%p\n",
    316347      lppsh->dwSize, lppsh->dwFlags, lppsh->hwndParent, lppsh->hInstance, debugstr_w(lppsh->pszCaption), lppsh->nPages, lppsh->pfnCallback);
    317348
     
    443474      p += lstrlenW( (LPCWSTR)p ) + 1;
    444475      break;
    445   } 
     476  }
    446477
    447478  /* class */
     
    492523   * Build the image list for icons
    493524   */
    494   if ((dwFlags & PSP_USEHICON) || (dwFlags & PSP_USEICONID)) 
     525  if ((dwFlags & PSP_USEHICON) || (dwFlags & PSP_USEICONID))
    495526  {
    496527    HICON hIcon;
     
    499530
    500531    if (dwFlags & PSP_USEICONID)
    501       hIcon = LoadImageW(lppsp->hInstance, lppsp->u2.pszIcon, IMAGE_ICON, 
     532      hIcon = LoadImageW(lppsp->hInstance, lppsp->u2.pszIcon, IMAGE_ICON,
    502533                         icon_cx, icon_cy, LR_DEFAULTCOLOR);
    503534    else
     
    569600                                       psInfo->ppshheader.hwndParent,
    570601                                       (DLGPROC) PROPSHEET_DialogProc,
    571                                        (LPARAM)psInfo);
     602                                       (LPARAM)psInfo) ? TRUE : FALSE;
    572603
    573604  COMCTL32_Free(temp);
     
    578609/******************************************************************************
    579610 *            PROPSHEET_SizeMismatch
    580  * 
     611 *
    581612 *     Verify that the tab control and the "largest" property sheet page dlg. template
    582613 *     match in size.
     
    702733      psInfo->height = MulDiv((rc.bottom - rc.top),8,units.top);
    703734  }
    704  
     735
    705736  if ((rc.right - rc.left) < (tabRect.right - tabRect.left))
    706737  {
     
    716747  rc.right -= rc.left;
    717748  rc.bottom -= rc.top;
     749  TRACE("setting tab %08lx, rc (0,0)-(%d,%d)\n",
     750        (DWORD)hwndTabCtrl, rc.right, rc.bottom);
    718751  SetWindowPos(hwndTabCtrl, 0, 0, 0, rc.right, rc.bottom,
    719752               SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE);
     
    730763   * Resize the property sheet.
    731764   */
     765  TRACE("setting dialog %08lx, rc (0,0)-(%d,%d)\n",
     766        (DWORD)hwndDlg, rc.right, rc.bottom);
    732767  SetWindowPos(hwndDlg, 0, 0, 0, rc.right, rc.bottom,
    733768               SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE);
     
    779814      psInfo->height = MulDiv((rc.bottom - rc.top), 8, units.top);
    780815  }
    781  
     816
    782817  if ((rc.right - rc.left) < (tabRect.right - tabRect.left))
    783818  {
     
    787822
    788823  TRACE("Biggest page %d %d %d %d\n", rc.left, rc.top, rc.right, rc.bottom);
     824  TRACE("   constants padx=%d, pady=%d, butH=%d, lH=%d\n",
     825        padding.x, padding.y, buttonHeight, lineHeight);
    789826
    790827  /* Make room */
     
    795832   * Resize the property sheet.
    796833   */
     834  TRACE("setting dialog %08lx, rc (0,0)-(%d,%d)\n",
     835        (DWORD)hwndDlg, rc.right, rc.bottom);
    797836  SetWindowPos(hwndDlg, 0, 0, 0, rc.right, rc.bottom,
    798837               SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE);
     
    829868  /*
    830869   * Get the size of the property sheet.
    831    */ 
     870   */
    832871  GetClientRect(hwndParent, &rcSheet);
    833872
    834   /* 
     873  /*
    835874   * All buttons will be at this y coordinate.
    836875   */
     
    868907    else
    869908      x = rcSheet.right - (padding.x + buttonWidth);
    870  
     909
    871910    SetWindowPos(hwndButton, 0, x, y, 0, 0,
    872911                 SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE);
     
    885924  {
    886925    x = rcSheet.right - (padding.x + buttonWidth);
    887  
     926
    888927    SetWindowPos(hwndButton, 0, x, y, 0, 0,
    889928                 SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE);
     
    10641103    }
    10651104  }
    1066  
     1105
    10671106  hwndControl = GetDlgItem(hwndDlg, idButton);
    10681107  GetWindowRect(hwndControl, &rc);
     
    11361175
    11371176  return TRUE;
     1177}
     1178/*
     1179 * Get the size of an in-memory Template
     1180 *
     1181 *( Based on the code of PROPSHEET_CollectPageInfo)
     1182 */
     1183
     1184static UINT GetTemplateSize(DLGTEMPLATE* pTemplate)
     1185
     1186{
     1187  const WORD*  p = (const WORD *)pTemplate;
     1188  BOOL  istemplateex = (((MyDLGTEMPLATEEX*)pTemplate)->signature == 0xFFFF);
     1189  WORD nrofitems;
     1190
     1191  if (istemplateex)
     1192  {
     1193    /* DIALOGEX template */
     1194
     1195    p++;       /* dlgVer    */
     1196    p++;       /* signature */
     1197    p += 2;    /* help ID   */
     1198    p += 2;    /* ext style */
     1199    p += 2;    /* style     */
     1200  }
     1201  else
     1202  {
     1203    /* DIALOG template */
     1204
     1205    p += 2;    /* style     */
     1206    p += 2;    /* ext style */
     1207  }
     1208
     1209  nrofitems =   (WORD)*p; p++;    /* nb items */
     1210  p++;    /*   x      */
     1211  p++;    /*   y      */
     1212  p++;    /*   width  */
     1213  p++;    /*   height */
     1214
     1215  /* menu */
     1216  switch ((WORD)*p)
     1217  {
     1218    case 0x0000:
     1219      p++;
     1220      break;
     1221    case 0xffff:
     1222      p += 2;
     1223      break;
     1224    default:
     1225      TRACE("menu %s\n",debugstr_w((LPCWSTR)p));
     1226      p += lstrlenW( (LPCWSTR)p ) + 1;
     1227      break;
     1228  }
     1229
     1230  /* class */
     1231  switch ((WORD)*p)
     1232  {
     1233    case 0x0000:
     1234      p++;
     1235      break;
     1236    case 0xffff:
     1237      p += 2;
     1238      break;
     1239    default:
     1240      TRACE("class %s\n",debugstr_w((LPCWSTR)p));
     1241      p += lstrlenW( (LPCWSTR)p ) + 1;
     1242      break;
     1243  }
     1244
     1245  /*title */
     1246  TRACE("title %s\n",debugstr_w((LPCWSTR)p));
     1247  p += lstrlenW((LPCWSTR)p) + 1;
     1248
     1249  /* font, if DS_FONT set */
     1250  if ((DS_SETFONT & ((istemplateex)?  ((MyDLGTEMPLATEEX*)pTemplate)->style :
     1251                     pTemplate->style)))
     1252    {
     1253      p+=(istemplateex)?3:1;
     1254      TRACE("font %s\n",debugstr_w((LPCWSTR)p));
     1255      p += lstrlenW( (LPCWSTR)p ) + 1; /* the font name*/
     1256    }
     1257
     1258  TRACE("%d items\n",nrofitems);
     1259  while (nrofitems > 0)
     1260    {
     1261      p = (WORD*)(((DWORD)p + 3) & ~3); /* DWORD align */
     1262     
     1263      p += (istemplateex ? sizeof(MyDLGITEMTEMPLATEEX) : sizeof(DLGITEMTEMPLATE))/sizeof(WORD);
     1264     
     1265      switch ((WORD)*p)
     1266        {
     1267        case 0x0000:
     1268          p++;
     1269          break;
     1270        case 0xffff:
     1271          TRACE("class ordinal 0x%08lx\n",*(DWORD*)p);
     1272          p += 2;
     1273          break;
     1274        default:
     1275          TRACE("class %s\n",debugstr_w((LPCWSTR)p));
     1276          p += lstrlenW( (LPCWSTR)p ) + 1;
     1277          break;
     1278        }
     1279      switch ((WORD)*p)
     1280        {
     1281        case 0x0000:
     1282          p++;
     1283          break;
     1284        case 0xffff:
     1285          TRACE("text ordinal 0x%08lx\n",*(DWORD*)p);
     1286          p += 2;
     1287          break;
     1288        default:
     1289          TRACE("text %s\n",debugstr_w((LPCWSTR)p));
     1290          p += lstrlenW( (LPCWSTR)p ) + 1;
     1291          break;
     1292        }
     1293      p += *p + 1;    /* Skip extra data */
     1294      --nrofitems;
     1295    }
     1296 
     1297  TRACE("%p %p size 0x%08x\n",p, (WORD*)pTemplate,sizeof(WORD)*(p - (WORD*)pTemplate));
     1298  return (p - (WORD*)pTemplate)*sizeof(WORD);
     1299 
    11381300}
    11391301
     
    11651327
    11661328  if (ppshpage->dwFlags & PSP_DLGINDIRECT)
    1167     pTemplate = (DLGTEMPLATE*)ppshpage->u.pResource;
     1329    {
     1330      pTemplate = (DLGTEMPLATE*)ppshpage->u.pResource;
     1331      resSize = GetTemplateSize(pTemplate);
     1332    }
    11681333  else
    11691334  {
     
    11871352     * Make a copy of the dialog template to make it writable
    11881353     */
    1189     temp = COMCTL32_Alloc(resSize);
    1190     if (!temp)
    1191       return FALSE;
    1192 
    1193     memcpy(temp, pTemplate, resSize);
    1194     pTemplate = temp;
    1195   }
     1354  }
     1355  temp = COMCTL32_Alloc(resSize);
     1356  if (!temp)
     1357    return FALSE;
     1358 
     1359  memcpy(temp, pTemplate, resSize);
     1360  pTemplate = temp;
    11961361
    11971362  if (((MyDLGTEMPLATEEX*)pTemplate)->signature == 0xFFFF)
     
    12341399  ppInfo[index].hwndPage = hwndPage;
    12351400
    1236   rc.left = psInfo->x;
    1237   rc.top = psInfo->y;
    1238   rc.right = psInfo->width;
    1239   rc.bottom = psInfo->height;
    1240 
    1241   MapDialogRect(hwndParent, &rc);
    1242 
    1243   pageWidth = rc.right - rc.left;
    1244   pageHeight = rc.bottom - rc.top;
    1245 
    1246   if (psInfo->ppshheader.dwFlags & INTRNL_ANY_WIZARD)
    1247     padding = PROPSHEET_GetPaddingInfoWizard(hwndParent, psInfo);
    1248   else
    1249   {
    1250     /*
    1251      * Ask the Tab control to fit this page in.
    1252      */
    1253 
    1254     HWND hwndTabCtrl = GetDlgItem(hwndParent, IDC_TABCONTROL);
    1255     SendMessageW(hwndTabCtrl, TCM_ADJUSTRECT, FALSE, (LPARAM)&rc);
    1256     padding = PROPSHEET_GetPaddingInfo(hwndParent);
    1257   }
    1258 
    1259   SetWindowPos(hwndPage, HWND_TOP,
    1260                rc.left + padding.x/2,
    1261                rc.top + padding.y/2,
    1262                pageWidth, pageHeight, 0);
     1401  if (psInfo->ppshheader.dwFlags & INTRNL_ANY_WIZARD) {
     1402      /* FIXME: This code may no longer be correct.
     1403       *        It was not for the non-wizard path.  (GLA 6/02)
     1404       */
     1405      rc.left = psInfo->x;
     1406      rc.top = psInfo->y;
     1407      rc.right = psInfo->width;
     1408      rc.bottom = psInfo->height;
     1409
     1410      MapDialogRect(hwndParent, &rc);
     1411
     1412      pageWidth = rc.right - rc.left;
     1413      pageHeight = rc.bottom - rc.top;
     1414
     1415      padding = PROPSHEET_GetPaddingInfoWizard(hwndParent, psInfo);
     1416      TRACE("setting page %08lx, rc (%d,%d)-(%d,%d) w=%d, h=%d, padx=%d, pady=%d\n",
     1417            (DWORD)hwndPage, rc.left, rc.top, rc.right, rc.bottom,
     1418            pageWidth, pageHeight, padding.x, padding.y);
     1419      SetWindowPos(hwndPage, HWND_TOP,
     1420                   rc.left + padding.x/2,
     1421                   rc.top + padding.y/2,
     1422                   pageWidth, pageHeight, 0);
     1423  }
     1424  else {
     1425      /*
     1426       * Ask the Tab control to reduce the client rectangle to that
     1427       * it has available.
     1428       */
     1429      PROPSHEET_GetPageRect(psInfo, hwndParent, &rc);
     1430      pageWidth = rc.right - rc.left;
     1431      pageHeight = rc.bottom - rc.top;
     1432      TRACE("setting page %08lx, rc (%d,%d)-(%d,%d) w=%d, h=%d\n",
     1433            (DWORD)hwndPage, rc.left, rc.top, rc.right, rc.bottom,
     1434            pageWidth, pageHeight);
     1435      SetWindowPos(hwndPage, HWND_TOP,
     1436                   rc.left, rc.top,
     1437                   pageWidth, pageHeight, 0);
     1438  }
    12631439
    12641440  return TRUE;
     
    13261502  psn.hdr.idFrom   = 0;
    13271503  psn.lParam       = 0;
    1328  
     1504
    13291505  hwndPage = psInfo->proppage[psInfo->active_page].hwndPage;
    13301506
     
    13651541  psn.hdr.idFrom   = 0;
    13661542  psn.lParam       = 0;
    1367  
     1543
    13681544  hwndPage = psInfo->proppage[psInfo->active_page].hwndPage;
    13691545
     
    14041580  psn.hdr.idFrom   = 0;
    14051581  psn.lParam       = 0;
    1406  
     1582
    14071583  hwndPage = psInfo->proppage[psInfo->active_page].hwndPage;
    14081584
     
    14411617  psn.hdr.idFrom   = 0;
    14421618  psn.lParam       = 0;
    1443  
     1619
    14441620
    14451621  /*
     
    14581634  psn.hdr.code = PSN_APPLY;
    14591635  psn.lParam   = lParam;
    1460  
     1636
    14611637  for (i = 0; i < psInfo->nPages; i++)
    14621638  {
     
    15051681  psn.hdr.idFrom   = 0;
    15061682  psn.lParam       = 0;
    1507  
     1683
    15081684  if (SendMessageA(hwndPage, WM_NOTIFY, 0, (LPARAM) &psn))
    15091685    return;
     
    15111687  psn.hdr.code = PSN_RESET;
    15121688  psn.lParam   = lParam;
    1513  
     1689
    15141690  for (i = 0; i < psInfo->nPages; i++)
    15151691  {
     
    15481724  psn.hdr.idFrom   = 0;
    15491725  psn.lParam       = 0;
    1550  
     1726
    15511727  SendMessageA(hwndPage, WM_NOTIFY, 0, (LPARAM) &psn);
    15521728}
     
    16501826
    16511827/*************************************************************************
    1652  * BOOL PROPSHEET_CanSetCurSel [Internal] 
     1828 * BOOL PROPSHEET_CanSetCurSel [Internal]
    16531829 *
    16541830 * Test whether the current page can be changed by sending a PSN_KILLACTIVE
     
    17101886  PropSheetInfo* psInfo = (PropSheetInfo*) GetPropW(hwndDlg, PropSheetInfoStr);
    17111887  HWND hwndHelp  = GetDlgItem(hwndDlg, IDHELP);
     1888  HWND hwndTabControl = GetDlgItem(hwndDlg, IDC_TABCONTROL);
    17121889
    17131890  TRACE("index %d, skipdir %d, hpage %p\n", index, skipdir, hpage);
     
    17251902    int result;
    17261903    PSHNOTIFY psn;
     1904
     1905    if (hwndTabControl)
     1906        SendMessageW(hwndTabControl, TCM_SETCURSEL, index, 0);
    17271907
    17281908    psn.hdr.code     = PSN_SETACTIVE;
     
    17721952
    17731953/******************************************************************************
     1954 *            PROPSHEET_SetCurSelId
     1955 *
     1956 * Selects the page, specified by resource id.
     1957 */
     1958static void PROPSHEET_SetCurSelId(HWND hwndDlg, int id)
     1959{
     1960      int idx;
     1961      PropSheetInfo* psInfo =
     1962          (PropSheetInfo*) GetPropW(hwndDlg, PropSheetInfoStr);
     1963
     1964      idx = PROPSHEET_FindPageByResId(psInfo, id);
     1965      if (idx < psInfo->nPages )
     1966      {
     1967          if (PROPSHEET_CanSetCurSel(hwndDlg) != FALSE)
     1968              PROPSHEET_SetCurSel(hwndDlg, idx, 1, 0);
     1969      }
     1970}
     1971
     1972/******************************************************************************
    17741973 *            PROPSHEET_SetTitleA
    17751974 */
     
    17791978  {
    17801979     WCHAR szTitle[256];
    1781      MultiByteToWideChar(CP_ACP, 0, lpszText, -1, 
     1980     MultiByteToWideChar(CP_ACP, 0, lpszText, -1,
    17821981                             szTitle, sizeof szTitle);
    17831982     PROPSHEET_SetTitleW(hwndDlg, dwStyle, szTitle);
     
    17991998  TRACE("'%s' (style %08lx)\n", debugstr_w(lpszText), dwStyle);
    18001999  if (HIWORD(lpszText) == 0) {
    1801     if (!LoadStringW(psInfo->ppshheader.hInstance, 
     2000    if (!LoadStringW(psInfo->ppshheader.hInstance,
    18022001                     LOWORD(lpszText), szTitle, sizeof(szTitle)-sizeof(WCHAR)))
    18032002      return;
     
    19302129  item.pszText = (LPWSTR) psInfo->proppage[psInfo->nPages].pszText;
    19312130  item.cchTextMax = MAX_TABTEXT_LENGTH;
     2131
     2132  if (psInfo->hImageList)
     2133  {
     2134    SendMessageW(hwndTabControl, TCM_SETIMAGELIST, 0, (LPARAM)psInfo->hImageList);
     2135  }
     2136
     2137  if ( psInfo->proppage[psInfo->nPages].hasIcon )
     2138  {
     2139    item.mask |= TCIF_IMAGE;
     2140    item.iImage = psInfo->nPages;
     2141  }
    19322142
    19332143  SendMessageW(hwndTabControl, TCM_INSERTITEMW, psInfo->nPages + 1,
     
    20212231     DestroyPropertySheetPage(psInfo->proppage[index].hpage);
    20222232  }
    2023  
     2233
    20242234  /* Remove the tab */
    20252235  SendMessageW(hwndTabControl, TCM_DELETEITEM, index, 0);
     
    20282238  psInfo->proppage = COMCTL32_Alloc(sizeof(PropPageInfo) * psInfo->nPages);
    20292239
    2030   if (index > 0) 
     2240  if (index > 0)
    20312241    memcpy(&psInfo->proppage[0], &oldPages[0], index * sizeof(PropPageInfo));
    20322242
     
    21562366
    21572367/******************************************************************************
    2158  *            PropertySheet    (COMCTL32.87)
    2159  *            PropertySheetA   (COMCTL32.88)
     2368 *            PropertySheet    (COMCTL32.@)
     2369 *            PropertySheetA   (COMCTL32.@)
    21602370 */
    21612371INT WINAPI PropertySheetA(LPCPROPSHEETHEADERA lppsh)
     
    22012411
    22022412/******************************************************************************
    2203  *            PropertySheetW   (COMCTL32.89)
     2413 *            PropertySheetW   (COMCTL32.@)
    22042414 */
    22052415INT WINAPI PropertySheetW(LPCPROPSHEETHEADERW lppsh)
     
    22452455
    22462456/******************************************************************************
    2247  *            CreatePropertySheetPage    (COMCTL32.18)
    2248  *            CreatePropertySheetPageA   (COMCTL32.19)
     2457 *            CreatePropertySheetPage    (COMCTL32.@)
     2458 *            CreatePropertySheetPageA   (COMCTL32.@)
    22492459 */
    22502460HPROPSHEETPAGE WINAPI CreatePropertySheetPageA(
     
    22572467  if ( !(ppsp->dwFlags & PSP_DLGINDIRECT) && HIWORD( ppsp->u.pszTemplate ) )
    22582468  {
    2259       PROPSHEET_AtoW(&ppsp->u.pszTemplate, lpPropSheetPage->u.pszTemplate); 
     2469      PROPSHEET_AtoW(&ppsp->u.pszTemplate, lpPropSheetPage->u.pszTemplate);
    22602470  }
    22612471  if ( (ppsp->dwFlags & PSP_USEICONID) && HIWORD( ppsp->u2.pszIcon ) )
    22622472  {
    2263       PROPSHEET_AtoW(&ppsp->u2.pszIcon, lpPropSheetPage->u2.pszIcon); 
     2473      PROPSHEET_AtoW(&ppsp->u2.pszIcon, lpPropSheetPage->u2.pszIcon);
    22642474  }
    22652475
    22662476  if ((ppsp->dwFlags & PSP_USETITLE) && HIWORD( ppsp->pszTitle ))
    22672477  {
    2268       PROPSHEET_AtoW(&ppsp->pszTitle, lpPropSheetPage->pszTitle); 
     2478      PROPSHEET_AtoW(&ppsp->pszTitle, lpPropSheetPage->pszTitle);
    22692479  }
    22702480  else if ( !(ppsp->dwFlags & PSP_USETITLE) )
     
    22752485
    22762486/******************************************************************************
    2277  *            CreatePropertySheetPageW   (COMCTL32.20)
     2487 *            CreatePropertySheetPageW   (COMCTL32.@)
    22782488 */
    22792489HPROPSHEETPAGE WINAPI CreatePropertySheetPageW(LPCPROPSHEETPAGEW lpPropSheetPage)
     
    23102520
    23112521/******************************************************************************
    2312  *            DestroyPropertySheetPage   (COMCTL32.24)
     2522 *            DestroyPropertySheetPage   (COMCTL32.@)
    23132523 */
    23142524BOOL WINAPI DestroyPropertySheetPage(HPROPSHEETPAGE hPropPage)
     
    24562666PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
    24572667{
    2458   TRACE("hwnd=%x msg=%x wparam=%x lparam=%lx\n",
     2668  TRACE("hwnd=%p msg=%x wparam=%x lparam=%lx\n",
    24592669        hwnd, uMsg, wParam, lParam);
    24602670
     
    24722682
    24732683      /*
    2474        * psInfo->hwnd is not being used by WINE code - it exists 
    2475        * for compatibility with "real" Windoze. The same about 
     2684       * psInfo->hwnd is not being used by WINE code - it exists
     2685       * for compatibility with "real" Windoze. The same about
    24762686       * SetWindowLong - WINE is only using the PropSheetInfoStr
    24772687       * property.
     
    24992709          hIcon = psInfo->ppshheader.u.hIcon;
    25002710
    2501         SendMessageW(hwnd, WM_SETICON, 0, hIcon);
     2711        SendMessageW(hwnd, WM_SETICON, 0, (LPARAM)hIcon);
    25022712      }
    2503      
     2713
    25042714      if (psInfo->ppshheader.dwFlags & PSH_USEHICON)
    2505         SendMessageW(hwnd, WM_SETICON, 0, psInfo->ppshheader.u.hIcon);
     2715        SendMessageW(hwnd, WM_SETICON, 0, (LPARAM)psInfo->ppshheader.u.hIcon);
    25062716
    25072717      psInfo->strPropertiesFor = strCaption;
     
    25282738      }
    25292739
    2530       if (psInfo->useCallback) 
    2531              (*(psInfo->ppshheader.pfnCallback))(hwnd, 
    2532                                               PSCB_INITIALIZED, (LPARAM)0); 
     2740      if (psInfo->useCallback)
     2741             (*(psInfo->ppshheader.pfnCallback))(hwnd,
     2742                                              PSCB_INITIALIZED, (LPARAM)0);
    25332743
    25342744      idx = psInfo->active_page;
    25352745      ppshpage = (LPCPROPSHEETPAGEW)psInfo->proppage[idx].hpage;
    25362746      psInfo->active_page = -1;
    2537  
     2747
    25382748      PROPSHEET_SetCurSel(hwnd, idx, 1, psInfo->proppage[idx].hpage);
    25392749
     
    25482758         WCHAR szText[256];
    25492759
    2550          if (LoadStringW(psInfo->ppshheader.hInstance, 
     2760         if (LoadStringW(psInfo->ppshheader.hInstance,
    25512761                 (UINT)psInfo->ppshheader.pszCaption, szText, 255))
    25522762            PROPSHEET_SetTitleW(hwnd, psInfo->ppshheader.dwFlags, szText);
     
    26012811        hwndPage = psInfo->proppage[psInfo->active_page].hwndPage;
    26022812
    2603       SetWindowLongW(hwnd, DWL_MSGRESULT, hwndPage);
     2813      SetWindowLongW(hwnd, DWL_MSGRESULT, (LONG)hwndPage);
    26042814
    26052815      return TRUE;
     
    26182828      HWND hwndTabCtrl = GetDlgItem(hwnd, IDC_TABCONTROL);
    26192829
    2620       SetWindowLongW(hwnd, DWL_MSGRESULT, hwndTabCtrl);
     2830      SetWindowLongW(hwnd, DWL_MSGRESULT, (LONG)hwndTabCtrl);
    26212831
    26222832      return TRUE;
     
    26502860      if (LoadStringW(COMCTL32_hModule, IDS_CLOSE, buf, sizeof(buf)))
    26512861         SetWindowTextW(hwndOK, buf);
    2652  
     2862
    26532863      return FALSE;
    26542864    }
     
    26652875    case PSM_REBOOTSYSTEM:
    26662876    {
    2667       PropSheetInfo* psInfo = (PropSheetInfo*) GetPropW(hwnd, 
     2877      PropSheetInfo* psInfo = (PropSheetInfo*) GetPropW(hwnd,
    26682878                                                        PropSheetInfoStr);
    26692879
     
    26752885      PROPSHEET_SetTitleA(hwnd, (DWORD) wParam, (LPCSTR) lParam);
    26762886      return TRUE;
    2677    
     2887
    26782888    case PSM_SETTITLEW:
    26792889      PROPSHEET_SetTitleW(hwnd, (DWORD) wParam, (LPCWSTR) lParam);
     
    27312941
    27322942    case PSM_SETFINISHTEXTA:
    2733       PROPSHEET_SetFinishTextA(hwnd, (LPCSTR) lParam);       
     2943      PROPSHEET_SetFinishTextA(hwnd, (LPCSTR) lParam);
    27342944      return TRUE;
    27352945
     
    27392949
    27402950    case PSM_SETCURSELID:
    2741         FIXME("Unimplemented msg PSM_SETCURSELID\n");
    2742         return FALSE;
     2951        PROPSHEET_SetCurSelId(hwnd, (int)lParam);
     2952        return TRUE;
    27432953
    27442954    case PSM_SETFINISHTEXTW:
    2745         PROPSHEET_SetFinishTextW(hwnd, (LPCWSTR) lParam);       
     2955        PROPSHEET_SetFinishTextW(hwnd, (LPCWSTR) lParam);
    27462956        return FALSE;
    27472957
     
    27492959      return FALSE;
    27502960  }
    2751  
     2961
    27522962  return FALSE;
    27532963}
    2754 
Note: See TracChangeset for help on using the changeset viewer.