mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
ADD: Show UAC icon
This commit is contained in:
parent
2fbc1e0a5c
commit
2d0eb4d596
3 changed files with 21 additions and 0 deletions
|
|
@ -28,6 +28,11 @@ function ShowElevation(const ATitle, AText: String): TMyMsgResult;
|
|||
|
||||
implementation
|
||||
|
||||
{$IF DEFINED(MSWINDOWS)}
|
||||
uses
|
||||
Windows, uIcoFiles;
|
||||
{$ENDIF}
|
||||
|
||||
{$R *.lfm}
|
||||
|
||||
function ShowElevation(const ATitle, AText: String): TMyMsgResult;
|
||||
|
|
@ -56,7 +61,23 @@ end;
|
|||
{ TfrmElevation }
|
||||
|
||||
procedure TfrmElevation.ShowModalSync;
|
||||
{$IF DEFINED(MSWINDOWS)}
|
||||
const
|
||||
IDI_SHIELD = PAnsiChar(32518);
|
||||
var
|
||||
hIcon: THandle;
|
||||
AIcon: Graphics.TIcon;
|
||||
{$ENDIF}
|
||||
begin
|
||||
{$IF DEFINED(MSWINDOWS)}
|
||||
hIcon:= LoadImage(0, IDI_SHIELD, IMAGE_ICON, 0, 0, LR_DEFAULTSIZE or LR_SHARED);
|
||||
if (hIcon <> 0) then
|
||||
begin
|
||||
AIcon:= CreateIconFromHandle(hIcon);
|
||||
imgShield.Picture.Assign(AIcon);
|
||||
AIcon.Free;
|
||||
end;
|
||||
{$ENDIF}
|
||||
ModalResult:= ShowModal;
|
||||
end;
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue