Changeset 2126 for trunk/src/comctl32/propsheet.c
- Timestamp:
- Dec 18, 1999, 9:57:01 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/comctl32/propsheet.c
r1861 r2126 1 /* $Id: propsheet.c,v 1.1 6 1999-11-27 18:14:37achimha Exp $ */1 /* $Id: propsheet.c,v 1.17 1999-12-18 20:56:59 achimha Exp $ */ 2 2 /* 3 3 * Property Sheets … … 13 13 */ 14 14 15 /* WINE 991 114level */15 /* WINE 991212 level */ 16 16 17 17 /* CB: Odin problems: … … 23 23 #include "commctrl.h" 24 24 #include "prsht.h" 25 #include "dialog.h" 26 #include "win.h" 25 27 #include "winnls.h" 26 28 #include "comctl32.h" 27 29 #include "heap.h" 28 30 29 31 /****************************************************************************** … … 41 43 typedef struct tagPropPageInfo 42 44 { 43 int index; /* corresponds to the index in ppshheader->ppsp */44 45 HPROPSHEETPAGE hpage; /* to keep track of pages not passed to PropertySheet */ 45 46 HWND hwndPage; … … 48 49 BOOL hasHelp; 49 50 BOOL useCallback; 51 BOOL hasIcon; 50 52 } PropPageInfo; 51 53 … … 55 57 int nPages; 56 58 int active_page; 57 LP CPROPSHEETHEADERA ppshheader;59 LPPROPSHEETHEADERA ppshheader; 58 60 BOOL isModeless; 59 61 BOOL hasHelp; … … 62 64 BOOL restartWindows; 63 65 BOOL rebootSystem; 66 BOOL activeValid; 64 67 PropPageInfo* proppage; 65 68 int x; … … 84 87 #define MAX_CAPTION_LENGTH 255 85 88 #define MAX_TABTEXT_LENGTH 255 86 89 #define MAX_BUTTONTEXT_LENGTH 64 87 90 88 91 /****************************************************************************** … … 102 105 static int PROPSHEET_CreatePage(HWND hwndParent, int index, 103 106 const PropSheetInfo * psInfo, 104 LPCPROPSHEETPAGEA ppshpage, 105 BOOL showPage); 107 LPPROPSHEETPAGEA ppshpage); 106 108 static BOOL PROPSHEET_ShowPage(HWND hwndDlg, int index, PropSheetInfo * psInfo); 107 109 static PADDING_INFO PROPSHEET_GetPaddingInfo(HWND hwndDlg); … … 109 111 static BOOL PROPSHEET_Next(HWND hwndDlg); 110 112 static BOOL PROPSHEET_Finish(HWND hwndDlg); 111 static BOOL PROPSHEET_Apply(HWND hwndDlg );112 static void PROPSHEET_Cancel(HWND hwndDlg );113 static BOOL PROPSHEET_Apply(HWND hwndDlg, LPARAM lParam); 114 static void PROPSHEET_Cancel(HWND hwndDlg, LPARAM lParam); 113 115 static void PROPSHEET_Help(HWND hwndDlg); 114 116 static void PROPSHEET_Changed(HWND hwndDlg, HWND hwndDirtyPage); … … 123 125 static LRESULT PROPSHEET_QuerySiblings(HWND hwndDlg, 124 126 WPARAM wParam, LPARAM lParam); 125 static LPCPROPSHEETPAGEA PROPSHEET_GetPSPPage(const PropSheetInfo * psInfo,126 int index);127 127 static BOOL PROPSHEET_AddPage(HWND hwndDlg, 128 128 HPROPSHEETPAGE hpage); … … 135 135 static void PROPSHEET_SetWizButtons(HWND hwndDlg, DWORD dwFlags); 136 136 static PADDING_INFO PROPSHEET_GetPaddingInfoWizard(HWND hwndDlg); 137 static BOOL PROPSHEET_IsDialogMessage(HWND hwnd, LPMSG lpMsg); 138 static INT PROPSHEET_DoDialogBox( HWND hwnd, HWND owner); 137 139 138 140 BOOL WINAPI … … 155 157 psInfo->isModeless = dwFlags & PSH_MODELESS; 156 158 psInfo->ppshheader = lppsh; 159 psInfo->ppshheader = COMCTL32_Alloc(sizeof(PROPSHEETHEADERA)); 160 *psInfo->ppshheader = *lppsh; 161 162 if (HIWORD(lppsh->pszCaption)) 163 psInfo->ppshheader->pszCaption = HEAP_strdupA( GetProcessHeap(), 164 0, lppsh->pszCaption ); 165 157 166 psInfo->nPages = lppsh->nPages; 158 167 … … 164 173 else 165 174 psInfo->active_page = lppsh->u2.nStartPage; 175 176 if (psInfo->active_page < 0 || psInfo->active_page >= psInfo->nPages) 177 psInfo->active_page = 0; 166 178 167 179 psInfo->restartWindows = FALSE; 168 180 psInfo->rebootSystem = FALSE; 169 181 psInfo->hImageList = 0; 182 psInfo->activeValid = FALSE; 170 183 171 184 return TRUE; … … 187 200 int width, height; 188 201 189 if (psInfo->ppshheader->dwFlags & PSH_PROPSHEETPAGE) 190 psInfo->proppage[index].hpage = 0; 202 psInfo->proppage[index].hpage = (HPROPSHEETPAGE)lppsp; 191 203 psInfo->proppage[index].hwndPage = 0; 192 204 psInfo->proppage[index].isDirty = FALSE; … … 198 210 psInfo->proppage[index].useCallback = dwFlags & PSP_USECALLBACK; 199 211 psInfo->proppage[index].hasHelp = dwFlags & PSP_HASHELP; 212 psInfo->proppage[index].hasIcon = dwFlags & (PSP_USEHICON | PSP_USEICONID); 200 213 201 214 /* as soon as we have a page with the help flag, set the sheet flag on */ … … 320 333 hIcon = lppsp->u2.hIcon; 321 334 322 if (psInfo->hImageList == 0) 323 psInfo->hImageList = ImageList_Create(icon_cx, icon_cy, ILC_COLOR, 1, 1); 324 325 ImageList_AddIcon(psInfo->hImageList, hIcon); 335 if ( hIcon ) 336 { 337 if (psInfo->hImageList == 0 ) 338 psInfo->hImageList = ImageList_Create(icon_cx, icon_cy, ILC_COLOR, 1, 1); 339 340 ImageList_AddIcon(psInfo->hImageList, hIcon); 341 } 342 326 343 } 327 344 328 345 return TRUE; 346 } 347 348 /****************************************************************************** 349 * PROPSHEET_DoDialogBox 350 * 351 * Copied from windows/dialog.c:DIALOG_DoDialogBox 352 */ 353 static INT PROPSHEET_DoDialogBox( HWND hwnd, HWND owner) 354 { 355 WND * wndPtr; 356 DIALOGINFO * dlgInfo; 357 MSG msg; 358 INT retval; 359 360 //AH: that WINE internal - design violation!!1 361 #if 0 362 /* Owner must be a top-level window */ 363 owner = WIN_GetTopParent( owner ); 364 if (!(wndPtr = WIN_FindWndPtr( hwnd ))) return -1; 365 dlgInfo = (DIALOGINFO *)wndPtr->wExtra; 366 367 if (!dlgInfo->flags & DF_END) /* was EndDialog called in WM_INITDIALOG ? */ 368 { 369 EnableWindow( owner, FALSE ); 370 ShowWindow( hwnd, SW_SHOW ); 371 while (GetMessageA(&msg, 0, 0, 0)) 372 { 373 if (!PROPSHEET_IsDialogMessage( hwnd, &msg)) 374 { 375 TranslateMessage( &msg ); 376 DispatchMessageA( &msg ); 377 } 378 if (dlgInfo->flags & DF_END) break; 379 } 380 EnableWindow( owner, TRUE ); 381 } 382 retval = dlgInfo->idResult; 383 384 WIN_ReleaseWndPtr(wndPtr); 385 #endif 386 DestroyWindow( hwnd ); 387 return retval; 329 388 } 330 389 … … 335 394 */ 336 395 337 //AH: WINE 99 0923 not merged due to changes from CB396 //AH: WINE 9912123 not merged due to design violation (internal WINE structures used) 338 397 339 398 BOOL PROPSHEET_CreateDialog(PropSheetInfo* psInfo) 340 399 { 400 #if 0 341 401 LRESULT ret; 342 402 LPCVOID template; 403 LPVOID temp = 0; 343 404 HRSRC hRes; 344 345 if (psInfo->useCallback) 346 (*(psInfo->ppshheader->pfnCallback))(0, PSCB_PRECREATE, (LPARAM)template); 347 348 if (!(hRes = FindResourceA(COMCTL32_hModule, 349 MAKEINTRESOURCEA(IDD_PROPSHEET), 405 DWORD resSize; 406 WORD resID = IDD_PROPSHEET; 407 408 if (psInfo->ppshheader->dwFlags & PSH_WIZARD) 409 resID = IDD_WIZARD; 410 411 if(!(hRes = FindResourceA(COMCTL32_hModule, 412 MAKEINTRESOURCEA(resID), 350 413 RT_DIALOGA))) 351 414 return FALSE; 352 415 353 if 416 if(!(template = (LPVOID)LoadResource(COMCTL32_hModule, hRes))) 354 417 return FALSE; 355 418 419 /* 420 * Make a copy of the dialog template. 421 */ 422 resSize = SizeofResource(COMCTL32_hModule, hRes); 423 424 temp = COMCTL32_Alloc(resSize); 425 426 if (!temp) 427 return FALSE; 428 429 memcpy(temp, template, resSize); 430 356 431 if (psInfo->useCallback) 357 (*(psInfo->ppshheader->pfnCallback))(0, PSCB_PRECREATE, (LPARAM)template); 432 (*(psInfo->ppshheader->pfnCallback))(0, PSCB_PRECREATE, (LPARAM)temp); 433 434 ret = CreateDialogIndirectParamA(psInfo->ppshheader->hInstance, 435 (LPDLGTEMPLATEA) temp, 436 psInfo->ppshheader->hwndParent, 437 (DLGPROC) PROPSHEET_DialogProc, 438 (LPARAM)psInfo); 439 440 if (!(psInfo->ppshheader->dwFlags & PSH_MODELESS)) 441 ret = PROPSHEET_DoDialogBox((HWND)ret, psInfo->ppshheader->hwndParent); 442 443 COMCTL32_Free(temp); 444 445 return ret; 446 #endif 447 LRESULT ret; 448 LPCVOID template; 449 LPVOID temp = 0; 450 HRSRC hRes; 451 DWORD resSize; 452 WORD resID = IDD_PROPSHEET; 453 454 if (psInfo->ppshheader->dwFlags & PSH_WIZARD) 455 resID = IDD_WIZARD; 456 457 if(!(hRes = FindResourceA(COMCTL32_hModule, 458 MAKEINTRESOURCEA(resID), 459 RT_DIALOGA))) 460 return FALSE; 461 462 if(!(template = (LPVOID)LoadResource(COMCTL32_hModule, hRes))) 463 return FALSE; 464 465 /* 466 * Make a copy of the dialog template. 467 */ 468 resSize = SizeofResource(COMCTL32_hModule, hRes); 469 470 temp = COMCTL32_Alloc(resSize); 471 472 if (!temp) 473 return FALSE; 474 475 memcpy(temp, template, resSize); 476 477 if (psInfo->useCallback) 478 (*(psInfo->ppshheader->pfnCallback))(0, PSCB_PRECREATE, (LPARAM)temp); 358 479 359 480 if (psInfo->ppshheader->dwFlags & PSH_MODELESS) 360 481 ret = CreateDialogIndirectParamA(psInfo->ppshheader->hInstance, 361 (LPDLGTEMPLATEA) temp late,482 (LPDLGTEMPLATEA) temp, 362 483 psInfo->ppshheader->hwndParent, 363 484 (DLGPROC) PROPSHEET_DialogProc, … … 365 486 else 366 487 ret = DialogBoxIndirectParamA(psInfo->ppshheader->hInstance, 367 (LPDLGTEMPLATEA) temp late,488 (LPDLGTEMPLATEA) temp, 368 489 psInfo->ppshheader->hwndParent, 369 490 (DLGPROC) PROPSHEET_DialogProc, 370 491 (LPARAM)psInfo); 492 493 COMCTL32_Free(temp); 371 494 372 495 return ret; … … 840 963 TCITEMA item; 841 964 int i, nTabs; 965 int iImage = 0; 842 966 char tabtext[MAX_TABTEXT_LENGTH] = "Tab text"; 843 967 … … 853 977 if (psInfo->hImageList) 854 978 { 855 item.mask |= TCIF_IMAGE;856 979 SendMessageA(hwndTabCtrl, TCM_SETIMAGELIST, 0, (LPARAM)psInfo->hImageList); 857 980 } … … 859 982 for (i = 0; i < nTabs; i++) 860 983 { 861 item.iImage = i; 984 if ( psInfo->proppage[i].hasIcon ) 985 { 986 item.mask |= TCIF_IMAGE; 987 item.iImage = iImage++; 988 } 989 else 990 { 991 item.mask &= ~TCIF_IMAGE; 992 } 862 993 863 994 WideCharToMultiByte(CP_ACP, 0, … … 879 1010 int index, 880 1011 const PropSheetInfo * psInfo, 881 LPCPROPSHEETPAGEA ppshpage, 882 BOOL showPage) 1012 LPPROPSHEETPAGEA ppshpage) 883 1013 { 884 1014 DLGTEMPLATE* pTemplate; … … 915 1045 } 916 1046 917 918 { 919 ((MyDLGTEMPLATEEX*)pTemplate)->style |= WS_CHILD ;1047 if (((MyDLGTEMPLATEEX*)pTemplate)->signature == 0xFFFF) 1048 { 1049 ((MyDLGTEMPLATEEX*)pTemplate)->style |= WS_CHILD | DS_CONTROL; 920 1050 ((MyDLGTEMPLATEEX*)pTemplate)->style &= ~DS_MODALFRAME; 921 1051 ((MyDLGTEMPLATEEX*)pTemplate)->style &= ~WS_CAPTION; … … 923 1053 ((MyDLGTEMPLATEEX*)pTemplate)->style &= ~WS_POPUP; 924 1054 ((MyDLGTEMPLATEEX*)pTemplate)->style &= ~WS_DISABLED; 1055 ((MyDLGTEMPLATEEX*)pTemplate)->style &= ~WS_VISIBLE; 925 1056 } 926 1057 else 927 1058 { 928 pTemplate->style |= WS_CHILD ;1059 pTemplate->style |= WS_CHILD | DS_CONTROL; 929 1060 pTemplate->style &= ~DS_MODALFRAME; 930 1061 pTemplate->style &= ~WS_CAPTION; … … 932 1063 pTemplate->style &= ~WS_POPUP; 933 1064 pTemplate->style &= ~WS_DISABLED; 1065 pTemplate->style &= ~WS_VISIBLE; 934 1066 } 935 1067 … … 972 1104 0, 0, SWP_NOSIZE); 973 1105 974 if (showPage)975 {976 NMHDR hdr;977 978 hdr.hwndFrom = hwndParent;979 hdr.idFrom = GetWindowLongA(hwndParent,GWL_ID);980 hdr.code = PSN_SETACTIVE;981 982 /*983 * Send the notification before showing the page.984 */985 SendMessageA(hwndPage, WM_NOTIFY, 0, (LPARAM) &hdr);986 987 ShowWindow(hwndPage, SW_SHOW);988 }989 else990 ShowWindow(hwndPage, SW_HIDE);991 992 1106 return TRUE; 993 1107 } … … 1001 1115 { 1002 1116 if (index == psInfo->active_page) 1117 { 1118 if (GetTopWindow(hwndDlg) != psInfo->proppage[index].hwndPage) 1119 SetWindowPos(psInfo->proppage[index].hwndPage, HWND_TOP, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE); 1003 1120 return TRUE; 1004 1005 ShowWindow(psInfo->proppage[psInfo->active_page].hwndPage, SW_HIDE); 1006 1007 if (psInfo->proppage[index].hwndPage != 0) 1008 ShowWindow(psInfo->proppage[index].hwndPage, SW_SHOW); 1009 else 1010 { 1011 LPCPROPSHEETPAGEA ppshpage = PROPSHEET_GetPSPPage(psInfo, index); 1012 PROPSHEET_CreatePage(hwndDlg, index, psInfo, ppshpage, TRUE); 1121 } 1122 1123 if (psInfo->active_page != -1) 1124 ShowWindow(psInfo->proppage[psInfo->active_page].hwndPage, SW_HIDE); 1125 1126 if (psInfo->proppage[index].hwndPage == 0) 1127 { 1128 LPCPROPSHEETPAGEA ppshpage; 1129 PSHNOTIFY psn; 1130 1131 ppshpage = (LPCPROPSHEETPAGEA)psInfo->proppage[index].hpage; 1132 PROPSHEET_CreatePage(hwndDlg, index, psInfo, ppshpage); 1133 1134 psn.hdr.hwndFrom = hwndDlg; 1135 psn.hdr.code = PSN_SETACTIVE; 1136 psn.hdr.idFrom = 0; 1137 psn.lParam = 0; 1138 1139 /* Send the notification before showing the page. */ 1140 SendMessageA(psInfo->proppage[index].hwndPage, 1141 WM_NOTIFY, 0, (LPARAM) &psn); 1142 1143 /* 1144 * TODO: check return value. 1145 */ 1146 } 1147 1148 ShowWindow(psInfo->proppage[index].hwndPage, SW_SHOW); 1149 1150 if (!(psInfo->ppshheader->dwFlags & PSH_WIZARD)) 1151 { 1152 HWND hwndTabCtrl; 1153 1154 /* Synchronize current selection with tab control */ 1155 hwndTabCtrl = GetDlgItem(hwndDlg, IDC_TABCONTROL); 1156 SendMessageA(hwndTabCtrl, TCM_SETCURSEL, index, 0); 1013 1157 } 1014 1158 1015 1159 psInfo->active_page = index; 1160 psInfo->activeValid = TRUE; 1016 1161 1017 1162 return TRUE; … … 1024 1169 { 1025 1170 BOOL res; 1026 NMHDR hdr;1171 PSHNOTIFY psn; 1027 1172 HWND hwndPage; 1028 HWND hwndBack = GetDlgItem(hwndDlg, IDC_BACK_BUTTON);1029 1173 PropSheetInfo* psInfo = (PropSheetInfo*) GetPropA(hwndDlg, 1030 1174 PropSheetInfoStr); 1031 1175 1032 if (psInfo->active_page < =0)1176 if (psInfo->active_page < 0) 1033 1177 return FALSE; 1034 1178 1035 hdr.hwndFrom = hwndDlg; 1036 hdr.idFrom = GetWindowLongA(hwndDlg,GWL_ID); 1037 hdr.code = PSN_WIZBACK; 1038 1179 psn.hdr.code = PSN_WIZBACK; 1180 psn.hdr.hwndFrom = hwndDlg; 1181 psn.hdr.idFrom = 0; 1182 psn.lParam = 0; 1183 1039 1184 hwndPage = psInfo->proppage[psInfo->active_page].hwndPage; 1040 1185 1041 if (SendMessageA(hwndPage, WM_NOTIFY, 0, (LPARAM) & hdr) == -1)1186 if (SendMessageA(hwndPage, WM_NOTIFY, 0, (LPARAM) &psn) == -1) 1042 1187 return FALSE; 1043 1188 1044 res = PROPSHEET_CanSetCurSel(hwndDlg); 1045 if(res != FALSE) 1046 { 1047 res = PROPSHEET_SetCurSel(hwndDlg, psInfo->active_page - 1, 0); 1048 } 1049 1050 /* if we went to page 0, disable Back button */ 1051 if (res && (psInfo->active_page == 0)) 1052 EnableWindow(hwndBack, FALSE); 1189 if (psInfo->active_page > 0) 1190 { 1191 res = PROPSHEET_CanSetCurSel(hwndDlg); 1192 if(res != FALSE) 1193 { 1194 res = PROPSHEET_SetCurSel(hwndDlg, psInfo->active_page - 1, 0); 1195 } 1196 } 1053 1197 1054 1198 return TRUE; … … 1060 1204 static BOOL PROPSHEET_Next(HWND hwndDlg) 1061 1205 { 1062 NMHDR hdr;1206 PSHNOTIFY psn; 1063 1207 HWND hwndPage; 1064 1208 LRESULT msgResult = 0; … … 1066 1210 PropSheetInfoStr); 1067 1211 1068 if (psInfo->active_page < 0 || psInfo->active_page == psInfo->nPages - 1)1212 if (psInfo->active_page < 0) 1069 1213 return FALSE; 1070 1214 1071 hdr.hwndFrom = hwndDlg; 1072 hdr.idFrom = GetWindowLongA(hwndDlg,GWL_ID); 1073 hdr.code = PSN_WIZNEXT; 1074 1215 psn.hdr.code = PSN_WIZNEXT; 1216 psn.hdr.hwndFrom = hwndDlg; 1217 psn.hdr.idFrom = 0; 1218 psn.lParam = 0; 1219 1075 1220 hwndPage = psInfo->proppage[psInfo->active_page].hwndPage; 1076 1221 1077 msgResult = SendMessageA(hwndPage, WM_NOTIFY, 0, (LPARAM) & hdr);1078 1079 //TRACE("msg result %ld\n", msgResult);1222 msgResult = SendMessageA(hwndPage, WM_NOTIFY, 0, (LPARAM) &psn); 1223 1224 TRACE("msg result %ld\n", msgResult); 1080 1225 1081 1226 if (msgResult == -1) … … 1095 1240 static BOOL PROPSHEET_Finish(HWND hwndDlg) 1096 1241 { 1097 NMHDR hdr;1242 PSHNOTIFY psn; 1098 1243 HWND hwndPage; 1099 1244 LRESULT msgResult = 0; … … 1104 1249 return FALSE; 1105 1250 1106 hdr.hwndFrom = hwndDlg; 1107 hdr.idFrom = GetWindowLongA(hwndDlg,GWL_ID); 1108 hdr.code = PSN_WIZFINISH; 1109 1251 psn.hdr.code = PSN_WIZFINISH; 1252 psn.hdr.hwndFrom = hwndDlg; 1253 psn.hdr.idFrom = 0; 1254 psn.lParam = 0; 1255 1110 1256 hwndPage = psInfo->proppage[psInfo->active_page].hwndPage; 1111 1257 1112 msgResult = SendMessageA(hwndPage, WM_NOTIFY, 0, (LPARAM) & hdr);1113 1114 //TRACE("msg result %ld\n", msgResult);1258 msgResult = SendMessageA(hwndPage, WM_NOTIFY, 0, (LPARAM) &psn); 1259 1260 TRACE("msg result %ld\n", msgResult); 1115 1261 1116 1262 if (msgResult != 0) … … 1118 1264 1119 1265 if (psInfo->isModeless) 1120 psInfo->active _page = -1;1266 psInfo->activeValid = FALSE; 1121 1267 else 1122 1268 EndDialog(hwndDlg, TRUE); … … 1128 1274 * PROPSHEET_Apply 1129 1275 */ 1130 static BOOL PROPSHEET_Apply(HWND hwndDlg )1276 static BOOL PROPSHEET_Apply(HWND hwndDlg, LPARAM lParam) 1131 1277 { 1132 1278 int i; 1133 NMHDR hdr;1134 1279 HWND hwndPage; 1280 PSHNOTIFY psn; 1135 1281 LRESULT msgResult; 1136 1282 PropSheetInfo* psInfo = (PropSheetInfo*) GetPropA(hwndDlg, … … 1140 1286 return FALSE; 1141 1287 1142 hdr.hwndFrom = hwndDlg; 1143 hdr.idFrom = GetWindowLongA(hwndDlg,GWL_ID); 1288 psn.hdr.hwndFrom = hwndDlg; 1289 psn.hdr.idFrom = 0; 1290 psn.lParam = 0; 1291 1144 1292 1145 1293 /* 1146 1294 * Send PSN_KILLACTIVE to the current page. 1147 1295 */ 1148 hdr.code = PSN_KILLACTIVE;1296 psn.hdr.code = PSN_KILLACTIVE; 1149 1297 1150 1298 hwndPage = psInfo->proppage[psInfo->active_page].hwndPage; 1151 1299 1152 if (SendMessageA(hwndPage, WM_NOTIFY, 0, (LPARAM) & hdr) != FALSE)1300 if (SendMessageA(hwndPage, WM_NOTIFY, 0, (LPARAM) &psn) != FALSE) 1153 1301 return FALSE; 1154 1302 … … 1156 1304 * Send PSN_APPLY to all pages. 1157 1305 */ 1158 hdr.code = PSN_APPLY; 1159 1306 psn.hdr.code = PSN_APPLY; 1307 psn.lParam = lParam; 1308 1160 1309 for (i = 0; i < psInfo->nPages; i++) 1161 1310 { 1162 1311 hwndPage = psInfo->proppage[i].hwndPage; 1163 msgResult = SendMessageA(hwndPage, WM_NOTIFY, 0, (LPARAM) &hdr); 1164 1165 if (msgResult == PSNRET_INVALID_NOCHANGEPAGE) 1166 return FALSE; 1312 if (hwndPage) 1313 { 1314 msgResult = SendMessageA(hwndPage, WM_NOTIFY, 0, (LPARAM) &psn); 1315 if (msgResult == PSNRET_INVALID_NOCHANGEPAGE) 1316 return FALSE; 1317 } 1318 } 1319 1320 if(lParam) 1321 { 1322 psInfo->activeValid = FALSE; 1323 } 1324 else if(psInfo->active_page >= 0) 1325 { 1326 psn.hdr.code = PSN_SETACTIVE; 1327 psn.lParam = 0; 1328 hwndPage = psInfo->proppage[psInfo->active_page].hwndPage; 1329 SendMessageA(hwndPage, WM_NOTIFY, 0, (LPARAM) &psn); 1167 1330 } 1168 1331 … … 1173 1336 * PROPSHEET_Cancel 1174 1337 */ 1175 static void PROPSHEET_Cancel(HWND hwndDlg )1338 static void PROPSHEET_Cancel(HWND hwndDlg, LPARAM lParam) 1176 1339 { 1177 1340 PropSheetInfo* psInfo = (PropSheetInfo*) GetPropA(hwndDlg, 1178 1341 PropSheetInfoStr); 1179 1342 HWND hwndPage; 1180 NMHDR hdr; 1343 PSHNOTIFY psn; 1344 int i; 1181 1345 1182 1346 if (psInfo->active_page < 0) … … 1184 1348 1185 1349 hwndPage = psInfo->proppage[psInfo->active_page].hwndPage; 1186 hdr.hwndFrom = hwndDlg; 1187 hdr.idFrom = GetWindowLongA(hwndDlg,GWL_ID); 1188 hdr.code = PSN_QUERYCANCEL; 1189 1190 if (SendMessageA(hwndPage, WM_NOTIFY, 0, (LPARAM) &hdr)) 1350 psn.hdr.code = PSN_QUERYCANCEL; 1351 psn.hdr.hwndFrom = hwndDlg; 1352 psn.hdr.idFrom = 0; 1353 psn.lParam = 0; 1354 1355 if (SendMessageA(hwndPage, WM_NOTIFY, 0, (LPARAM) &psn)) 1191 1356 return; 1192 1357 1193 hdr.code = PSN_RESET; 1194 1195 SendMessageA(hwndPage, WM_NOTIFY, 0, (LPARAM) &hdr); 1358 psn.hdr.code = PSN_RESET; 1359 psn.lParam = lParam; 1360 1361 for (i = 0; i < psInfo->nPages; i++) 1362 { 1363 hwndPage = psInfo->proppage[i].hwndPage; 1364 1365 if (hwndPage) 1366 SendMessageA(hwndPage, WM_NOTIFY, 0, (LPARAM) &psn); 1367 } 1196 1368 1197 1369 if (psInfo->isModeless) 1198 psInfo->active_page = -1; /* makes PSM_GETCURRENTPAGEHWND return NULL */ 1370 { 1371 /* makes PSM_GETCURRENTPAGEHWND return NULL */ 1372 psInfo->activeValid = FALSE; 1373 } 1199 1374 else 1200 1375 EndDialog(hwndDlg, FALSE); … … 1209 1384 PropSheetInfoStr); 1210 1385 HWND hwndPage; 1211 NMHDR hdr;1386 PSHNOTIFY psn; 1212 1387 1213 1388 if (psInfo->active_page < 0) … … 1215 1390 1216 1391 hwndPage = psInfo->proppage[psInfo->active_page].hwndPage; 1217 hdr.hwndFrom = hwndDlg; 1218 hdr.idFrom = GetWindowLongA(hwndDlg,GWL_ID); 1219 hdr.code = PSN_HELP; 1220 1221 SendMessageA(hwndPage, WM_NOTIFY, 0, (LPARAM) &hdr); 1392 psn.hdr.code = PSN_HELP; 1393 psn.hdr.hwndFrom = hwndDlg; 1394 psn.hdr.idFrom = 0; 1395 psn.lParam = 0; 1396 1397 SendMessageA(hwndPage, WM_NOTIFY, 0, (LPARAM) &psn); 1222 1398 } 1223 1399 … … 1332 1508 PropSheetInfoStr); 1333 1509 HWND hwndPage; 1334 NMHDR hdr;1335 1336 if (!psInfo || psInfo->active_page < 0)1510 PSHNOTIFY psn; 1511 1512 if (!psInfo) 1337 1513 return FALSE; 1514 1515 if (psInfo->active_page < 0) 1516 return TRUE; 1517 1338 1518 /* 1339 1519 * Notify the current page. 1340 1520 */ 1341 1521 hwndPage = psInfo->proppage[psInfo->active_page].hwndPage; 1342 1343 hdr.hwndFrom = hwndDlg;1344 hdr.idFrom = GetWindowLongA(hwndDlg,GWL_ID);1345 hdr.code = PSN_KILLACTIVE;1346 1347 return !SendMessageA(hwndPage, WM_NOTIFY, 0, (LPARAM) & hdr);1522 psn.hdr.code = PSN_KILLACTIVE; 1523 psn.hdr.hwndFrom = hwndDlg; 1524 psn.hdr.idFrom = 0; 1525 psn.lParam = 0; 1526 1527 return !SendMessageA(hwndPage, WM_NOTIFY, 0, (LPARAM) &psn); 1348 1528 } 1349 1529 … … 1359 1539 HWND hwndPage; 1360 1540 HWND hwndHelp = GetDlgItem(hwndDlg, IDHELP); 1361 NMHDR hdr; 1362 1363 if (psInfo->active_page < 0) 1364 return FALSE; 1365 1366 hwndPage = psInfo->proppage[psInfo->active_page].hwndPage; 1367 1368 hdr.hwndFrom = hwndDlg; 1369 hdr.idFrom = GetWindowLongA(hwndDlg,GWL_ID); 1370 /* 1371 * hpage takes precedence over index. 1372 */ 1541 1542 /* hpage takes precedence over index */ 1373 1543 if (hpage != NULL) 1374 1544 index = PROPSHEET_GetPageIndex(hpage, psInfo); … … 1389 1559 { 1390 1560 int result; 1391 hdr.code = PSN_SETACTIVE; 1392 1393 result = SendMessageA(hwndPage, WM_NOTIFY, 0, (LPARAM) &hdr); 1561 PSHNOTIFY psn; 1562 1563 psn.hdr.code = PSN_SETACTIVE; 1564 psn.hdr.hwndFrom = hwndDlg; 1565 psn.hdr.idFrom = 0; 1566 psn.lParam = 0; 1567 1568 result = SendMessageA(hwndPage, WM_NOTIFY, 0, (LPARAM) &psn); 1569 1394 1570 /* 1395 * TODO: check return value. 1571 * TODO: check return value. 1396 1572 */ 1397 1573 } … … 1487 1663 } 1488 1664 1489 /******************************************************************************1490 * PROPSHEET_GetPSPPage1491 */1492 static LPCPROPSHEETPAGEA PROPSHEET_GetPSPPage(const PropSheetInfo * psInfo,1493 int index)1494 {1495 BOOL usePSP = psInfo->ppshheader->dwFlags & PSH_PROPSHEETPAGE;1496 LPCPROPSHEETPAGEA lppsp;1497 int realIndex = psInfo->proppage[index].index;1498 1499 if (usePSP)1500 {1501 BYTE* pByte;1502 1503 lppsp = psInfo->ppshheader->u3.ppsp;1504 1505 pByte = (BYTE*) lppsp;1506 1507 pByte += (lppsp->dwSize * realIndex);1508 lppsp = (LPCPROPSHEETPAGEA)pByte;1509 }1510 else1511 lppsp = (LPCPROPSHEETPAGEA) psInfo->ppshheader->u3.phpage[realIndex];1512 1513 return lppsp;1514 }1515 1665 1516 1666 /****************************************************************************** … … 1535 1685 1536 1686 PROPSHEET_CollectPageInfo(ppsp, psInfo, psInfo->nPages); 1537 psInfo->proppage[psInfo->nPages].index = -1;1538 1687 psInfo->proppage[psInfo->nPages].hpage = hpage; 1539 1688 1540 /* 1541 * Create the page but don't show it. 1542 */ 1543 PROPSHEET_CreatePage(hwndDlg, psInfo->nPages, psInfo, ppsp, FALSE); 1689 if (ppsp->dwFlags & PSP_PREMATURE) 1690 { 1691 /* Create the page but don't show it */ 1692 PROPSHEET_CreatePage(hwndDlg, psInfo->nPages, psInfo, ppsp); 1693 } 1544 1694 1545 1695 /* … … 1558 1708 1559 1709 psInfo->nPages++; 1710 1711 /* If it is the only page - show it */ 1712 if(psInfo->nPages == 1) 1713 PROPSHEET_ShowPage(hwndDlg, 0, psInfo); 1560 1714 1561 1715 return TRUE; … … 1575 1729 1576 1730 if (!psInfo) { 1577 // FIXME("No psInfo for propertysheet at windows 0x%04x, returning FALSE...\n", hwndDlg);1578 1731 return FALSE; 1579 1732 } … … 1589 1742 /* Make shure that index is within range */ 1590 1743 if (index < 0 || index >= psInfo->nPages) 1591 1592 //TRACE("Could not find page to remove!\n");1744 { 1745 TRACE("Could not find page to remove!\n"); 1593 1746 return FALSE; 1594 1595 1596 //TRACE("total pages %d removing page %d active page %d\n",1597 //psInfo->nPages, index, psInfo->active_page);1747 } 1748 1749 TRACE("total pages %d removing page %d active page %d\n", 1750 psInfo->nPages, index, psInfo->active_page); 1598 1751 /* 1599 1752 * Check if we're removing the active page. … … 1616 1769 else 1617 1770 { 1618 // TRACE("Removing the only page, close the dialog!\n"); 1619 1620 if (psInfo->isModeless) 1621 psInfo->active_page = -1; 1622 else 1623 EndDialog(hwndDlg, FALSE); 1624 1625 return TRUE; 1771 psInfo->active_page = -1; 1772 if (!psInfo->isModeless) 1773 { 1774 EndDialog(hwndDlg, FALSE); 1775 return TRUE; 1776 } 1626 1777 } 1627 1778 } 1628 1629 if (index < psInfo->active_page) 1779 else if (index < psInfo->active_page) 1630 1780 psInfo->active_page--; 1631 1781 1632 /* Destroy page dialog window. 1633 * If it's last page in modal dialog, it has been destroyed by EndDialog 1634 */ 1635 if (psInfo->isModeless || psInfo->nPages > 1) 1636 DestroyWindow(psInfo->proppage[index].hwndPage); 1637 1782 /* Destroy page dialog window */ 1783 DestroyWindow(psInfo->proppage[index].hwndPage); 1784 1785 /* Free page resources */ 1786 if(psInfo->proppage[index].hpage) 1787 { 1788 PROPSHEETPAGEA* psp = (PROPSHEETPAGEA*)psInfo->proppage[index].hpage; 1789 1790 if ((psp->dwFlags & PSP_USETITLE) && psInfo->proppage[index].pszText) 1791 HeapFree(GetProcessHeap(), 0, (LPVOID)psInfo->proppage[index].pszText); 1792 1793 DestroyPropertySheetPage(psInfo->proppage[index].hpage); 1794 } 1795 1638 1796 /* Remove the tab */ 1639 1797 SendMessageA(hwndTabControl, TCM_DELETEITEM, index, 0); … … 1642 1800 psInfo->proppage = COMCTL32_Alloc(sizeof(PropPageInfo) * psInfo->nPages); 1643 1801 1644 if (index > 0) 1802 if (index > 0) 1645 1803 memcpy(&psInfo->proppage[0], &oldPages[0], index * sizeof(PropPageInfo)); 1646 1804 … … 1664 1822 static void PROPSHEET_SetWizButtons(HWND hwndDlg, DWORD dwFlags) 1665 1823 { 1666 HWND hwndButton; 1667 1668 // TRACE("%ld\n", dwFlags); 1824 HWND hwndBack = GetDlgItem(hwndDlg, IDC_BACK_BUTTON); 1825 HWND hwndNext = GetDlgItem(hwndDlg, IDC_NEXT_BUTTON); 1826 HWND hwndFinish = GetDlgItem(hwndDlg, IDC_FINISH_BUTTON); 1827 1828 TRACE("%ld\n", dwFlags); 1829 1830 EnableWindow(hwndBack, FALSE); 1831 EnableWindow(hwndNext, FALSE); 1832 EnableWindow(hwndFinish, FALSE); 1669 1833 1670 1834 if (dwFlags & PSWIZB_BACK) 1671 { 1672 hwndButton = GetDlgItem(hwndDlg, IDC_BACK_BUTTON); 1673 EnableWindow(hwndButton, TRUE); 1674 } 1835 EnableWindow(hwndBack, TRUE); 1675 1836 1676 1837 if (dwFlags & PSWIZB_NEXT) 1677 1838 { 1678 1839 /* Hide the Finish button */ 1679 hwndButton = GetDlgItem(hwndDlg, IDC_FINISH_BUTTON); 1680 ShowWindow(hwndButton, SW_HIDE); 1840 ShowWindow(hwndFinish, SW_HIDE); 1681 1841 1682 1842 /* Show and enable the Next button */ 1683 hwndButton = GetDlgItem(hwndDlg, IDC_NEXT_BUTTON); 1684 1685 ShowWindow(hwndButton, SW_SHOW); 1686 EnableWindow(hwndButton, TRUE); 1843 ShowWindow(hwndNext, SW_SHOW); 1844 EnableWindow(hwndNext, TRUE); 1687 1845 1688 1846 /* Set the Next button as the default pushbutton */ … … 1693 1851 { 1694 1852 /* Hide the Next button */ 1695 hwndButton = GetDlgItem(hwndDlg, IDC_NEXT_BUTTON); 1696 ShowWindow(hwndButton, SW_HIDE); 1853 ShowWindow(hwndNext, SW_HIDE); 1697 1854 1698 1855 /* Show the Finish button */ 1699 hwndButton = GetDlgItem(hwndDlg, IDC_FINISH_BUTTON); 1700 ShowWindow(hwndButton, SW_SHOW); 1856 ShowWindow(hwndFinish, SW_SHOW); 1701 1857 1702 1858 if (dwFlags & PSWIZB_FINISH) 1703 EnableWindow(hwndButton, TRUE); 1704 else 1705 EnableWindow(hwndButton, FALSE); 1859 EnableWindow(hwndFinish, TRUE); 1706 1860 1707 1861 /* Set the Finish button as the default pushbutton */ … … 1740 1894 static void PROPSHEET_CleanUp(HWND hwndDlg) 1741 1895 { 1896 int i; 1742 1897 PropSheetInfo* psInfo = (PropSheetInfo*) RemovePropA(hwndDlg, 1743 1898 PropSheetInfoStr); 1899 1900 TRACE("\n"); 1901 if (HIWORD(psInfo->ppshheader->pszCaption)) 1902 HeapFree(GetProcessHeap(), 0, (LPVOID)psInfo->ppshheader->pszCaption); 1903 1904 COMCTL32_Free((LPVOID)psInfo->ppshheader); 1905 1906 for (i = 0; i < psInfo->nPages; i++) 1907 { 1908 PROPSHEETPAGEA* psp = (PROPSHEETPAGEA*)psInfo->proppage[i].hpage; 1909 1910 if(psInfo->proppage[i].hwndPage) 1911 DestroyWindow(psInfo->proppage[i].hwndPage); 1912 1913 if(psp) 1914 { 1915 if ((psp->dwFlags & PSP_USETITLE) && psInfo->proppage[i].pszText) 1916 HeapFree(GetProcessHeap(), 0, (LPVOID)psInfo->proppage[i].pszText); 1917 1918 DestroyPropertySheetPage(psInfo->proppage[i].hpage); 1919 } 1920 } 1921 1744 1922 COMCTL32_Free(psInfo->proppage); 1745 1923 COMCTL32_Free(psInfo->strPropertiesFor); … … 1757 1935 PropSheetInfo* psInfo = (PropSheetInfo*) GlobalAlloc(GPTR, 1758 1936 sizeof(PropSheetInfo)); 1759 LPCPROPSHEETPAGEA lppsp;1760 1937 int i; 1938 BYTE* pByte; 1761 1939 1762 1940 PROPSHEET_CollectSheetInfo(lppsh, psInfo); … … 1764 1942 psInfo->proppage = (PropPageInfo*) COMCTL32_Alloc(sizeof(PropPageInfo) * 1765 1943 lppsh->nPages); 1944 pByte = (BYTE*) psInfo->ppshheader->u3.ppsp; 1766 1945 1767 1946 for (i = 0; i < lppsh->nPages; i++) 1768 1947 { 1769 psInfo->proppage[i].index = i;1770 1948 if (!(lppsh->dwFlags & PSH_PROPSHEETPAGE)) 1771 1949 psInfo->proppage[i].hpage = psInfo->ppshheader->u3.phpage[i]; 1772 lppsp = PROPSHEET_GetPSPPage(psInfo, i); 1773 PROPSHEET_CollectPageInfo(lppsp, psInfo, i); 1950 else 1951 { 1952 psInfo->proppage[i].hpage = CreatePropertySheetPageA((LPCPROPSHEETPAGEA)pByte); 1953 pByte += ((LPPROPSHEETPAGEA)pByte)->dwSize; 1954 } 1955 1956 PROPSHEET_CollectPageInfo((LPCPROPSHEETPAGEA)psInfo->proppage[i].hpage, 1957 psInfo, i); 1774 1958 } 1775 1959 … … 1799 1983 *ppsp = *lpPropSheetPage; 1800 1984 1985 if ( !(ppsp->dwFlags & PSP_DLGINDIRECT) && HIWORD( ppsp->u1.pszTemplate ) ) 1986 ppsp->u1.pszTemplate = HEAP_strdupA( GetProcessHeap(), 0, lpPropSheetPage->u1.pszTemplate ); 1987 1988 if ( (ppsp->dwFlags & PSP_USEICONID) && HIWORD( ppsp->u2.pszIcon ) ) 1989 ppsp->u2.pszIcon = HEAP_strdupA( GetProcessHeap(), 0, lpPropSheetPage->u2.pszIcon ); 1990 1991 1992 if ((ppsp->dwFlags & PSP_USETITLE) && HIWORD( ppsp->pszTitle )) 1993 ppsp->pszTitle = HEAP_strdupA( GetProcessHeap(), 0, lpPropSheetPage->pszTitle ); 1994 else if ( !(ppsp->dwFlags & PSP_USETITLE) ) 1995 ppsp->pszTitle = NULL; 1996 1801 1997 return (HPROPSHEETPAGE)ppsp; 1802 1998 } … … 1817 2013 BOOL WINAPI DestroyPropertySheetPage(HPROPSHEETPAGE hPropPage) 1818 2014 { 2015 PROPSHEETPAGEA *psp = (PROPSHEETPAGEA *)hPropPage; 2016 2017 if (!psp) 2018 return FALSE; 2019 2020 if ( !(psp->dwFlags & PSP_DLGINDIRECT) && HIWORD( psp->u1.pszTemplate ) ) 2021 HeapFree(GetProcessHeap(), 0, (LPVOID)psp->u1.pszTemplate); 2022 2023 if ( (psp->dwFlags & PSP_USEICONID) && HIWORD( psp->u2.pszIcon ) ) 2024 HeapFree(GetProcessHeap(), 0, (LPVOID)psp->u2.pszIcon); 2025 2026 if ((psp->dwFlags & PSP_USETITLE) && HIWORD( psp->pszTitle )) 2027 HeapFree(GetProcessHeap(), 0, (LPVOID)psp->pszTitle); 2028 1819 2029 COMCTL32_Free(hPropPage); 1820 2030 1821 2031 return TRUE; 2032 } 2033 2034 /****************************************************************************** 2035 * PROPSHEET_IsDialogMessage 2036 */ 2037 static BOOL PROPSHEET_IsDialogMessage(HWND hwnd, LPMSG lpMsg) 2038 { 2039 PropSheetInfo* psInfo = (PropSheetInfo*) GetPropA(hwnd, PropSheetInfoStr); 2040 2041 if (!psInfo || (hwnd != lpMsg->hwnd && !IsChild(hwnd, lpMsg->hwnd))) 2042 return FALSE; 2043 2044 if (lpMsg->message == WM_KEYDOWN && (GetKeyState(VK_CONTROL) & 0x8000)) 2045 { 2046 int new_page = 0; 2047 INT dlgCode = SendMessageA(lpMsg->hwnd, WM_GETDLGCODE, 0, (LPARAM)lpMsg); 2048 2049 if (!(dlgCode & DLGC_WANTMESSAGE)) 2050 { 2051 switch (lpMsg->wParam) 2052 { 2053 case VK_TAB: 2054 if (GetKeyState(VK_SHIFT) & 0x8000) 2055 new_page = -1; 2056 else 2057 new_page = 1; 2058 break; 2059 2060 case VK_NEXT: new_page = 1; break; 2061 case VK_PRIOR: new_page = -1; break; 2062 } 2063 } 2064 2065 if (new_page) 2066 { 2067 if (PROPSHEET_CanSetCurSel(hwnd) != FALSE) 2068 { 2069 new_page += psInfo->active_page; 2070 2071 if (new_page < 0) 2072 new_page = psInfo->nPages - 1; 2073 else if (new_page >= psInfo->nPages) 2074 new_page = 0; 2075 2076 PROPSHEET_SetCurSel(hwnd, new_page, 0); 2077 } 2078 2079 return TRUE; 2080 } 2081 } 2082 2083 return IsDialogMessageA(hwnd, lpMsg); 1822 2084 } 1823 2085 … … 1836 2098 HWND hwndTabCtrl = GetDlgItem(hwnd, IDC_TABCONTROL); 1837 2099 LPCPROPSHEETPAGEA ppshpage; 2100 int idx; 1838 2101 1839 2102 SetPropA(hwnd, PropSheetInfoStr, (HANDLE)psInfo); … … 1872 2135 if (psInfo->ppshheader->dwFlags & PSH_WIZARD) 1873 2136 { 1874 HWND hwndBack = GetDlgItem(hwnd, IDC_BACK_BUTTON);1875 1876 2137 if (PROPSHEET_IsTooSmallWizard(hwnd, psInfo)) 1877 2138 { … … 1879 2140 PROPSHEET_AdjustButtonsWizard(hwnd, psInfo); 1880 2141 } 1881 1882 /* Disable Back button if we start at page 0 */1883 if (psInfo->active_page == 0)1884 EnableWindow(hwndBack, FALSE);1885 2142 } 1886 2143 else … … 1897 2154 PSCB_INITIALIZED, (LPARAM)0); 1898 2155 1899 ppshpage = PROPSHEET_GetPSPPage(psInfo, psInfo->active_page); 1900 PROPSHEET_CreatePage(hwnd, psInfo->active_page, psInfo, ppshpage, TRUE); 2156 idx = psInfo->active_page; 2157 ppshpage = (LPCPROPSHEETPAGEA)psInfo->proppage[idx].hpage; 2158 psInfo->active_page = -1; 2159 2160 PROPSHEET_SetCurSel(hwnd, idx, psInfo->proppage[idx].hpage); 1901 2161 1902 2162 if (!(psInfo->ppshheader->dwFlags & PSH_WIZARD)) … … 1926 2186 1927 2187 case WM_CLOSE: 1928 PROPSHEET_Cancel(hwnd );2188 PROPSHEET_Cancel(hwnd, 1); 1929 2189 return TRUE; 1930 2190 … … 1940 2200 HWND hwndApplyBtn = GetDlgItem(hwnd, IDC_APPLY_BUTTON); 1941 2201 1942 if (PROPSHEET_Apply(hwnd ) == FALSE)2202 if (PROPSHEET_Apply(hwnd, wID == IDOK ? 1: 0) == FALSE) 1943 2203 break; 1944 1945 EnableWindow(hwndApplyBtn, FALSE);1946 2204 1947 2205 if (wID == IDOK) … … 1959 2217 1960 2218 if (psInfo->isModeless) 1961 psInfo->active _page = -1;2219 psInfo->activeValid = FALSE; 1962 2220 else 1963 2221 EndDialog(hwnd, result); 1964 2222 } 2223 else 2224 EnableWindow(hwndApplyBtn, FALSE); 1965 2225 1966 2226 break; … … 1980 2240 1981 2241 case IDCANCEL: 1982 PROPSHEET_Cancel(hwnd );2242 PROPSHEET_Cancel(hwnd, 0); 1983 2243 break; 1984 2244 … … 2018 2278 HWND hwndPage = 0; 2019 2279 2020 if (psInfo->active _page != -1)2280 if (psInfo->activeValid && psInfo->active_page != -1) 2021 2281 hwndPage = psInfo->proppage[psInfo->active_page].hwndPage; 2022 2282 … … 2062 2322 case PSM_CANCELTOCLOSE: 2063 2323 { 2324 char buf[MAX_BUTTONTEXT_LENGTH]; 2064 2325 HWND hwndOK = GetDlgItem(hwnd, IDOK); 2065 2326 HWND hwndCancel = GetDlgItem(hwnd, IDCANCEL); 2066 2327 2067 2328 EnableWindow(hwndCancel, FALSE); 2068 SetWindowTextA(hwndOK, "Close"); /* FIXME: hardcoded string */ 2069 2070 return TRUE; 2329 if (LoadStringA(COMCTL32_hModule, IDS_CLOSE, buf, sizeof(buf))) 2330 SetWindowTextA(hwndOK, buf); 2331 2332 return FALSE; 2071 2333 } 2072 2334 … … 2095 2357 case PSM_APPLY: 2096 2358 { 2097 BOOL msgResult = PROPSHEET_Apply(hwnd );2359 BOOL msgResult = PROPSHEET_Apply(hwnd, 0); 2098 2360 2099 2361 SetWindowLongA(hwnd, DWL_MSGRESULT, msgResult); … … 2134 2396 case PSM_ISDIALOGMESSAGE: 2135 2397 { 2136 FIXME("Unimplemented msg PSM_ISDIALOGMESSAGE\n"); 2137 return 0; 2398 BOOL msgResult = PROPSHEET_IsDialogMessage(hwnd, (LPMSG)lParam); 2399 SetWindowLongA(hwnd, DWL_MSGRESULT, msgResult); 2400 return TRUE; 2138 2401 } 2139 2402
Note:
See TracChangeset
for help on using the changeset viewer.