pseymour / MakeMeAdmin

Make Me Admin is a simple, open-source application for Windows that allows standard user accounts to be elevated to administrator-level, on a temporary basis.
https://makemeadmin.com/
GNU General Public License v3.0
380 stars 82 forks source link

Refresh interface to display current rights status #68

Open f0ffee opened 2 years ago

f0ffee commented 2 years ago

It appears that the program only checks the status of rights at launch; if I give myself admin rights and then leave the window open, and go back to it after they expire, it will keep showing "remove my administrator rights" as a clickable button, and no way to re-grant them to myself without closing and reopening the app.

It would be useful if the interface would refresh itself periodically, or at least after the set number of minutes to display the proper status; alternatively, a button to manually refresh it would be also useful.

I'm using release 2.3 on Windows 11.

pseymour commented 2 years ago

Really the issue here is that the window is not closing. The intended flow is that you gain admin rights, start your process(es), and then Make Me Admin closes on its own. The window closure happens after the balloon notification closes.

However, I was only handling the case where the user either 1.) lets the balloon close on its own, or 2.) clicks the X on the balloon to close it. If the user clicks the balloon itself to dismiss it, the window does not close. Then, you see the behavior you describe. The buttons do not refresh, because the window is not supposed to be open anymore.

I have updated the code to refresh the buttons after the balloon tip closes, in the case that the window stays open.

Please check out the current code here, to see if it addresses your issue.

NOTE: I will probably, before 2.4 is released, set the window to always close after admin rights are removed, with an option to override that default behavior.

pseymour commented 2 years ago

Update: The setting to control the window closing behavior has been added.