From: David on
Using XP:

Writing a quick editing program where I want to select the
file in Windows Explorer, right click and bring up a menu, select my
program and have it open the file that was selected in Windows Explorer.

All internet searches to get the File name and Path from Windows Explorer
have failed. Have thought about trying to extract the path from the
combobox which
appears at the top of Windows Explorer, but seems to be a long way around
the block.

Anyone have a solution to getting the File Name and Path from Windows
Explorer for use in a VB program?


From: Nobody on
"David" <NoWhere(a)earthlink.net> wrote in message
news:uoKc8lfMLHA.1996(a)TK2MSFTNGP06.phx.gbl...
>
> Using XP:
>
> Writing a quick editing program where I want to select the
> file in Windows Explorer, right click and bring up a menu, select my
> program and have it open the file that was selected in Windows Explorer.
>
> All internet searches to get the File name and Path from Windows Explorer
> have failed. Have thought about trying to extract the path from the
> combobox which
> appears at the top of Windows Explorer, but seems to be a long way around
> the block.
>
> Anyone have a solution to getting the File Name and Path from Windows
> Explorer for use in a VB program?

If you made the registry entries or file association correctly, then the
file name is in the command line. See "Command function" in MSDN in how to
get the command line. Example:

MsgBox Command()



From: Larry Serflaten on

"David" <NoWhere(a)earthlink.net> wrote

> Using XP:
>
> Writing a quick editing program where I want to select the
> file in Windows Explorer, right click and bring up a menu, select my
> program and have it open the file that was selected in Windows Explorer.
>
> All internet searches to get the File name and Path from Windows Explorer
> have failed. Have thought about trying to extract the path from the
> combobox which
> appears at the top of Windows Explorer, but seems to be a long way around
> the block.
>
> Anyone have a solution to getting the File Name and Path from Windows
> Explorer for use in a VB program?


Use the Command function to get the command line that was used to start
your program:

Sub Main()
MsgBox Command()
End Sub

Create your EXE and create a shortcut to it in your SendTo folder.

Select a file in Explorer, right click for the menu and select Send To...
Then select the shortcut you put there....

LFS


From: Mayayana on
I'm guessing that Nobody and Larry already provided
the answer you need. If you really do need to access
the Explorer window....
You need to get a ShellFolderView object for the
window (via API or via the Shell Windows collection),
which is a wrapper around the ListView that
shows the folder content. SFV has a SelectedItems,
which is a FolderItems collection containing the current
selection(s) as FolderItems. FolderItem has a Path
property.



| Using XP:
|
| Writing a quick editing program where I want to select the
| file in Windows Explorer, right click and bring up a menu, select my
| program and have it open the file that was selected in Windows Explorer.
|
| All internet searches to get the File name and Path from Windows Explorer
| have failed. Have thought about trying to extract the path from the
| combobox which
| appears at the top of Windows Explorer, but seems to be a long way around
| the block.
|
| Anyone have a solution to getting the File Name and Path from Windows
| Explorer for use in a VB program?
|
|


From: David on
Thanks all. Will give it a go and post back this thread if issues.
Have a nice day.
David

"Mayayana" <mayayana(a)invalid.nospam> wrote in message
news:i36ghj$dif$1(a)news.eternal-september.org...
> I'm guessing that Nobody and Larry already provided
> the answer you need. If you really do need to access
> the Explorer window....
> You need to get a ShellFolderView object for the
> window (via API or via the Shell Windows collection),
> which is a wrapper around the ListView that
> shows the folder content. SFV has a SelectedItems,
> which is a FolderItems collection containing the current
> selection(s) as FolderItems. FolderItem has a Path
> property.
>
>
>
> | Using XP:
> |
> | Writing a quick editing program where I want to select the
> | file in Windows Explorer, right click and bring up a menu, select my
> | program and have it open the file that was selected in Windows Explorer.
> |
> | All internet searches to get the File name and Path from Windows
> Explorer
> | have failed. Have thought about trying to extract the path from the
> | combobox which
> | appears at the top of Windows Explorer, but seems to be a long way
> around
> | the block.
> |
> | Anyone have a solution to getting the File Name and Path from Windows
> | Explorer for use in a VB program?
> |
> |
>
>