 |
| VB.NET General VB.NET discussions for issues that don't fall into other VB.NET forums. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the VB.NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

August 9th, 2007, 10:51 AM
|
|
Registered User
|
|
Join Date: Aug 2007
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Displaying Run Dialogue Box
Hi
Does anyone know how i can display the Run Dialogue on the Start Menu from a vb.net program?
I know its not a .exe but somewhere in one of the dlls?
Thanks
Kane
|
|

August 9th, 2007, 06:46 PM
|
 |
Friend of Wrox
|
|
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
|
|
Do you need to the Start->Run... dialog specifically? Or are you looking to provide the user with a place to enter a program path and you want to run it? You could create your own dialog window with the same types of controls found in the windows run dialog, then use the Process class to start the outside process.
-Peter
|
|

August 10th, 2007, 01:21 PM
|
|
Friend of Wrox
|
|
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
|
|
See http://msdn2.microsoft.com/en-us/library/ms630413.aspx
FileRun Method
Displays the Run dialog to the user. This method has the same effect as clicking the Start menu and selecting Run.
Syntax:
Code:
Shell.FileRun()
Private Sub ShellFileRunVB()
Dim objShell As Shell
Set objShell = New Shell
objShell.FileRun
Set objShell = Nothing
End Sub
|
|

September 15th, 2007, 11:47 AM
|
|
Registered User
|
|
Join Date: Aug 2007
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
hmm this doesnt work with .net tho.... how wud i go about adapting it?
|
|

September 15th, 2007, 01:01 PM
|
 |
Friend of Wrox
|
|
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
|
|
Kane,
Have you looked at the documentation for the Process class I linked in my previous post? You can start any process with that.
-Peter
|
|

September 21st, 2007, 12:13 PM
|
|
Friend of Wrox
|
|
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
|
|
You say âdoesnt [sic] work with .net tho.â What happens when you try?
Peter,
When I read your response, the question that arises in my mind is, âHow would you specify the Run dialog so as to get ProcessClass to start the right process?â
|
|

September 24th, 2007, 08:59 AM
|
 |
Friend of Wrox
|
|
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
|
|
Brian,
I'm not sure I understand your question.
-Peter
|
|

September 24th, 2007, 12:23 PM
|
|
Friend of Wrox
|
|
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
|
|
Well, when you invoke something like a method to start a process, you need to specify the process you want to run (natch). But I donât think the Run dialog is an EXE, nor do I know where it might be located in the DLL it is in (if it is in one), nor the DLL in which it is located.
So let's say you had a LaunchProcess(<ProcessSpecification>) method. What would the value of <ProcessSpecification> be to get the run dialog onto the screen?
|
|

September 24th, 2007, 03:39 PM
|
 |
Friend of Wrox
|
|
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
|
|
Brian,
I think the Start->Run dialog is part of the core explorer process so you probably can't start it externally. This is why my original suggestion to the OP was that they just create their own dialog that mirrors the run dialog functionality and then use the process class to launch the process.
-Peter
|
|

September 25th, 2007, 11:44 AM
|
|
Friend of Wrox
|
|
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
|
|
That is often the best way to go (rolling your own).
It is interesting though that adding a reference to Shell allows you to put up that dialog with the .FileRun method, but he couldn't get that to fly. It would appear that MS did give some ways to interact with (or trigger functionality of) core processes of Explorer.
Also, I did miss that your suggestion for using the process class hinged on having created your own dialog. Sorry.
|
|
 |