Skip to content

Commit b34a0fe

Browse files
authored
Move project to use latest WebView2 SDK 0.9.430 (#17)
* Add ICoreWebView2Host * Update WebView2APISample as part of Feb SDK release * Update WebView2APISample as part of Feb SDK release * Add arm64 config and update nuget version * Add arm64 config for getting started guide * Update instruction for zoom control * Use 0.9.430
1 parent 721d5fa commit b34a0fe

34 files changed

+865
-390
lines changed

GettingStartedGuide/WebView2GettingStarted.sln

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,22 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WebView2GettingStarted", "W
77
EndProject
88
Global
99
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|ARM64 = Debug|ARM64
1011
Debug|x64 = Debug|x64
1112
Debug|x86 = Debug|x86
13+
Release|ARM64 = Release|ARM64
1214
Release|x64 = Release|x64
1315
Release|x86 = Release|x86
1416
EndGlobalSection
1517
GlobalSection(ProjectConfigurationPlatforms) = postSolution
18+
{A1238CE8-5AF4-4BBB-9821-E6BBB0D44F75}.Debug|ARM64.ActiveCfg = Debug|ARM64
19+
{A1238CE8-5AF4-4BBB-9821-E6BBB0D44F75}.Debug|ARM64.Build.0 = Debug|ARM64
1620
{A1238CE8-5AF4-4BBB-9821-E6BBB0D44F75}.Debug|x64.ActiveCfg = Debug|x64
1721
{A1238CE8-5AF4-4BBB-9821-E6BBB0D44F75}.Debug|x64.Build.0 = Debug|x64
1822
{A1238CE8-5AF4-4BBB-9821-E6BBB0D44F75}.Debug|x86.ActiveCfg = Debug|Win32
1923
{A1238CE8-5AF4-4BBB-9821-E6BBB0D44F75}.Debug|x86.Build.0 = Debug|Win32
24+
{A1238CE8-5AF4-4BBB-9821-E6BBB0D44F75}.Release|ARM64.ActiveCfg = Release|ARM64
25+
{A1238CE8-5AF4-4BBB-9821-E6BBB0D44F75}.Release|ARM64.Build.0 = Release|ARM64
2026
{A1238CE8-5AF4-4BBB-9821-E6BBB0D44F75}.Release|x64.ActiveCfg = Release|x64
2127
{A1238CE8-5AF4-4BBB-9821-E6BBB0D44F75}.Release|x64.Build.0 = Release|x64
2228
{A1238CE8-5AF4-4BBB-9821-E6BBB0D44F75}.Release|x86.ActiveCfg = Release|Win32

GettingStartedGuide/WebView2GettingStarted/HelloWebView.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,11 @@ HINSTANCE hInst;
2323
// Forward declarations of functions included in this code module:
2424
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
2525

26+
// Pointer to WebViewHost
27+
static wil::com_ptr<ICoreWebView2Host> webviewHost;
28+
2629
// Pointer to WebView window
27-
static wil::com_ptr<IWebView2WebView> webviewWindow;
30+
static wil::com_ptr<ICoreWebView2> webviewWindow;
2831

2932
int CALLBACK WinMain(
3033
_In_ HINSTANCE hInstance,
@@ -129,10 +132,10 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
129132
switch (message)
130133
{
131134
case WM_SIZE:
132-
if (webviewWindow != nullptr) {
135+
if (webviewHost != nullptr) {
133136
RECT bounds;
134137
GetClientRect(hWnd, &bounds);
135-
webviewWindow->put_Bounds(bounds);
138+
webviewHost->put_Bounds(bounds);
136139
};
137140
break;
138141
case WM_DESTROY:

GettingStartedGuide/WebView2GettingStarted/WebView2GettingStarted.vcxproj

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@
1717
<Configuration>Release</Configuration>
1818
<Platform>x64</Platform>
1919
</ProjectConfiguration>
20+
<ProjectConfiguration Include="Debug|ARM64">
21+
<Configuration>Debug</Configuration>
22+
<Platform>ARM64</Platform>
23+
</ProjectConfiguration>
24+
<ProjectConfiguration Include="Release|ARM64">
25+
<Configuration>Release</Configuration>
26+
<Platform>ARM64</Platform>
27+
</ProjectConfiguration>
2028
</ItemGroup>
2129
<PropertyGroup Label="Globals">
2230
<VCProjectVersion>15.0</VCProjectVersion>
@@ -53,6 +61,19 @@
5361
<WholeProgramOptimization>true</WholeProgramOptimization>
5462
<CharacterSet>Unicode</CharacterSet>
5563
</PropertyGroup>
64+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
65+
<ConfigurationType>Application</ConfigurationType>
66+
<UseDebugLibraries>true</UseDebugLibraries>
67+
<PlatformToolset>v142</PlatformToolset>
68+
<CharacterSet>Unicode</CharacterSet>
69+
</PropertyGroup>
70+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
71+
<ConfigurationType>Application</ConfigurationType>
72+
<UseDebugLibraries>false</UseDebugLibraries>
73+
<PlatformToolset>v142</PlatformToolset>
74+
<WholeProgramOptimization>true</WholeProgramOptimization>
75+
<CharacterSet>Unicode</CharacterSet>
76+
</PropertyGroup>
5677
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
5778
<ImportGroup Label="ExtensionSettings">
5879
</ImportGroup>
@@ -70,19 +91,31 @@
7091
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
7192
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
7293
</ImportGroup>
94+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
95+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
96+
</ImportGroup>
97+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
98+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
99+
</ImportGroup>
73100
<PropertyGroup Label="UserMacros" />
74101
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
75102
<LinkIncremental>true</LinkIncremental>
76103
</PropertyGroup>
77104
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
78105
<LinkIncremental>true</LinkIncremental>
79106
</PropertyGroup>
107+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
108+
<LinkIncremental>true</LinkIncremental>
109+
</PropertyGroup>
80110
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
81111
<LinkIncremental>false</LinkIncremental>
82112
</PropertyGroup>
83113
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
84114
<LinkIncremental>false</LinkIncremental>
85115
</PropertyGroup>
116+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
117+
<LinkIncremental>false</LinkIncremental>
118+
</PropertyGroup>
86119
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
87120
<ClCompile>
88121
<WarningLevel>Level3</WarningLevel>
@@ -112,6 +145,21 @@
112145
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
113146
</Link>
114147
</ItemDefinitionGroup>
148+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
149+
<ClCompile>
150+
<WarningLevel>Level3</WarningLevel>
151+
<Optimization>Disabled</Optimization>
152+
<SDLCheck>true</SDLCheck>
153+
<PreprocessorDefinitions>_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
154+
<ConformanceMode>true</ConformanceMode>
155+
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
156+
</ClCompile>
157+
<Link>
158+
<GenerateDebugInformation>true</GenerateDebugInformation>
159+
<SubSystem>Windows</SubSystem>
160+
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
161+
</Link>
162+
</ItemDefinitionGroup>
115163
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
116164
<ClCompile>
117165
<WarningLevel>Level3</WarningLevel>
@@ -148,6 +196,24 @@
148196
<SubSystem>Windows</SubSystem>
149197
</Link>
150198
</ItemDefinitionGroup>
199+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
200+
<ClCompile>
201+
<WarningLevel>Level3</WarningLevel>
202+
<Optimization>MaxSpeed</Optimization>
203+
<FunctionLevelLinking>true</FunctionLevelLinking>
204+
<IntrinsicFunctions>true</IntrinsicFunctions>
205+
<SDLCheck>true</SDLCheck>
206+
<PreprocessorDefinitions>NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
207+
<ConformanceMode>true</ConformanceMode>
208+
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
209+
</ClCompile>
210+
<Link>
211+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
212+
<OptimizeReferences>true</OptimizeReferences>
213+
<GenerateDebugInformation>true</GenerateDebugInformation>
214+
<SubSystem>Windows</SubSystem>
215+
</Link>
216+
</ItemDefinitionGroup>
151217
<ItemGroup>
152218
<ClCompile Include="HelloWebView.cpp" />
153219
</ItemGroup>

WebView2APISample/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ S Release/
55
ipch/
66
x64/
77
x86/
8+
ARM64/
89
.vs/
10+
# Created by running event monitor
11+
enc_temp_folder/
912
packages/
1013

1114
# Override root .gitignore to ensure we pick up changes for the sample app

0 commit comments

Comments
 (0)