简体   繁体   中英

ShellExecute in Windows Embedded

I am using

ShellExecute(NULL,"open","control.exe","ncpa.cpl","c:\\windows\\system32\\",SW_NORMAL); 

to open the Network Connections window. That is working on my system which has Windows XP on it. But when I make a build for the machine on which this program has to run it doesn't work. It has Windows Embedded on it. I guess it's because there is no control.exe in Windows Embedded.

So I tried running

ShellExecute(NULL,"open","Rundll32.exe","ncpa.cpl","c:\\windows\\system32\\",SW_NORMAL);

but that is not working. It returns 42 so its success, but still nothing happens. I tried various other options like using "ncpa.cpl,," and using "Rundll32.exe Shell32.dll" instead of "Rundll32.exe" but that doesn't work either. How can I use ShellExecute so that it will work on both on my machine as well as on Windows Embedded. Even if there is a solution which will only work on Windows Embedded that is fine since I will just #define it.

One option would be to skip ShellExecute and simply load and invoke the control panel directly, using its CPlApplet entry point. The protocol that needs to be followed is documented (from the control panel's point of view) in MSDN . Then you wouldn't need any external helper app to launch the control panel; you'd just host it right in your process.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM