c# - Getting active tab url from Safari -
i trying active tab url safari, far able url prominent browsers (ie, firefox, chrome, opera) through mix of win32 api calls or dde.
the issue safari when enumerate through windows , call getwindowtext it's null.
any solutions out there? thanks!
public static string getchromeurl() { uint max_path=255; intptr hchrome, haddressbox; hchrome=getforegroundwindow(); haddressbox = findwindowex(hchrome, intptr.zero, "chrome_autocompleteeditview", intptr.zero); stringbuilder sb = new stringbuilder(256); sendmessage(haddressbox, wm_gettext, (intptr)max_path, sb); string s = sb.tostring().trim(new char[] { ' ', '\0', '\n' }); return s; }
Comments
Post a Comment