Skip to content

Commit 0b7797b

Browse files
authored
Update apps to to 1.0.1056-prerelease (#110)
* Updates for Win32, WPF and WinForms sample apps from 97.0.1056.0 * Updated package version for Win32, WPF and WinForms sample apps to 1.0.1056-prerelease * Update WebView2SampleWinComp to 1.0.1056-prerelease
1 parent e23e8dc commit 0b7797b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+620
-222
lines changed

SampleApps/WebView2APISample/App.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// found in the LICENSE file.
44

55
#include "stdafx.h"
6+
67
#include <string>
78

89
extern HINSTANCE g_hInstance;

SampleApps/WebView2APISample/AppStartPage.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#pragma once
66

77
#include "stdafx.h"
8+
89
#include <string>
910

1011
class AppWindow;

SampleApps/WebView2APISample/AppWindow.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -447,11 +447,11 @@ bool AppWindow::ExecuteWebViewCommands(WPARAM wParam, LPARAM lParam)
447447
case IDM_GET_USER_DATA_FOLDER:
448448
{
449449
//! [GetUserDataFolder]
450-
auto experimentalEnvironment5 =
451-
m_webViewEnvironment.try_query<ICoreWebView2ExperimentalEnvironment5>();
452-
CHECK_FEATURE_RETURN(experimentalEnvironment5);
450+
auto environment7 =
451+
m_webViewEnvironment.try_query<ICoreWebView2Environment7>();
452+
CHECK_FEATURE_RETURN(environment7);
453453
wil::unique_cotaskmem_string userDataFolder;
454-
experimentalEnvironment5->get_UserDataFolder(&userDataFolder);
454+
environment7->get_UserDataFolder(&userDataFolder);
455455
MessageBox(
456456
m_mainWindow, userDataFolder.get(), L"User Data Folder",
457457
MB_OK);
@@ -664,7 +664,8 @@ bool AppWindow::ExecuteAppCommands(WPARAM wParam, LPARAM lParam)
664664
}
665665
return false;
666666
}
667-
667+
//! [ClearBrowsingData]
668+
//! [ClearBrowsingData]
668669
// Prompt the user for a new language string
669670
void AppWindow::ChangeLanguage()
670671
{

SampleApps/WebView2APISample/AppWindow.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,6 @@ class AppWindow
170170
winrt::Windows::UI::ViewManagement::UISettings const& uiSettings,
171171
winrt::Windows::Foundation::IInspectable const& args);
172172
#endif
173-
174173
std::wstring GetLocalPath(std::wstring path, bool keep_exe_path);
175174
void DeleteAllComponents();
176175

SampleApps/WebView2APISample/ClientCertificateSelectionDialog.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include <Windows.h>
77

88
#include "stdafx.h"
9+
910
#include "App.h"
1011
#include "resource.h"
1112
#include "ClientCertificateSelectionDialog.h"

SampleApps/WebView2APISample/ClientCertificateSelectionDialog.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#pragma once
66

77
#include "stdafx.h"
8+
89
#include <string>
910

1011
struct ClientCertificate
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
// Copyright (C) Microsoft Corporation. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
#include "stdafx.h"
6+
7+
#include "CustomStatusBar.h"
8+
#include "AppWindow.h"
9+
10+
11+
CustomStatusBar::CustomStatusBar()
12+
{
13+
}
14+
15+
CustomStatusBar::~CustomStatusBar()
16+
{
17+
}
18+
19+
void CustomStatusBar::Initialize(AppWindow* appWindow)
20+
{
21+
m_appWindow = appWindow;
22+
HWND mainWindow = m_appWindow->GetMainWindow();
23+
24+
int width = 600;
25+
int height = 70;
26+
int x = 50;
27+
int y = 50;
28+
29+
30+
m_statusBarWindow = CreateWindow(
31+
L"Edit", L"", WS_CHILD | WS_BORDER | ES_READONLY, x, y, width, height, mainWindow,
32+
nullptr, nullptr, 0);
33+
34+
BringWindowToTop(m_statusBarWindow);
35+
}
36+
37+
void CustomStatusBar::Show(std::wstring value)
38+
{
39+
SetWindowTextW(m_statusBarWindow, value.c_str());
40+
ShowWindow(m_statusBarWindow, SW_NORMAL);
41+
}
42+
43+
void CustomStatusBar::Hide()
44+
{
45+
SetWindowTextW(m_statusBarWindow, L"");
46+
ShowWindow(m_statusBarWindow, SW_HIDE);
47+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Copyright (C) Microsoft Corporation. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
#pragma once
6+
7+
#include "stdafx.h"
8+
9+
class AppWindow;
10+
11+
class CustomStatusBar
12+
{
13+
public:
14+
CustomStatusBar();
15+
~CustomStatusBar();
16+
void Initialize(AppWindow* appWindow);
17+
void Show(std::wstring value);
18+
void Hide();
19+
20+
private:
21+
AppWindow* m_appWindow = nullptr;
22+
HWND m_statusBarWindow;
23+
};

SampleApps/WebView2APISample/DpiUtil.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// found in the LICENSE file.
44

55
#include "stdafx.h"
6+
67
#include "CheckFailure.h"
78
#include "DpiUtil.h"
89

SampleApps/WebView2APISample/DpiUtil.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#pragma once
66

77
#include "stdafx.h"
8+
89
#include <ShellScalingApi.h>
910

1011
class DpiUtil

0 commit comments

Comments
 (0)