VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



This Code perfrom the same functionality as the run command provided by windows using API

by Hatim S Rampurawala (1 Submission)
Category: Windows System Services
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Wed 4th February 2004
Date Added: Mon 8th February 2021
Rating: (1 Votes)

This Code perfrom the same functionality as the run command provided by windows using API

API Declarations



Option Explicit
Private 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
Dim i As Long, iHwnd As Integer

Rate This Code perfrom the same functionality as the run command provided by windows using API



   If KeyCode = 13 Then
        If Trim(txtCommand.Text) <> "" Then
           ShellExecute frmAddressBar.hwnd, "OPEN", txtCommand.Text, vbNullString, vbNullString, vbNormalFocus
        End If
    End If
End Sub
Private Sub cmdBrowse_Click()
    cd1.DefaultExt = "*.*"
    cd1.Filter = "*.*"
    cd1.ShowOpen
    txtCommand.Text = cd1.FileName
    cmdOpen.SetFocus
End Sub

Private Sub cmdCancel_Click()
    Form_KeyUp 27, 0
End Sub

Private Sub cmdOpen_Click()
    txtCommand_KeyUp 13, 0
End Sub

Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
    If KeyCode = 27 Then
        End
    End If
End Sub

Private Sub Form_Load()
    If App.PrevInstance = True Then
        MsgBox "One Instance already loaded", vbInformation
        End
    End If
End Sub


Download this snippet    Add to My Saved Code

This Code perfrom the same functionality as the run command provided by windows using API Comments

No comments have been posted about This Code perfrom the same functionality as the run command provided by windows using API. Why not be the first to post a comment about This Code perfrom the same functionality as the run command provided by windows using API.

Post your comment

Subject:
Message:
0/1000 characters