Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB.NET
|
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
 
Old August 9th, 2007, 10:51 AM
Registered User
 
Join Date: Aug 2007
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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

 
Old August 9th, 2007, 06:46 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

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
 
Old August 10th, 2007, 01:21 PM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

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
 
Old September 15th, 2007, 11:47 AM
Registered User
 
Join Date: Aug 2007
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hmm this doesnt work with .net tho.... how wud i go about adapting it?

 
Old September 15th, 2007, 01:01 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

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
 
Old September 21st, 2007, 12:13 PM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

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?”
 
Old September 24th, 2007, 08:59 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Brian,

I'm not sure I understand your question.

-Peter
 
Old September 24th, 2007, 12:23 PM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

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?
 
Old September 24th, 2007, 03:39 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

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
 
Old September 25th, 2007, 11:44 AM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

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.





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to open a dialogue box maximized Pete Bone Visual C++ 0 October 10th, 2007 06:23 AM
Open the "Open File" dialogue box piratelordx Access VBA 4 March 14th, 2006 10:08 PM
Closing an IE "OK" Dialogue box. Ahrenl Excel VBA 4 May 27th, 2005 10:04 AM
Open Print dialogue box vladimir Access VBA 7 September 21st, 2004 08:46 AM
Get rid of that nasty parameter dialogue box gzuhlke Crystal Reports 1 July 29th, 2003 10:23 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.