Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ShellExecute

Status
Not open for further replies.

YanaD

Programmer
Mar 22, 2001
38
0
0
US
I have one Main application where I have 3 different command buttons. Each command button has to open different executable applications, but the Main applic shouldn't be closed, it should remain on a screen. Also when user clicks on one of the command buttons it should open the appropriate executable. When user done with one exec.,it's should be minimized and placed down in main application. When user want to click again at the same command button, it should check if this executable already opened, then maximize it, if not opened then open it.
if something unclear, let me know.
 
Can you please be more specific, if it's not hard for u, can you please provide entire code for this task.
Thanx in advance
 
ummmm, that is all the code.
It would go in the command click event.
ex: path "c:\windows\notepad.exe",vbmaximized -God Bless
 
Here is an example:
************************************************************
Dim SortProgram as string
Dim SortSpec as String

SortProgram = "S:\SORT.EXE"

SortSpec = SortProgram & " " & lblInputFile.Caption & "*" & RecordSize & " " & WorkFile & " " & txtXup.Text & " " & txtBoxSize.Text
X = Shell(SortSpec, vbhide)
************************************************************
When you type the comma in after the program you are shelling it will give you choices of how you want you app displayed. Hope this helps.
 
Does this code allow you to open a program w/ certian settings?
Like clicking on a link would open your e-mail program with the subject & email filled in?(well, the concept anyway) -God Bless
 
Look up ShellExecute, it allows you to open a program (or the program registered to a particular file type). It allows you to send command line parameters.
 
Place in a module

'used for shelling out to the default web browser or mail program

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
Public Const conSwNormal = 1
Public Const SW_SHOW = 3

'this is where you call the default mail handler in your app
Private Sub mnuHelpMail_Click()
ShellExecute hwnd, "open", "mailto:info@tulsafindit.com", _
vbNullString, vbNullString, SW_SHOW
End Sub

Eric
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top