2
votes

I am pretty new to Delphi XE and I see that the button component has a elevate privileges option.

However if set to true UAC doesn't prompt on click. How can I use it?

1

1 Answers

3
votes

The documentation explains that setting the ElevationRequired property to True adds the shield icon. It doesn't indicate that clicking the button automatically invokes a UAC (elevation) prompt.

Puts a shield icon on a button, indicating that elevated access rights are required.

The code you provide for the button's OnClick event should start a process that requires elevation (which will then prompt for credentials). You can use ShelllExecuteEx with the runas verb for doing so.