How to create a "UAC like confirmation box in C++!" ???

closed account (3hMz8vqX)
Hi All,

Recently I made a new User Account with UAC enabled , okay...
Then if I wanted to run any program as admin the screen would be covered with a black transparent bitmap and it will show up a confirmation box . . .

So, how do I make that kind of confirmation boxes in c++ WINAPI
My goal is a simple message box on the centre of the screen with buttons yes and no
but the screen should be covered with that black bitmap . . .
something kind of a secure desktop, I guess . . .

Can someone please please help me out . . .
I would love to have a code snippet too :)

Im using Dev C++
Windows 7 32 bit Ultimate

Thankyou everyone in advance!!! :D
Do you want to make the actual UAC prompt? You can add this to your manifest:

<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">

I don't know how Windows makes that prompt and I'm not exactly up to date on the winapi, but you could probably use a fullscreen borderless layered window with partial transparency and a modal dialog box on top of it to make the prompt.

I would strongly suggest you do run-time elevation, it will not only give you more dynamic support over the whole UAC prompt, but you can prompt the client\end-user to elevate the application when ever you wish.

Instead of me giving code I suggest you read this article:

closed account (3hMz8vqX)
Hi All!!!

Thankyou everyone who answered!!!

Thankyou very much SpaceWorm now, I know how to elevate
during run time!!!

I have been searching for ages . . .
but, now I found it!!! :)

And thankyou ahcfan for your XML file
this is very good!!! :)

Thankyou all for your support and corporation!!!


Topic archived. No new replies allowed.