1. Send To Menu/Drag And Drop Question
- Posted by Virtual B <behaviorself at netzero.net> Nov 11, 2006
- 550 views
Hi Everyone. I posted a question a while back, but didn't recieve a response. I know that usually means that noone has an answer, but I'm hoping that it just got missed in all the excitement about Euphoria going open-source. I want to write a program that will read a .txt file and search for certain criteria. The problem is that I need to make it very easy for the user by allowing them to use Windows' Send To menu or Drag And Drop to initiate the program. I've been using Ed.bat and Ed.ex in this manner since I sarted using Euphoria, but for the life of me, I just can't figure out how Ed knows which file needs to be opened. I would love to be able to do this without using a batch file, or at least without having a DOS window pop up, but I'd be very grateful for any help in getting this to work any way possible. Thanks, Virtual B.
2. Re: Send To Menu/Drag And Drop Question
- Posted by Bernie Ryan <xotron at bluefrog.com> Nov 11, 2006
- 518 views
Virtual B wrote: > > > Hi Everyone. > > I posted a question a while back, but didn't recieve a response. I know that > > usually means that noone has an answer, but I'm hoping that it just got missed > > in all the excitement about Euphoria going open-source. > > I want to write a program that will read a .txt file and search for certain > > criteria. The problem is that I need to make it very easy for the user by > allowing them to use Windows' Send To menu or Drag And Drop to initiate the > > program. I've been using Ed.bat and Ed.ex in this manner since I sarted > using Euphoria, but for the life of me, I just can't figure out how Ed knows > > which file needs to be opened. I would love to be able to do this without > using a batch file, or at least without having a DOS window pop up, but I'd > > be very grateful for any help in getting this to work any way possible. > > Thanks, > > Virtual B. I don't know if this is what you need to know or not ? In order for a program to know which program to process; your program has to process the command line to find what program was passed on the command line. You add a short-cut to your program in the C:\Windows\SendTo directory. Now when you right click on a file the SendTo menu will appear an the icon to your Euphoria progam should appear. If you then click on your program icon in the SendTo menu Windows will start your program and pass the name of the file that you first right click on to your Euphoria program's command line when it starts your program. It is up to your program to process the command line and use the file that was passed to it. Bernie My files in archive: WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API Can be downloaded here: http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan
3. Re: Send To Menu/Drag And Drop Question
- Posted by "behaviorself at netzero.net" <behaviorself at netzero.net> Nov 11, 2006
- 576 views
Thanks for the response Bernie. I probably could have been a bit more clear about my actual problem. Sorry about that, but I haven't had a lot of time for quite a while, and everything I do is a little rushed. I can set up the Send To menu without a problem. The point I'm getting stuck at is processing the command line. I've tried using command_line(), but it only returns the first two arguments. So all I end up recieving is C:\EUPHORIA\BIN\EXW.EXE and the path and name of my program. I'm assuming this is because I don't have my user type in any information. Is there a routine I can call that will return the name of the file the user wants to open (using the Send To menu, of course). Thanks again, Virtual B.
4. Re: Send To Menu/Drag And Drop Question
- Posted by Chris Bensler <bensler at nt.net> Nov 11, 2006
- 560 views
behaviorself at netzero.net wrote: > > Thanks for the response Bernie. I probably could have been a bit more > clear about my actual problem. Sorry about that, but I haven't had a > lot of time for quite a while, and everything I do is a little rushed. > > I can set up the Send To menu without a problem. The point I'm getting > stuck at is processing the command line. I've tried using > command_line(), but it only returns the first two arguments. So all I > end up recieving is C:\EUPHORIA\BIN\EXW.EXE and the path and name of my > program. I'm assuming this is because I don't have my user type in any > information. Is there a routine I can call that will return the name > of the file the user wants to open (using the Send To menu, of course). > > Thanks again, > > Virtual B. As far as I know, the Send To menu should work just like drag and drop. I suspect you didn't create the shortcut correctly.. did you include %1 after your executable in the shortcut? Eg.. Target: "c:\Euphoria\bin\exw.exe" %1 you need to pass the argument through youur shortcut, or else it's just launching the app alone. Chris Bensler ~ The difference between ordinary and extraordinary is that little extra ~ http://empire.iwireweb.com - Empire for Euphoria
5. Re: Send To Menu/Drag And Drop Question
- Posted by Virtual B <behaviorself at netzero.net> Nov 12, 2006
- 559 views
- Last edited Nov 13, 2006
Thanks Chris. That seems to have done the trick. Chris Bensler wrote: > > behaviorself at netzero.net wrote: > > > > Thanks for the response Bernie. I probably could have been a bit more > > clear about my actual problem. Sorry about that, but I haven't had a > > lot of time for quite a while, and everything I do is a little rushed. > > > > I can set up the Send To menu without a problem. The point I'm getting > > stuck at is processing the command line. I've tried using > > command_line(), but it only returns the first two arguments. So all I > > end up recieving is C:\EUPHORIA\BIN\EXW.EXE and the path and name of my > > program. I'm assuming this is because I don't have my user type in any > > information. Is there a routine I can call that will return the name > > of the file the user wants to open (using the Send To menu, of course). > > > > Thanks again, > > > > Virtual B. > > As far as I know, the Send To menu should work just like drag and drop. > I suspect you didn't create the shortcut correctly.. > did you include %1 after your executable in the shortcut? > Eg.. Target: "c:\Euphoria\bin\exw.exe" %1 > you need to pass the argument through youur shortcut, or else it's just > launching > the app alone. > > > Chris Bensler > ~ The difference between ordinary and extraordinary is that little extra ~ > <a href="http://empire.iwireweb.com">http://empire.iwireweb.com</a> - Empire > for Euphoria
6. Re: Send To Menu/Drag And Drop Question
- Posted by Pete Lomax <petelomax at blueyonder.co.uk> Nov 13, 2006
- 526 views
On Sun, 12 Nov 2006 22:34:03 -0800, Virtual B <guest at RapidEuphoria.com> wrote: >Thanks Chris. That seems to have done the trick. BUT This thread gave me the idea of adding an entry for Edita to the SendTo menu, so I created a shortcut thus (erm, all one line): "C:\Program Files\Edita\exw24.exe" "C:\Program Files\Edita\edita.exw" %1 and it don't work. So I created a new test program, cl.exw:
include ppp.e pp(command_line()) if getc(0) then end if
When I right click on this, and Send To Edita, I get: {"C:\\PROGRAM FILES\\EDITA\\EXW24.EXE", "C:\\POSITIVE\\BUILTINS\\CL.EXW"} To which I say Oi! Where's me middle bit gone? Any more clues? Pete PS I also created an edita.bat file which contained: "exw24.exe edita.exw %1", and changed shortcut to ...edita.bat" %1. It worked, bar the dead DOS box that has to be closed manually - it seems pif settings, like start minimised or close window on exit, are not applied when run like this, on win98.
7. Re: Send To Menu/Drag And Drop Question
- Posted by Chris Bensler <bensler at nt.net> Nov 14, 2006
- 534 views
Pete Lomax wrote: > > On Sun, 12 Nov 2006 22:34:03 -0800, Virtual B > <guest at RapidEuphoria.com> wrote: > > >Thanks Chris. That seems to have done the trick. > > BUT This thread gave me the idea of adding an entry for Edita to > the SendTo menu, so I created a shortcut thus (erm, all one line): > > "C:\Program Files\Edita\exw24.exe" "C:\Program Files\Edita\edita.exw" > %1 > > and it don't work. So I created a new test program, cl.exw: > }}} <eucode> > include ppp.e > pp(command_line()) > if getc(0) then end if > </eucode> {{{ > When I right click on this, and Send To Edita, I get: > {"C:\\PROGRAM FILES\\EDITA\\EXW24.EXE", > "C:\\POSITIVE\\BUILTINS\\CL.EXW"} > > To which I say Oi! Where's me middle bit gone? > > Any more clues? > Pete > > PS I also created an edita.bat file which contained: > "exw24.exe edita.exw %1", and changed shortcut to ...edita.bat" %1. > It worked, bar the dead DOS box that has to be closed manually - it > seems pif settings, like start minimised or close window on exit, are > not applied when run like this, on win98. > > I tested on windows 98 and XP.. using target: "F:\bin\exw.exe" "F:\projects\test.exw" produces -- win98 { "F:\\bin\\exw.exe" ,"F:\\projects\\test.txt"} -- winXP { "F:\\bin\\exw.exe" ,"F:\\projects\\test.exw" ,"F:\\projects\\test.txt"} using target: "F:\bin\exw.exe" "F:\projects\test.exw" %1 produces -- win98 { "F:\\bin\\exw.exe" ,"F:\\projects\\test.txt" ,"%1"} -- winXP { "F:\\bin\\exw.exe" ,"F:\\projects\\test.exw" ,"%1" ,"F:\\projects\\test.txt"} It seems that %1 is not needed at all. The difference appears to be that win98 will always pass the src file as the first argument, where XP will pass it as the last argument. On win98 I needed to create a batch file to be able to launch an exw from a shortcut. On neither system could I create a target to an exw file without explicitly specifying exw.exe in the target, despite file association. HTH Chris Bensler ~ The difference between ordinary and extraordinary is that little extra ~ http://empire.iwireweb.com - Empire for Euphoria
8. Re: Send To Menu/Drag And Drop Question
- Posted by "Greg Haberek" <ghaberek at gmail.com> Nov 14, 2006
- 511 views
- Last edited Nov 15, 2006
> On neither system could I create a target to an exw file without explicitly > specifying exw.exe in the target, despite file association. Couldn't you bind or translate/compile Edita? That's what I do, Edita runs a bit faster when translated/compiled, too. ~Greg