mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 14:16:07 -06:00
* Core: ProcessHasAdminRights() function is added to utility functions. * reference/DetectPrivegedProcess: Cosmetics. * Core: ProcessHasAdminRights() renamed as IsAdmin() * Core: IsAdmin() renamed as IsUserAdmin().
12 lines
347 B
C++
12 lines
347 B
C++
#include <CtrlLib/CtrlLib.h>
|
|
|
|
using namespace Upp;
|
|
|
|
GUI_APP_MAIN
|
|
{
|
|
// Run the example as administrator (Windows) or as root (POSIX) to get the warning.
|
|
if(IsUserAdmin())
|
|
Exclamation(t_("Warning: Application has administrator/root rights.&This might pose a security risk!"));
|
|
else
|
|
PromptOK(t_("Application has user rights."));
|
|
}
|