Prev: How to recover from a EXCEPTION_STACK_OVERFLOW?
Next: Question Use of IOCTL_DISK_UPDATE_PROPERTIES Update dynamic volume Partition on VISTA
From: dc2000 on 23 Nov 2006 17:23 Hi everyone: It sounds like a simple question, but how to emulate the Run command from the Windows Start menu in my own program? I don't mean simple running a program, what I'm talking about is how to use command line parameters and stuff? Something like this: rundll32 user32.dll MessageBox ipconfig /renew "C:\Documents and Settings\User\Desktop\my app.exe" /par1 time="10:35:30 pm" file="my file.doc" All of the above works in Run window, but is there an API for it? Thanks!
From: David Lowndes on 23 Nov 2006 17:59 >It sounds like a simple question, but how to emulate the Run command from >the Windows Start menu in my own program? > >I don't mean simple running a program, what I'm talking about is how to use >command line parameters and stuff? I'm not sure what you're asking. ShellExecute(Ex) is essentially the API that is used. Dave
From: Vladimir Scherbina on 23 Nov 2006 18:47 "David Lowndes" <DavidL(a)example.invalid> wrote in message news:kt9cm2tv0rhgk94h0v82npscudf2l1lupu(a)4ax.com... [...] > ShellExecute(Ex) is essentially the > API that is used. Or CreateProcess specifiying the command line arguments. -- Vladimir (Windows SDK MVP)
From: dc2000 on 24 Nov 2006 02:50 Thank you. "Vladimir Scherbina" wrote: > "David Lowndes" <DavidL(a)example.invalid> wrote in message > news:kt9cm2tv0rhgk94h0v82npscudf2l1lupu(a)4ax.com... > > [...] > > > ShellExecute(Ex) is essentially the > > API that is used. > > Or CreateProcess specifiying the command line arguments. > > -- > Vladimir (Windows SDK MVP) > > >
From: dc2000 on 24 Nov 2006 04:44
Interesting. I've just tried the following code: STARTUPINFO si = {0}; PROCESS_INFORMATION pi = {0}; si.cb = sizeof(si); CreateProcess(NULL, "rundll32 user32.dll MessageBox", 0, 0, FALSE, 0, NULL, NULL, &si, &pi); The result is TRUE but nothing happens. If one types the same in the Run window, it shows a dialog box. What is the difference here? PS. I'm using that rundll32 line as an example, I don't need to emulate a call to MessageBox "Vladimir Scherbina" wrote: > "David Lowndes" <DavidL(a)example.invalid> wrote in message > news:kt9cm2tv0rhgk94h0v82npscudf2l1lupu(a)4ax.com... > > [...] > > > ShellExecute(Ex) is essentially the > > API that is used. > > Or CreateProcess specifiying the command line arguments. > > -- > Vladimir (Windows SDK MVP) > > > |