Hello, Leon
Welcome to Microsoft Q&A!
Microsoft does not want ISVs to continue to create their own custom desktops through CreateDesktop() in win11, so the correct solution is to use the CREDUIWIN_SECURE_PROMPT
flag, cancel the use of CreateDesktop, and use Ctrl
+Alt
+Delete
to enter CredUI, which should also meet your needs.
dialogReturn = CredentialsPromptHelper.CredUIPromptForWindowsCredentials(ref credui, errorcode, ref authPackage, IntPtr.Zero, 0, out outCredBuffer, out outCredSize, ref save, CredentialsPromptHelper.PromptForWindowsCredentialsFlags.CREDUIWIN_SECURE_PROMPT);
Thank you.
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.