Results 1 to 5 of 5

Thread: Display RUN dialog box - HELP!!

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 1999
    Location
    Prague, Czech Republic
    Posts
    350

    Angry

    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.

  2. #2
    Fanatic Member
    Join Date
    Mar 2000
    Location
    That posh bit of England known as Buckinghamshire
    Posts
    658
    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!

  3. #3
    Frenzied Member CyberCarsten's Avatar
    Join Date
    Sep 1999
    Location
    Aalborg Ø, Denmark
    Posts
    1,544

    Talking

    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!
    razor
    Software Engineer Student, Aalborg University, Denmark
    http://www.cs.auc.dk

    My email at AUC: will get a new email soon
    My website: http://www.razorsoftware.net


    Windows XP Pro/ Gentoo Linux (Laptop)
    Windows XP Pro (Home PC)

  4. #4
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238

    Lightbulb 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!

  5. #5
    Lively Member
    Join Date
    Apr 2000
    Posts
    110

    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
  •  



Click Here to Expand Forum to Full Width