@@ -123,6 +123,8 @@ BrowserProxyModule::BrowserProxyModule():
123
123
m_size(),
124
124
m_wnd(nullptr ),
125
125
m_url(),
126
+ m_proxyVersion(),
127
+ m_browserVersion(),
126
128
m_userDataFolder(),
127
129
m_browserEvents(),
128
130
m_unknownSite(),
@@ -374,6 +376,32 @@ HRESULT STDMETHODCALLTYPE BrowserProxyModule::DoVerb(LONG iVerb, LPMSG lpmsg, IO
374
376
375
377
SetRect (*lprcPosRect);
376
378
379
+ {
380
+ HRSRC source = FindResource (g_Instance, MAKEINTRESOURCE (VS_VERSION_INFO), RT_VERSION);
381
+ if (source != nullptr )
382
+ {
383
+ HGLOBAL resource = LoadResource (g_Instance, source);
384
+ if (resource != nullptr )
385
+ {
386
+ void *data = LockResource (resource);
387
+ if (data != nullptr )
388
+ {
389
+ VS_FIXEDFILEINFO *version = nullptr ;
390
+ UINT size = 0 ;
391
+ if (VerQueryValue (data, L" \\ " , (void **)&version, &size) && version != nullptr && size >= sizeof (VS_FIXEDFILEINFO))
392
+ {
393
+ WCHAR value[100 ];
394
+ _snwprintf_s (value, _countof (value), L" %u.%u.%u" ,
395
+ version->dwFileVersionMS >> 16 & 0xFFFF ,
396
+ version->dwFileVersionMS & 0xFFFF ,
397
+ version->dwFileVersionLS >> 16 & 0xFFFF );
398
+ m_proxyVersion = value;
399
+ }
400
+ }
401
+ }
402
+ }
403
+ }
404
+
377
405
{
378
406
WCHAR userDataFolder[MAX_PATH] = {0 };
379
407
if (SUCCEEDED (SHGetFolderPath (nullptr , CSIDL_LOCAL_APPDATA, nullptr , SHGFP_TYPE_CURRENT, userDataFolder)) && userDataFolder[0 ] != 0 )
@@ -660,6 +688,37 @@ HRESULT STDMETHODCALLTYPE BrowserProxyModule::Invoke(HRESULT errorCode, ICoreWeb
660
688
if (environment == nullptr )
661
689
return E_INVALIDARG;
662
690
691
+ {
692
+ WCHAR *version = nullptr ;
693
+ if (FAILED (environment->get_BrowserVersionString (&version)) || version == nullptr )
694
+ return E_FAIL;
695
+
696
+ m_browserVersion = version;
697
+ CoTaskMemFree (version);
698
+ }
699
+
700
+ {
701
+ for (HWND wnd = m_wnd; wnd != nullptr ; wnd = GetParent (wnd))
702
+ {
703
+ WCHAR className[100 ];
704
+ if (GetClassName (wnd, className, _countof (className)) == 0 )
705
+ continue ;
706
+
707
+ if (wcscmp (className, L" ThereTopLevelMdiWindowClass" ) != 0 )
708
+ continue ;
709
+
710
+ WCHAR currentTitle[250 ];
711
+ if (GetWindowText (wnd, currentTitle, _countof (currentTitle)) > 0 && wcsstr (currentTitle, L" Edge" ) == nullptr )
712
+ {
713
+ WCHAR extendedTitle[250 ];
714
+ _snwprintf_s (extendedTitle, _countof (extendedTitle), L" %s (Edge %s %s)" , currentTitle, m_proxyVersion.m_str , m_browserVersion.m_str );
715
+ SetWindowText (wnd, extendedTitle);
716
+ }
717
+
718
+ break ;
719
+ }
720
+ }
721
+
663
722
m_environment = environment;
664
723
m_environment->CreateCoreWebView2Controller (m_wnd, this );
665
724
return S_OK;
0 commit comments