This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript: var s; | |
/*Figure out the selected text*/ | |
if ( window.getSelection ) { | |
s = window.getSelection(); | |
} else if ( document.getSelection ) { | |
s = document.getSelection(); | |
} else { | |
s = document.selection.createRange().text; | |
} | |
/*If there isn't any text selected, get user input*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
handle is the return of the function GetForegroundWindow() | |
private InfoItem GetActiveItemFromHandle(string processName, IntPtr handle) | |
{ | |
try | |
{ | |
if (processName == ProcessList.iexplore.ToString()) | |
{ | |
#region IE 8 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private InfoItem GetActiveItemFromROT(IntPtr handle) | |
{ | |
activeItem = new InfoItem(); | |
String activeTitle = GetActiveWindowText(handle); | |
String title; | |
IntPtr numFetched = IntPtr.Zero; | |
IRunningObjectTable runningObjectTable; | |
IEnumMoniker monikerEnumerator; | |
IMoniker[] monikers = new IMoniker[1]; |