Explorer functionality 
Author Message
 Explorer functionality

Hello, this is probably a very simply question, but......

I have a program that uses a third-party control similar to the treeview
(Green-Tree's Datatree) that uses sets of data items stored in an SQL
database. One of these set of items is a list of files associated with a
specific clients location. All I want to do is be able to launch the file
with it associated application just like Windows Explorer. I don't want to
have to use the OLE container control and the Shell command only works with
certain files.

NOTE: this is with VB 6.0

If anyony can help I would greatly appreciate it.

Cheers :)



Tue, 08 May 2001 03:00:00 GMT  
 Explorer functionality
Mark...

Quote:
>All I want to do is be able to launch the file
>with it associated application just like Windows Explorer.

Use the ShellExecute function:

Public Const SW_SHOW = 1

Public Declare Function ShellExecute Lib _
"shell32.dll" Alias "ShellExecuteA" _
(ByVal hwnd As Long, _
ByVal lpOperation As String, _
ByVal lpFile As String, _
ByVal lpParameters As String, _
ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long

Use it like this:
ShellExecute(0, "open", "C:\MyDir\MyPath\MyFile.txt", "", "", SW_SHOW)

--
Ben Baird, MVP
Visual Basic Thunder 3.0
http://www.{*filter*}highway.com/~psy/vbthunder/
Common Controls Replacement Project
http://www.*-*-*.com/
Please keep your questions on the newsgroups.



Tue, 08 May 2001 03:00:00 GMT  
 Explorer functionality
Thank you :), but when ever I use this it always returns the error code for
"There is no application associated with the given file name extension."


Quote:
>Mark...

>>All I want to do is be able to launch the file
>>with it associated application just like Windows Explorer.

>Use the ShellExecute function:

>Public Const SW_SHOW = 1

>Public Declare Function ShellExecute Lib _
>"shell32.dll" Alias "ShellExecuteA" _
>(ByVal hwnd As Long, _
>ByVal lpOperation As String, _
>ByVal lpFile As String, _
>ByVal lpParameters As String, _
>ByVal lpDirectory As String, _
>ByVal nShowCmd As Long) As Long

>Use it like this:
>ShellExecute(0, "open", "C:\MyDir\MyPath\MyFile.txt", "", "", SW_SHOW)

>--
>Ben Baird, MVP
>Visual Basic Thunder 3.0
>http://www.{*filter*}highway.com/~psy/vbthunder/
>Common Controls Replacement Project
> http://www.*-*-*.com/
>Please keep your questions on the newsgroups.



Fri, 11 May 2001 03:00:00 GMT  
 Explorer functionality
Doh, ignore this, have worked it out, thank you :)
Quote:

>Thank you :), but when ever I use this it always returns the error code for
>"There is no application associated with the given file name extension."



>>Mark...

>>>All I want to do is be able to launch the file
>>>with it associated application just like Windows Explorer.

>>Use the ShellExecute function:

>>Public Const SW_SHOW = 1

>>Public Declare Function ShellExecute Lib _
>>"shell32.dll" Alias "ShellExecuteA" _
>>(ByVal hwnd As Long, _
>>ByVal lpOperation As String, _
>>ByVal lpFile As String, _
>>ByVal lpParameters As String, _
>>ByVal lpDirectory As String, _
>>ByVal nShowCmd As Long) As Long

>>Use it like this:
>>ShellExecute(0, "open", "C:\MyDir\MyPath\MyFile.txt", "", "", SW_SHOW)

>>--
>>Ben Baird, MVP
>>Visual Basic Thunder 3.0
>>http://www.{*filter*}highway.com/~psy/vbthunder/
>>Common Controls Replacement Project
>> http://www.*-*-*.com/
>>Please keep your questions on the newsgroups.



Fri, 11 May 2001 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. IE4SP1 - Loss of Explorer Functionality after running ActiveX Document

2. TREE with Explorer functionality

3. IE4SP1 - Loss of Explorer Functionality

4. Simulating Explorer functionality...

5. Adding functionality to Internet Explorer

6. BLOCK Internet Explorer or Explorer

7. Adding buttons to an explorer upon new explorer event

8. Need Information - Explorer Bar like in Windows Explorer/Outlook Express

9. Project explorer icon clicked, but no project explorer appear

10. HELP: EXPLORER: Displaying Menu Options in Explorer

11. Internet Explorer as File Explorer

12. Any way to expose all of MSWords functionality within a frame in Explorer?

 

 
Powered by phpBB® Forum Software