Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我试图找出是否有一种简单的方法来判断调用函数是否需要我的程序以管理员身份运行才能正常工作。谢谢!
当然。您可以运行该功能,如果它失败并显示GetLastError() == ERROR_ACCESS_DENIED,那么您需要管理权限。
GetLastError() == ERROR_ACCESS_DENIED