You are probably looking for the ShellExecute () function in shell32.h. It is called using the "action verb", path, and optional parameters. In your case, it will want to either "discover" or "explore" as follows:
ShellExecute(NULL, "open", "C:\", NULL, NULL, SW_SHOWDEFAULT);
This will open the standalone explorer window in C :. ShellExecute () will give basically the same action as entering a command in the Run dialog box. It will also handle URLs, so the following browser will open the default browser:
ShellExecute(NULL, "open", "http://www.google.com", NULL, NULL, SW_SHOWDEFAULT);
Even though, pay attention to the note in the documentation that ShellExecute relies on COM (although your code does not need to worry about any COM objects).
CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE)
Scottf
source share