Changeset 72352 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- May 26, 2018 12:37:50 PM (7 years ago)
- Location:
- trunk/src/VBox/Frontends/VBoxManage
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageControlVM.cpp
r70766 r72352 1441 1441 uXRes, uYRes, uBpp)); 1442 1442 } 1443 else if (!strcmp(a->argv[1], "setscreenlayout")) 1444 { 1445 if (a->argc < 4) 1446 { 1447 errorSyntax(USAGE_CONTROLVM, "Incorrect number of parameters"); 1448 rc = E_FAIL; 1449 break; 1450 } 1451 1452 ComPtr<IDisplay> pDisplay; 1453 CHECK_ERROR_BREAK(console, COMGETTER(Display)(pDisplay.asOutParam())); 1454 if (!pDisplay) 1455 { 1456 RTMsgError("Guest not running"); 1457 rc = E_FAIL; 1458 break; 1459 } 1460 1461 com::SafeIfaceArray<IGuestScreenInfo> aGuestScreenInfos; 1462 1463 /* Parse "<display> on|primary <xorigin> <yorigin> <xres> <yres> <bpp> | off" sequences. */ 1464 int argc = a->argc - 2; 1465 char **argv = &a->argv[2]; 1466 while (argc >= 2) 1467 { 1468 ULONG aDisplay = RTStrToUInt32(argv[0]); 1469 BOOL aPrimary = FALSE; 1470 1471 GuestMonitorStatus_T aStatus; 1472 if (RTStrICmp(argv[1], "primary") == 0) 1473 { 1474 aStatus = GuestMonitorStatus_Enabled; 1475 aPrimary = TRUE; 1476 } 1477 else if (RTStrICmp(argv[1], "on") == 0) 1478 aStatus = GuestMonitorStatus_Enabled; 1479 else if (RTStrICmp(argv[1], "off") == 0) 1480 aStatus = GuestMonitorStatus_Disabled; 1481 else 1482 { 1483 errorSyntax(USAGE_CONTROLVM, "Display status must be <on> or <off>"); 1484 rc = E_FAIL; 1485 break; 1486 } 1487 1488 BOOL aChangeOrigin = FALSE; 1489 LONG aOriginX = 0; 1490 LONG aOriginY = 0; 1491 ULONG aWidth = 0; 1492 ULONG aHeight = 0; 1493 ULONG aBitsPerPixel = 0; 1494 if (aStatus = GuestMonitorStatus_Enabled) 1495 { 1496 if (argc < 7) 1497 { 1498 errorSyntax(USAGE_CONTROLVM, "Incorrect number of parameters"); 1499 rc = E_FAIL; 1500 break; 1501 } 1502 1503 aChangeOrigin = TRUE; 1504 aOriginX = RTStrToUInt32(argv[2]); 1505 aOriginY = RTStrToUInt32(argv[3]); 1506 aWidth = RTStrToUInt32(argv[4]); 1507 aHeight = RTStrToUInt32(argv[5]); 1508 aBitsPerPixel = RTStrToUInt32(argv[6]); 1509 1510 argc -= 7; 1511 argv += 7; 1512 } 1513 else 1514 { 1515 argc -= 2; 1516 argv += 2; 1517 } 1518 1519 ComPtr<IGuestScreenInfo> pInfo; 1520 CHECK_ERROR_BREAK(pDisplay, CreateGuestScreenInfo(aDisplay, aStatus, aPrimary, aChangeOrigin, 1521 aOriginX, aOriginY, aWidth, aHeight, aBitsPerPixel, 1522 pInfo.asOutParam())); 1523 aGuestScreenInfos.push_back(pInfo); 1524 } 1525 1526 if (FAILED(rc)) 1527 break; 1528 1529 CHECK_ERROR_BREAK(pDisplay, SetScreenLayout(ScreenLayoutMode_Apply, ComSafeArrayAsInParam(aGuestScreenInfos))); 1530 } 1443 1531 else if (!strcmp(a->argv[1], "setcredentials")) 1444 1532 { -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp
r71868 r72352 825 825 " [[<display>] [<enabled:yes|no> |\n" 826 826 " [<xorigin> <yorigin>]]] |\n" 827 " setscreenlayout <display> on|primary <xorigin> <yorigin> <xres> <yres> <bpp> | off\n" 827 828 " screenshotpng <file> [display] |\n" 828 829 " videocap on|off |\n"
Note:
See TracChangeset
for help on using the changeset viewer.