在程序中打开我的电脑两种方法
方法1:
********************************************************************************************************************
::ShellExecute(this->m_hWnd,"open","explorer.exe",
"::{20D04FE0-3AEA-1069-A2D8-08002B30309D}", NULL,SW_SHOWDEFAULT);
方法2:
********************************************************************************************************************
if ( SUCCEEDED( SHGetSpecialFolderLocation ( NULL, CSIDL_DRIVES, &pidl )))
{
SHELLEXECUTEINFO sei;
ZeroMemory(&sei, sizeof(sei));
sei.cbSize = sizeof(sei);
sei.fMask = SEE_MASK_IDLIST;
sei.lpIDList = pidl;
sei.lpVerb = "open";
sei.hwnd = AfxGetMainWnd()->GetSafeHwnd();
sei.nShow = SW_SHOWNORMAL;
ShellExecuteEx(&sei);
if ( SUCCEEDED( SHGetMalloc ( &pMalloc )))
{
pMalloc->Free ( pidl );
pMalloc->Release();
}
}