VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



This application should be used in place of shelling a application. If we shell a program and its n

by Vishal V. Kulkarni (6 Submissions)
Category: Windows API Call/Explanation
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Fri 16th February 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)

This application should be used in place of shelling a application. If we shell a program and its not present in that directory then we

API Declarations


'program and opens the file.
'This code can be freely distributed.
'Please mail your queries at [email protected]
'Need:
'====
'This application should be used in place of shelling a application.
'If we shell a program and its not present in that directory then we encounter
'errors .This code takes care to open the file in a default program

Option Explicit
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpszOp As String, ByVal lpszFile As String, ByVal lpszParams As String, ByVal lpszDir As String, ByVal FsShowCmd As Long) As Long
Private Declare Function GetDesktopWindow Lib "user32" () As Long
Const SW_SHOWNORMAL = 1

Rate This application should be used in place of shelling a application. If we shell a program and its n



     Dim Scr_hDC As Long
     Scr_hDC = GetDesktopWindow()
     lStartDoc = ShellExecute(Scr_hDC, "Open", sDocName, "", "C:\", SW_SHOWNORMAL)
 End Function
Private Sub Form_Click()
    Dim l As Long
    l = lStartDoc("C:\bankfile.mdb") '---- put your filename here
    ' I hope you can alter the code as per your need.
End Sub


Download this snippet    Add to My Saved Code

This application should be used in place of shelling a application. If we shell a program and its n Comments

No comments have been posted about This application should be used in place of shelling a application. If we shell a program and its n. Why not be the first to post a comment about This application should be used in place of shelling a application. If we shell a program and its n.

Post your comment

Subject:
Message:
0/1000 characters