amethystwindows icon indicating copy to clipboard operation
amethystwindows copied to clipboard

manage elevated windows

Open glsorre opened this issue 3 years ago • 2 comments

It is not a trivial problem...anyone wants to help? For now I excluded the ConsoleWindowClass in #29.

glsorre avatar May 17 '21 17:05 glsorre

I did some testing using Amethyst app and a prior C# project of mine that uses user32.dll SetWindowPos to interact/change windows. Both were were unable to change the elevated windows that had been ran using Run as Admin. Both appear to obtain a window handle normally but can not carry out the window change across accounts.

Possible End User Solution- I was able to get the elevated windows that were ran with "Run as Admin", to function normally with Amethyst by exiting out of Amethyst and running Amethyst as admin too. I will be interested to see if this works for those who had this issue.

Possible Code Solution- Using something along the lines of Impersonation.RunAsUser might allow for the window change commands to be ran from within the same code as a different user. However, this might not be a good solution if it requires the user to type in account information, especially since they might be able to just run Amethyst as admin if that ends up working for them.

Stobz avatar Mar 08 '22 03:03 Stobz

Hi Stobz, how did you manage to run Amethyst as an administrator? Did you build it as a non-UWP app? Apparently normal UWP apps can't run as administrator so I tried building Amethyst as an elevated UWP app according to these instructions (https://stefanwick.com/2018/10/01/app-elevation-samples-part-1/) but it made no difference as far as being able to control other admin windows.

TwoLeaves avatar Jun 02 '22 12:06 TwoLeaves