I want to notify the user that my application wants to start an elevated process using the standard MessageBox. Is there a way of achieving this short of reimplementing the MessageBox?
For example, for standard buttons, you can send the BCM_SETSHIELD message. Is there something similar for message boxes?
Buttons in a message dialog are standard buttons, you can send them a
BCM_SETSHIELDmessage.For this, you need to be aware when a message dialog box is activated. One way can be to set a temporary
WH_CBThook and in its callback watch for an ‘nCode’ ofHCBT_ACTIVATEfor a window having the dialog class (#32770).Another way can be to handle
WM_ACTIVATEafter ‘MessageBox’ is called, ‘wParam’ should beWA_ACTIVEand ‘lParam’ should be a window handle again of the dialog class. Then you can send the ‘BCM_SETSHIELD’ message to the button f.i. having control idIDOK.