The method for listing all Shell objects is not provided below. For more information, see <shell Object>
Ishelldispatch: Public idispatch {// you must specify the name of the control panel program. cpl suffix hresult controlpanelitem (BSTR szdir); // causes the Start menu to refresh its contentshresult refreshmenu (void); // find the computer hresult findcomputer (void ); // pop up the search file dialog box hresult findfiles (void) // pop up the system help hresult help (); // pop up the taskbar Properties dialog box hresult trayproperties (void ); // The hresult settime (void) hresult ejectpc () // hresult suspend () // shutdown hresult shutdownwindows () // hresult tilehorizontally () // vertically tiled hresult tilevertically () // stacked window hresult cascadewindows () // The run dialog box hresult filerun () // restore window minimization hresult undominimizeall () // hresult minimizeall () for minimizing all windows // ccomvariant vdir (L "C:/"); note: add/PAR // PSL-> cmde (vdir) at the end of the root directory ); you can also directly specify the file path // parameter or enumerate the value of shellspecialfolderconstants (this enumeration defines a system directory as a constant) hresult implements E (variant vdir) // similar to explorer, but it can open webpages, directories, and files. It feels better than explorer to use hresult open (variant vdir) // create and return a shellwindow Object Pointer hresult windows (/* [retval] [out] */idispatch _ rpc_far * ppid )}
A simple example: the run dialog box coinitialize (null); ishelldispatch * PSL; hresult hres = cocreateinstance (clsid_shell, null, clsctx_inproc_server, iid_ishelldispatch, (lpvoid *) appears *) & PSL); If (succeeded (hres) {PSL-> filerun () PSL-> release ();} couninitialize ();