Skip to content

Commit 5d64387

Browse files
oggy22Ognjen Sobajicpeiche-msmonica-ch
authored
Update projects to use latest WebView2 SDK 1.0.865-prerelease (#87)
* Win32 builds and runs against 1.0.705.50-prerelease WPF and WinForms build and run against 1.0.705.50 (release version) * Win7 fix by removing api-ms-win-core-path-l1-1-0.dll dependency * Win32, WPF and WinForms build and run against (custom) 1.0.779-prerelease off user/champnic/DefaultBackgroundColorFix * Back to 721 * Update all projects to 1.0.781-prerelease. Fix PlatformTarget in WPF and WinForms. * Move projects to use WebView2 SDK 1.0.774.41-prerelease * Update projects to use the latest WebView2 SDK 1.0.824-prerelease * Fix some problems * Add CDP Sample app to WebView2Samples (#83) * Update the sample apps. Win32 works with 1.0.818.41-prerelease WPF and WinForms work with 1.0.818.41 * Revert packages.config * Updating launch.json with David's fix * Win32, WPF, Winforms sample apps work with 1.0.865-prerelease * Update projects to use the latest WebView2 SDK 1.0.865-prerelease * Fix the INCREMENTAL warning * Reapply David's fix for launch.json * Fix MainWindow.xaml.cs Co-authored-by: Ognjen Sobajic <[email protected]> Co-authored-by: Jessica Chen <[email protected]> Co-authored-by: monica-ch <[email protected]>
1 parent a12bfcc commit 5d64387

36 files changed

+5736
-2912
lines changed

SampleApps/WebView2APISample/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,6 @@ packages/
3131

3232
# Nuget.exe is downloaded by UseNuget.ps1
3333
nuget.exe
34+
35+
# WIX log file
36+
UpgradeLog.htm

SampleApps/WebView2APISample/.vscode/launch.json

Lines changed: 253 additions & 253 deletions
Large diffs are not rendered by default.

SampleApps/WebView2APISample/App.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,14 @@ int APIENTRY wWinMain(HINSTANCE hInstance,
4242
DPI_AWARENESS_CONTEXT dpiAwarenessContext =
4343
DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2;
4444
std::wstring appId(L"EBWebView.SampleApp");
45+
std::wstring userDirectoryFolder(L"");
4546
std::wstring initialUri;
4647
DWORD creationModeId = IDM_CREATION_MODE_WINDOWED;
4748

4849
if (lpCmdLine && lpCmdLine[0])
4950
{
5051
int paramCount = 0;
51-
LPWSTR* params = CommandLineToArgvW(lpCmdLine, &paramCount);
52+
LPWSTR* params = CommandLineToArgvW(GetCommandLineW(), &paramCount);
5253
for (int i = 0; i < paramCount; ++i)
5354
{
5455
std::wstring nextParam;
@@ -91,6 +92,10 @@ int APIENTRY wWinMain(HINSTANCE hInstance,
9192
{
9293
initialUri = nextParam.substr(nextParam.find(L'=') + 1);
9394
}
95+
else if (NEXT_PARAM_CONTAINS(L"userdirectoryfolder="))
96+
{
97+
userDirectoryFolder = nextParam.substr(nextParam.find(L'=') + 1);
98+
}
9499
else if (NEXT_PARAM_CONTAINS(L"creationmode="))
95100
{
96101
nextParam = nextParam.substr(nextParam.find(L'=') + 1);
@@ -120,7 +125,7 @@ int APIENTRY wWinMain(HINSTANCE hInstance,
120125

121126
DpiUtil::SetProcessDpiAwarenessContext(dpiAwarenessContext);
122127

123-
new AppWindow(creationModeId, initialUri, true);
128+
new AppWindow(creationModeId, initialUri, userDirectoryFolder, true);
124129

125130
int retVal = RunMessagePump();
126131

@@ -173,15 +178,15 @@ void CreateNewThread(UINT creationModeId)
173178
{
174179
DWORD threadId;
175180
HANDLE thread = CreateThread(
176-
nullptr, 0, ThreadProc, reinterpret_cast<LPVOID>(creationModeId),
181+
nullptr, 0, ThreadProc, reinterpret_cast<LPVOID>(uintptr_t(creationModeId)),
177182
STACK_SIZE_PARAM_IS_A_RESERVATION, &threadId);
178183
s_threads.insert(std::pair<DWORD, HANDLE>(threadId, thread));
179184
}
180185

181186
// This function is the starting point for new threads. It will open a new app window.
182187
static DWORD WINAPI ThreadProc(void* pvParam)
183188
{
184-
new AppWindow(reinterpret_cast<UINT>(pvParam));
189+
new AppWindow(static_cast<UINT>(reinterpret_cast<intptr_t>(pvParam)));
185190
return RunMessagePump();
186191
}
187192

0 commit comments

Comments
 (0)