C++判断安装系统的盘符

 

wstring getWindowsDirectory()
{
    wstring wstr;
    UINT size=GetWindowsDirectory(NULL,0);
    wchar_t *path=new wchar_t[size];
    if(GetWindowsDirectory(path,size)!=0) //函数调用失败将返回0
    {
        wstr=path;
    }
    delete [] path;
    return wstr;
}    

 

posted @ 2023-04-21 13:42  远方是什么样子  阅读(72)  评论(0编辑  收藏  举报