Call the code of the shell interface (system run window)

zhaozj2021-02-17  51

// - Call the code of the shell interface (system run window)

#include "stdafx.h"

// - Interface # include

#include using namespace std;

Void filerun () {// - com Co. "--- invoke shellrun ---" << endl; ishelldispatch * shell = null; hResult hr = cocreateInstance (CLSID_SHELL, NULL, CLSCTX_SERVER , IID_IDISPATCH, (void **) & shell; if (failed (hr) ||! Shell) {cout << "interface failed." << endl; break;} shell-> fileerun (); // shell-> FindFiles (); / * Shell object methods The Shell object has the following methods: BrowseForFolder CascadeWindows ControlPanelItem EjectPC Explore FileRun FindComputer FindFiles Help MinimizeAll NameSpace Open RefreshMenu SetTime ShutdownWindows Suspend TileHorizontally TileVertically TrayProperties UndoMinimizeALL Windows * / shell-> Release (); cout << "--- ShellRun OK .---" << endl; break;} while (false); // - com coundialize ();

INT Main (int Argc, char * argv []) {fileerun (); return 0;}

转载请注明原文地址:https://www.9cbs.com/read-28680.html

New Post(0)