Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB.NET
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old August 9th, 2007, 10:51 AM
Registered User
 
Join Date: Aug 2007
Location: , , .
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

Reply With Quote
  #2 (permalink)  
Old August 9th, 2007, 06:46 PM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
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
Reply With Quote
  #3 (permalink)  
Old August 10th, 2007, 01:21 PM
Friend of Wrox
 
Join Date: Nov 2004
Location: Port Orchard, WA, USA.
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
Reply With Quote
  #4 (permalink)  
Old September 15th, 2007, 11:47 AM
Registered User
 
Join Date: Aug 2007
Location: , , .
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?

Reply With Quote
  #5 (permalink)  
Old September 15th, 2007, 01:01 PM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
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
Reply With Quote
  #6 (permalink)  
Old September 21st, 2007, 12:13 PM
Friend of Wrox
 
Join Date: Nov 2004
Location: Port Orchard, WA, USA.
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?”
Reply With Quote
  #7 (permalink)  
Old September 24th, 2007, 08:59 AM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Brian,

I'm not sure I understand your question.

-Peter
Reply With Quote
  #8 (permalink)  
Old September 24th, 2007, 12:23 PM
Friend of Wrox
 
Join Date: Nov 2004
Location: Port Orchard, WA, USA.
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?
Reply With Quote
  #9 (permalink)  
Old September 24th, 2007, 03:39 PM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
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
Reply With Quote
  #10 (permalink)  
Old September 25th, 2007, 11:44 AM
Friend of Wrox
 
Join Date: Nov 2004
Location: Port Orchard, WA, USA.
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.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 09: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



All times are GMT -4. The time now is 05:42 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.