gpt4 book ai didi

visual-studio-2015 - 全屏模式 - Windows 10 App (JS)

转载 作者:可可西里 更新时间:2023-11-01 09:47:33 24 4
gpt4 key购买 nike

您好,我在网上搜索了一下,找不到合适的代码或其他东西来全屏运行我的应用程序。我想做到这一点,激活全屏模式并自动隐藏标题栏(带按钮)。我是 Visual Studios 和 Windows 10 应用程序开发的初学者。我正在尝试创建一个 JS 应用。

我只能找到 C#/C++ 应用程序的全屏模式,但找不到 JS。

https://github.com/JustinXinLiu/FullScreenTitleBarRepo/tree/master/FullScreenTitleBarRepo

最佳答案

这里是官方Full screen mode sample ,本例中有一个js工程。

如果你想以全屏模式启动应用程序,你可以使用 ApplicationView.PreferredLaunchWindowingModeApplicationViewWindowingModedefault.js 中是这样的:

// For an introduction to the Blank template, see the following documentation:
// http://go.microsoft.com/fwlink/?LinkId=232509
(function () {
"use strict";

var app = WinJS.Application;
var activation = Windows.ApplicationModel.Activation;

var ViewManagement = Windows.UI.ViewManagement;
var ApplicationViewWindowingMode = ViewManagement.ApplicationViewWindowingMode;
var ApplicationView = ViewManagement.ApplicationView;

app.onactivated = function (args) {
if (args.detail.kind === activation.ActivationKind.launch) {
if (args.detail.previousExecutionState !== activation.ApplicationExecutionState.terminated) {
// TODO: This application has been newly launched. Initialize your application here.
} else {
// TODO: This application was suspended and then terminated.
// To create a smooth user experience, restore application state here so that it looks like the app never stopped running.
}
args.setPromise(WinJS.UI.processAll());
ApplicationView.preferredLaunchWindowingMode = ApplicationViewWindowingMode.fullScreen;
}
};

app.oncheckpoint = function (args) {
// TODO: This application is about to be suspended. Save any state that needs to persist across suspensions here.
// You might use the WinJS.Application.sessionState object, which is automatically saved and restored across suspension.
// If you need to complete an asynchronous operation before your application is suspended, call args.setPromise().
};

app.start();

})();

关于visual-studio-2015 - 全屏模式 - Windows 10 App (JS),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34551471/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com