|
-
Jun 22nd, 2000, 07:14 PM
#1
Thread Starter
Hyperactive Member
I would like to show a standard Windows RUN dialog box, which can be found in Start menu. If somebody knows how, please tell me.
-
Jun 22nd, 2000, 07:18 PM
#2
Fanatic Member
It wouldn't be to dificult to write your own.
Simple form, with ok, cancel & browse buttons. Text box, and a common dialog, that opened when you hit the browse button.
then you could shell the program selected. Not sure if this will open up text file in notepad automatically though?
Iain, thats with an i by the way!
-
Jun 22nd, 2000, 07:33 PM
#3
Frenzied Member
Here is a some code for a run dialog
Put a TextField and a Cmd button on a form
Code:
Private Sub Command1_Click()
On Error Goto Err
RetVal = Shell(Text1.Text ,1)
Exit Sub
Err:
MsgBox("The file" & " " & Text1.Text & " " & "Could not be found!"
End Sub
Hope it helps!
-
Jun 23rd, 2000, 12:37 AM
#4
PowerPoster
ShellExecute
If you really goto create your own Run Dialog Box, then you should use the ShellExecute API function to shell the application or whatever was stated in the textbox control.
This because the ShellExecute API will search for the associated program before it run the application/file
that stated in the textBox control.
Again thi definately will give you a more effective solution.
Cheers!
-
Jun 23rd, 2000, 01:43 AM
#5
Lively Member
I know what you mean :)
I know exactly what you're after. You can show the run dialogue through API, and you can even customize the title text on the dialog and the selected text inside the dialogue. Check out the code sample.
Code:
Option explicit
Private Const shrdNoMRUString = &H2
Private Declare Function SHRunDialog Lib "shell32" _
Alias "#61" (ByVal hOwner As Long, ByVal Unknown1 _
As Long, ByVal Unknown2 As Long, ByVal szTitle As _
String, ByVal szPrompt As String, ByVal _
uFlags As Long) As Long
'To call use the following
SHRunDialog Me.hWnd, 0, 0, "Run a program!", "Type the path to a file or program to execute.", 0
Hope this helps 
Laterz
REM
"Innovate, don't immitate."
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|