The Python Oracle

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

Become part of the top 3% of the developers by applying to Toptal https://topt.al/25cXVn

--

Music by Eric Matyas
https://www.soundimage.org
Track title: Puzzle Game Looping

--

Chapters
00:00 Question
00:53 Accepted answer (Score 2)
01:28 Thank you

--

Full question
https://stackoverflow.com/questions/3097...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#python #button #wxpython #icons #uac

#avk47



ACCEPTED ANSWER

Score 2


I don't know how to send a Windows message in Python, but I assume you do. You need to send BCM_SETSHIELD with true as the parameter. It will be ignored on XP and earlier. Also make sure the button style is set to FlatStyle.System. The numerical value of BCM_SETSHIELD is 0x0000160C.