Click here to Skip to main content
Click here to Skip to main content
 

Creating and Installing Internet Explorer Context Menu using C#

By , 9 Feb 2008
 
iecontextmenusample-source.zip
IEContextMenuSample
IEContextInstallerClass
bin
Debug
IEContextInstallerClass.dll
Properties
IEContextMenuSample.suo
IEContextMenuSample
Debug
IEContextMenuSample.msi
setup.exe
IEContextMenuSample.vdproj
Release
iecontextmenusample_-_installer.zip
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 use 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)

About the Author

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

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