0

I must start an application and I must check that the application tells me it works with the correct signature.This information is shown via the "User Access Control" Dialog.

Because the system stops after process.Start I do this job in backgroundWorker_DoWork. The application starts fine, shows the "User Access Control" Dialog and my following code was found.

My problem is to find the window of "User Access Control" Dialog.

The code

IntPtr hWnd = FindWindow(IntPtr.Zero, "Benutzerkontensteuerung");

finds no window. And

int HWND = 0;
EnumWindows(new EnumWindowCallBack(EnumWindowCallBack), HWND);

also finds no window with "Benutzerkontensteuerung".

Is there a chance to find this window, the find the message for the user and to send an Enter to it?

Kai Neugebauer
  • 127
  • 1
  • 5
  • You are not supposed to be able to find it, the UAC prompt is displayed on the secure desktop. For obvious reasons, the protection is bullet-proof. At best you could ask for elevation for your own program so no UAC prompt has to be displayed for the invoked process, but that just moves the goal posts. – Hans Passant Jun 30 '22 at 12:05
  • I have to write a test for a given software. The test has to check the correct signature usage via windows after a hack of the software. – Kai Neugebauer Jun 30 '22 at 12:18

0 Answers0