トルネード

毛利のメモ書き

UWP VC++ タイトルバー透過

「C#でタイトルバー透過」と同じように VC++でもApplicationViewTitleBarを操作します。

//App.xaml.cpp

using namespace Windows::UI::ViewManagement;

void App::OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ e)
{
    auto rootFrame = dynamic_cast<Frame^>(Window::Current->Content);
    Windows::ApplicationModel::Core::CoreApplication::GetCurrentView()->TitleBar->ExtendViewIntoTitleBar = true;
    ApplicationViewTitleBar^ titleBar = ApplicationView::GetForCurrentView()->TitleBar;
    titleBar->ForegroundColor = Windows::UI::Colors::White;
    titleBar->ButtonBackgroundColor = Windows::UI::Colors::Transparent;              //ボタンバックグラウンドの透過
    titleBar->ButtonInactiveBackgroundColor = Windows::UI::Colors::Transparent;
    titleBar->ButtonForegroundColor = Windows::UI::Colors::White;
}

f:id:mojeld:20180818164803p:plain