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. :)
Printable View
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. :)
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?
Here is a some code for a run dialog
Put a TextField and a Cmd button on a form
Hope it helps!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
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!
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.
Hope this helps :)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
Laterz
REM