-----------------------------------------------------------
New Message on BDOTNET
-----------------------------------------------------------
From: VaibhavModak
Message 3 in Discussion
Hi Arabinda, Check the following code for a solution to what you want. The code is
in Visual Basic 6.0. Inside Std. Module Declare Function GetDesktopWindow Lib
"user32" () As Long 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 Declare Function GetSystemDirectory Lib _
"kernel32" Alias "GetSystemDirectoryA" _
(ByVal lpBuffer As String, ByVal nSize _
As Long) As Long Inside Form Option Explicit
Private Const SE_ERR_NOASSOC = 31 Public Sub ShellDoc(strFile As String)
Dim lngRet As Long
Dim strDir As String
lngRet = ShellExecute(GetDesktopWindow, _
"open", strFile, _
vbNullString, vbNullString, vbNormalFocus)
If lngRet = SE_ERR_NOASSOC Then
' no association exists
strDir = Space(260)
lngRet = GetSystemDirectory(strDir, _
Len(strDir))
strDir = Left(strDir, lngRet) ' show the Open with dialog box
Call ShellExecute(GetDesktopWindow, _
vbNullString, "RUNDLL32.EXE", _
"shell32.dll,OpenAs_RunDLL " & _
strFile, strDir, vbNormalFocus) End If
End Sub
Inside Form Button Click Event Private Sub Command1_Click()
ShellDoc ("D:\file1.rar") ' ShellDoc ( "File_PATH_AND_NAME" )
End Sub HTH, Regards, Vaibhav Modak
-----------------------------------------------------------
To stop getting this e-mail, or change how often it arrives, go to your E-mail
Settings.
http://groups.msn.com/bdotnet/_emailsettings.msnw
Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help
For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact
If you do not want to receive future e-mail from this MSN group, or if you received
this message by mistake, please click the "Remove" link below. On the pre-addressed
e-mail message that opens, simply click "Send". Your e-mail address will be deleted
from this group's mailing list.
mailto:[EMAIL PROTECTED]