1080{
1088 RECT rc = {0, 0, 10, 10};
1091 static const int winxp_res[11] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
1092 static const int win2k3_res[11] = {0, 1, 2, 3, 4, 5, 6, 5, 8, 0, 0};
1093 static const int vista_res[11] = {0, 1, 5, 3, 4, 5, 6, 7, 7, 0, 0};
1094 static const int win7_res[11] = {1, 1, 1, 3, 4, 1, 6, 1, 8, 8, 8};
1095
1098
1099 hr = IShellFolder_CreateViewObject(desktop,
NULL, &IID_IShellView, (
void**)&sview);
1101
1105 hr = IShellView_CreateViewWindow(sview,
NULL, &
fs, browser, &rc, &
hwnd);
1107
1108 hr = IShellView_QueryInterface(sview, &IID_IFolderView, (
void**)&fview);
1111 {
1114
1115 if (0)
1116 {
1117
1118 IFolderView_GetCurrentViewMode(fview,
NULL);
1119 }
1120
1121 hr = IFolderView_GetCurrentViewMode(fview, &viewmode);
1123 ok(viewmode == 1,
"ViewMode was %d\n", viewmode);
1124
1125 hr = IFolderView_SetCurrentViewMode(fview,
FVM_AUTO);
1127
1128 hr = IFolderView_SetCurrentViewMode(fview, 0);
1130 "got (0x%08x)\n",
hr);
1131
1132 hr = IFolderView_GetCurrentViewMode(fview, &viewmode);
1134
1135 for(
i = 1;
i < 9;
i++)
1136 {
1137 hr = IFolderView_SetCurrentViewMode(fview,
i);
1139 "(%d) got (0x%08x)\n",
i,
hr);
1140
1141 hr = IFolderView_GetCurrentViewMode(fview, &viewmode);
1143
1144
1145 ok((viewmode == win7_res[
i]) || (viewmode == vista_res[
i]) ||
1146 (viewmode == win2k3_res[
i]) || (viewmode == winxp_res[
i]),
1147 "(%d) got %d\n",
i , viewmode);
1148 }
1149
1150 hr = IFolderView_SetCurrentViewMode(fview, 9);
1152 "got (0x%08x)\n",
hr);
1153
1154
1156 ok(hwnd_lv !=
NULL,
"Failed to subclass listview\n");
1157 if(hwnd_lv)
1158 {
1159
1160
1161
1162
1164 static const UINT vista_plus_msgs[] = {
1168
1170 hr = IFolderView_SetCurrentViewMode(fview, 1);
1172
1173
1175 if(vista_plus)
1177 else
1179 "IFolderView::SetCurrentViewMode(1)",
TRUE);
1180
1181 hr = IFolderView_SetCurrentViewMode(fview, 2);
1183 if(vista_plus)
1185 else
1187 "IFolderView::SetCurrentViewMode(2)",
TRUE);
1188
1189 hr = IFolderView_SetCurrentViewMode(fview, 3);
1191 if(vista_plus)
1193 else
1195 "IFolderView::SetCurrentViewMode(3)",
TRUE);
1196
1197 hr = IFolderView_SetCurrentViewMode(fview, 4);
1199 if(vista_plus)
1201 else
1203 "IFolderView::SetCurrentViewMode(4)",
TRUE);
1204
1205 hr = IFolderView_SetCurrentViewMode(fview, 5);
1208 {
1209 if(vista_plus)
1210 {
1212 }
1213 else
1214 {
1218 ok(
count == 1 ||
count == 2,
"LVM_SETEXTENDEDLISTVIEWSTYLE sent %d times.\n",
count);
1220 }
1221 }
1222
1223 hr = IFolderView_SetCurrentViewMode(fview, 6);
1226 {
1227 if(vista_plus)
1228 {
1230 }
1231 else
1232 {
1236 ok(
count == 1 ||
count == 2,
"LVM_SETEXTENDEDLISTVIEWSTYLE sent %d times.\n",
count);
1238 }
1239 }
1240
1241 hr = IFolderView_SetCurrentViewMode(fview, 7);
1244 {
1245 if(vista_plus)
1246 {
1248 }
1249 else
1250 {
1254 ok(
count == 2,
"LVM_SETEXTENDEDLISTVIEWSTYLE sent %d times.\n",
count);
1256 }
1257 }
1258
1259 hr = IFolderView_SetCurrentViewMode(fview, 8);
1262 {
1263 if(vista_plus)
1264 {
1266 }
1267 else
1268 {
1272 ok(
count == 2,
"LVM_SETEXTENDEDLISTVIEWSTYLE sent %d times.\n",
count);
1274 }
1275 }
1276
1277 hr = IFolderView_GetCurrentViewMode(fview, &viewmode);
1278 ok(
hr ==
S_OK,
"Failed to get current viewmode.\n");
1280 "IFolderView::GetCurrentViewMode",
FALSE);
1281 }
1282
1283 IFolderView_Release(fview);
1284 }
1285 else
1286 {
1287 skip(
"No IFolderView for the desktop folder.\n");
1288 }
1289
1290 IShellBrowser_Release(browser);
1291 IShellView_DestroyViewWindow(sview);
1292 IShellView_Release(sview);
1293 IShellFolder_Release(desktop);
1294}
static void flush_sequences(struct msg_sequence **seq, int n)
#define LVM_SETEXTENDEDLISTVIEWSTYLE
#define verify_msgs_in(seq, msgs)
static const struct message folderview_setcurrentviewmode3_prevista[]
static HWND subclass_listview(HWND hwnd)
static const struct message folderview_setcurrentviewmode4_prevista[]
static IShellBrowser * IShellBrowserImpl_Construct(void)
static const struct message folderview_setcurrentviewmode1_2_prevista[]
static UINT get_msg_count(struct msg_sequence **seq, int sequence_index, UINT message)
static const struct message empty_seq[]
#define WM_WINDOWPOSCHANGING
#define WM_WINDOWPOSCHANGED