|
-
Apr 4th, 2003, 01:28 AM
#1
Thread Starter
Addicted Member
IE Context Menu
Hi
I'm trying to implement my application to the internet explorer context menu. I managed to show the title of my application in the menu but there is no action using these registry keys:
HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt\&MyAppl\
(Standard)=P:\Work\vb\MyAppl.exe
contexts=1
What I'd like to do: As you click the menu entry, my application will get the url of the current page (or frame) like the way you can read it out in the properties.
Can anybody help me or give me some hints?
thanks and regards
Xdream
-
Apr 4th, 2003, 02:04 AM
#2
Hyperactive Member
hi,
I had done the same thing using a script file.U need to have the same entry in d registry as u hv done.
Change the path of ur exe to the script file :
HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt\&MyAppl\
(Standard)= C:\\MyApp\\myscript.htm
contexts=1
I hv used "\\" for the paths.
myscript.htm :
VB Code:
<script language="JavaScript">
var parentwin = external.menuArguments;//get a handle to the external window
var doc = parentwin.document;
var sel = doc.selection;//This is the selection done by the mouse.....the highlighted part
var rng = sel.createRange();
var str = new String(rng.text);
var strLanguage="Any+Language"
var strMode1="and"
var strSortBy1="Date_Newest"
var strSearchSize="25"
var winOpen
winOpen="http://mysearch.com/?template=mysearch%2Fsearch.txt&action=search&first=0&SearchString="+ str +"&Language=" + strLanguage + "&mode=" + strMode1 + "&SortBy=" + strSortBy1 + "&SearchSize=" + strSearchSize + "&x=19&y=6"
if(external.menuArguments.event.shiftKey)//If shift key is pressed then open in new window or else in the same window
parentwin.open(winOpen);
else
parentwin.navigate(winOpen);
</script>
This works for me.No idea bout hw to send the url to the exe.Maybe its d same way.
Or u can just try out by using "\\" in ur path of the exe(just a guess!!)
regds,
ashay
"If you should die before me, ask if you could bring a friend."
- Stone Temple Pilots
-
Apr 4th, 2003, 02:53 AM
#3
Thread Starter
Addicted Member
hi ashay
thanks alot, it's working this way to get the location. I've changed the script:
Code:
<script language="JavaScript">
var parentwin = external.menuArguments;//get a handle to the external window
alert(parentwin.location);
</script>
maybe you can use a vbscript as well, in this case it would be easy to send the url to an exe...
does anyone know how to get the url with vbscript?
regards, xdream
-
Apr 4th, 2003, 03:44 AM
#4
Thread Starter
Addicted Member
... and the same thing using vbscript
Code:
<script language="VBScript">
Dim strUrl, FileObject, MyLogFile, WshShell
Set strUrl = external.menuArguments.document.location
Set FileObject = CreateObject("Scripting.FileSystemObject")
Set MyLogFile = FileObject.OpenTextFile("C:\test.txt", 8, True)
MyLogFile.writeline strUrl
Set WshShell=CreateObject("Wscript.Shell")
WshShell.Run "P:\Work\vb\pathChanger\pathMan.exe" & " " & strUrl
</script>
know, I just need to prepare my application to handle the url...
-
Jun 11th, 2003, 03:07 PM
#5
Hyperactive Member
Try adding into the JavaScript:
location = "C:\MyApp\MyApp.exe " & external.menuArguments.location
That will probably launch your app with the URL as the command-line paramater.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|