Is it possible to open the run menu (start->run) from a C# program?
If it's possible, how do i do it? :D
Printable View
Is it possible to open the run menu (start->run) from a C# program?
If it's possible, how do i do it? :D
add a reference to System.Runtime.InteropServices at the top of your code window.
then drop this code in, i quickly knocked it together so it basically does what it says on the tin, opens the run dialog ( like when you click, start --- run )
:)VB Code:
[DllImport("shell32.dll", EntryPoint = "#61")] private static extern int SHRundialog(IntPtr hOwner, int Unknown1, int Unknown2, IntPtr szTitle, IntPtr szPrompt, int uFlags); private void button1_Click(object sender, EventArgs e) { IntPtr caption = Marshal.StringToHGlobalAuto("custom run dialog caption"); IntPtr title = Marshal.StringToHGlobalAuto( "what do you want to run" ); SHRundialog(this.Handle, 0 , 0 , caption, title, 2); }
Thanks for the help.
Now to work on getting it to work cross-threads! :P