' Start the program.
Private Sub cmdRun_Click()
On Error GoTo ShellError
Select Case cboShellStyle.Text
Case "vbHide"
lblTaskId.Caption = Hex$(Shell(txtProgram.Text, _
vbHide))
Case "vbMaximizedFocus"
lblTaskId.Caption = Hex$(Shell(txtProgram.Text, _
vbMaximizedFocus))
Case "vbMinimizedFocus"
lblTaskId.Caption = Hex$(Shell(txtProgram.Text, _
vbMinimizedFocus))
Case "vbMinimizedNoFocus"
lblTaskId.Caption = Hex$(Shell(txtProgram.Text, _
vbMinimizedNoFocus))
Case "vbNormalFocus"
lblTaskId.Caption = Hex$(Shell(txtProgram.Text, _
vbNormalFocus))
Case "vbNormalNoFocus"
lblTaskId.Caption = Hex$(Shell(txtProgram.Text, _
vbNormalNoFocus))
End Select
Exit Sub
ShellError:
MsgBox "Error Shelling file." & vbCrLf & _
Err.Description, vbOKOnly Or vbExclamation, _
"Error"
Exit Sub
End Sub
|