tags:

views:

254

answers:

2

Well i would like to make a custom run dialog within my program so that the user can test commands without opening it themselves. The only problem is, msdn does not provide any coverage on this. If i cannot make my own custom run dialog and send the data to shell32.dll (where the run dialog is stored) i will settle for the code that can open the run dialog from a button. So far the only information i found is how to open it with VBScript, and i would like to know how to access shell objects within C/C++ directly.

here is the VBScript if it helps (save as .vbs if you want to see)

<script language="VBScript">
    function fnShellFileRunVB()
        dim objShell

        set objShell = CreateObject("Shell.Application")
        objShell.FileRun

        set objShell = nothing
    end function
 </script>
+1  A: 

VBScript's CreateObject() function just creates an instance of a COM object. You can do exactly the same thing in C++, you just need to read a tutorial on how to access COM objects using C++ first.

OJ
A: 

Creating a simple RUn dialog is not a big problem (the user interface). The data entered by the user can be run via ShellExecute. If you want to call the Run dialog then you should use COM.

Iulian Şerbănoiu
Yes but using shellexecute it says i need more than one parameter, the parameters could be different depending on what command they want to run. I want it to work for every command such as cmd, msconfig, dxdiag, etc.
John T