Note that there are some explanatory texts on larger screens.

plurals
  1. POAdding an item to Internet Explorer's right-click context menu
    primarykey
    data
    text
    <p>I'm trying to add a new entry into Internet Explorer's right-click context menu. I understand that this can be achieved by creating an HTML file containing JavaScript, and then linking to this from a location in the registry. I have also read that you can also add the HTML to a resource file and compile it into a DLL (see the Microsoft KB: <a href="http://msdn.microsoft.com/en-us/library/aa753589.aspx" rel="nofollow noreferrer">Adding Entries to the Standard Context Menu</a>). This is where I have started to hit problems.</p> <p>Here is a bit of background about what I have done so far.</p> <ul> <li>I have the following JavaScript in the file <code>C:\test.htm</code>:</li> </ul> <blockquote> <pre><code>&lt;script type="text/javascript"&gt; alert('Hello, world!'); &lt;/script&gt; </code></pre> </blockquote> <ul> <li>I have added a new <code>REG_SZ</code> value <code>'c:\test.htm'</code> in the registry at the following location:</li> </ul> <blockquote> <pre><code>HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt </code></pre> </blockquote> <p>If I now restart IE, my new menu item appears in the context menu. If I select my new menu item, my message box alert appears as expected. So far so good. However, I can't seem to access the script if it's in a DLL. Here are the steps I have taken:</p> <ol> <li>Created a new Visual C++ Class Library project in VS 2005 named <code>'IETest'</code> in <code>c:\IETest</code></li> <li>Imported my <code>C:\test.htm</code> file into the default <code>app.rc</code> resource file. I have changed the <code>ID</code> to be <code>TEST</code></li> <li>Compiled the DLL in debug mode</li> <li>Altered the registry entry to read</li> </ol> <blockquote> <pre><code>res://C:\IETest\debug\IETest.dll/TEST </code></pre> </blockquote> <p>If I now restart IE and try again, the message box does not appear when I right-click and select my new context menu entry. I have also tried a release build of the DLL without any luck, and also tried replacing the last forward slash with a comma and altering the path single-backslashes to double-slashes.</p> <p>I can only presume that I've done something wrong when creating my DLL. Can anyone point me in the right direction? Is there any way I can examine the compiled DLL to examine the resources and associated IDs?</p> <p>Thanks.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload