You can get the Chrome URL using uiautomation. However, Chrome UI menu is not visible on some PCs. Is there another way?
varPropAddr.bstrVal = SysAllocString(L"Address and search bar");
m_pAutomation->CreatePropertyCondition(UIA_NamePropertyId, varPropAddr, &pAddrCondition
pRoot->FindFirst(TreeScope_Subtree, pAddrCondition, &pAddrBar);
SysFreeString(varPropAddr.bstrVal);
hr = E_FAIL;
hr = pAddrBar->GetCurrentPatternAs(UIA_ValuePatternId, __uuidof(IUIAutomationValuePattern), (void**)&pURLValuePattern);
if (pURLValuePattern != NULL)
{
BSTR bstrUrl;
HRESULT hr = pURLValuePattern->get_CurrentValue(&bstrUrl);
if (SUCCEEDED(hr))
{
bReadOnly = TRUE;
strUrl = (LPWSTR)bstrUrl;
//m_strUrl_Chrome = strUrl;
SysFreeString(bstrUrl);
bstrUrl = NULL;
}
}
chrome Update, Reinstall chrome, chrome option reset
I have successfully obtained the Chrome URL with the above code. However, some PCs did not get the URL because I could not check the UI menu.