Skip to content

Instantly share code, notes, and snippets.

@acaly
Created June 29, 2017 04:33
Show Gist options
  • Save acaly/6245ec54d78ff72ad474ccf5b4b546ae to your computer and use it in GitHub Desktop.
Save acaly/6245ec54d78ff72ad474ccf5b4b546ae to your computer and use it in GitHub Desktop.
//From:
//https://gitlab.qarea.org/timeguard/tg-url-det/blob/master/addon/windows/url.cc
//https://gitlab.qarea.org/timeguard/tg-url-det/blob/1b63ac16f54ff6cf41fea4217985b19d7b2b29ac/addon/windows/url.cc
VARIANT urlProp;
editBoxElement->GetCurrentPropertyValue(UIA_ValueValuePropertyId, &urlProp); //get the string
BSTR url;
url = urlProp.bstrVal;
wstring urlStr(url, SysStringLen(url));
globalUrl = urlStr; //work with urlStr
VariantClear(&urlProp);
SysFreeString(url); //free it!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment