Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to programmatically open Run c++?

the question is how to open Run programmatically from c++? I know that have some function that can replace that, like shellexec, winexec but for some task I need just Run dialog to appear.

like image 315
raptor Avatar asked Dec 04 '10 22:12

raptor


2 Answers

The Run Dialog is located in shell32.dll using the function RunFileDlg. One way show the dialog is to use rundll32.exe to invoke that function. Execute the following command using the CreateProcess Win32 API:

rundll32.exe shell32.dll,#61

(where #61 is the ordinal number of the RunFileDlg function).

Reference for shell32.dll functions: http://www.geoffchappell.com/viewer.htm?doc=studies/windows/shell/shell32/api/index.htm

Hope this helps.

like image 159
Dia Kharrat Avatar answered Sep 30 '22 23:09

Dia Kharrat


Use shellexec, winexec or any other favorite function to execute

rundll32.exe shell32.dll,#61

This will open the dialog.

like image 29
Yakov Galka Avatar answered Oct 01 '22 01:10

Yakov Galka