Click here to Skip to main content
12,890,424 members (57,763 online)
Click here to Skip to main content

Stats

49K views
1.3K downloads
52 bookmarked
Posted 10 Feb 2008

Creating and Installing Internet Explorer Context Menu using C#

, 9 Feb 2008 CPOL
Add an Internet Explorer context menu using an installer class
IEContextMenuSample
IEContextInstallerClass
bin
Debug
IEContextInstallerClass.dll
Properties
IEContextMenuSample.suo
IEContextMenuSample
Debug
IEContextMenuSample.msi
setup.exe
IEContextMenuSample.vdproj
Release
IEContextMenuSample.msi
<SCRIPT LANGUAGE = "JavaScript">

// Get the window object where the context menu was opened.
var oWindow = window.external.menuArguments;

// Get the document object exposed through oWindow.
var oDocument = oWindow.document;

// Get the selection from oDocument.
// in oDocument.
var oSelect = oDocument.selection;

// Create a TextRange from oSelect.
var oSelectRange = oSelect.createRange();

// Get the text of the selection.
var sNewText = oSelectRange.text;

// If nothing was selected, insert some text.
if (sNewText.length != 0){
   alert(sNewText);
}

</SCRIPT>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Riad MS Afyouni
Other Born Interactive
Saudi Arabia Saudi Arabia
Follow me: http://riadafyouni.blogspot.com

You may also be interested in...

Pro
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170424.1 | Last Updated 10 Feb 2008
Article Copyright 2008 by Riad MS Afyouni
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid