How to set Windows UAC Shield overlay on a button using wxPython?

I have a button that starts a process that requires a UAC upgrade. I want to display the Windows UAC screen overlay on the button, how to do it in wxPython? The application will only work on Windows, so I don’t need to worry that it does not work on other systems.

edit 2: Got this:

BCM_SETSHIELD = 0x0000160C
btn_apply = wx.Button(self, wx.ID_APPLY, "Apply",
                      wx.DefaultPosition, wx.DefaultSize, 0)
response = win32gui.SendMessage(btn_apply.GetHandle(), BCM_SETSHIELD, None, True)

I believe in wparam and not in lparam SendMessage, this works now. Now I'm just wondering if BCM_SETSHIELD is declared in some library somewhere in pywin32, but I'm fine with declaring a constant if I need to.

+3
source share
1 answer

, Windows Python, , . BCM_SETSHIELD true . XP . , FlatStyle.System. BCM_SETSHIELD 0x0000160C.

+2

Source: https://habr.com/ru/post/1751280/


All Articles