Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi,

Using "Command" I can open the file which was drag and dropped into my editor and there is no problem here.

But one strange problem is here:

I have added "Edit" command to the Windows context menu so when user right click on a .html file and select "Edit" he can edit his document using my application. But when my application is opened in this mode, Command won't return the path and name of my file, actually command will return nothing!

What should I do here?

Thanks.

  • Leaders
Posted
Go to the registry or "Folder Options" and see what the actual command is for the "Edit" action. There should be a %1 or "%1" in there. When the user selects "Edit" from the context menu the name of the file that is selected will be substituted for the %1. I'm guessing you'll be better off going with the quotes.
[sIGPIC]e[/sIGPIC]
Posted

Oh yes I see.

Thank you marble_eater, you helped me a lot :)

 

Just one more thing:

 

If I open a file using "Edit" command in Windows Context menu, if file is located for example in D:\File.htm, there is no problem, it will open.

 

But if file is located for example here:

 

C:\Documents and Settings\User Name\Desktop\File.htm

 

It won't open! You know the following command:

 

My.Application.CommandLineArgs.Item(0).ToString()

 

Will return:

 

"C:\Documents"

 

It means it cannot support long names? :confused:

What do you think here?

  • Leaders
Posted
Did you try putting quotes around the %1? File names with spaces in them need to be surrounded with quotes or the command line will think that the spaces are separating different file names.
[sIGPIC]e[/sIGPIC]

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...