How to add a «padlock icon» to the title bar of the window?

My customer wants me to add a padlock icon on the title bar of the windows when the opened document is locked or read-only.

I believed there was a unicode character for that but it seems that it is not the case…

Does someone have any idea, a way to do this?

Thanks for your answers!

Well, at least on my Mac I can use

self.title = "--- " + &u1f512 + " - " + &u1f513 + " ---" 

No sure about Windows.

Awesome, thanks, it seems to work! I’m gonna check also on windows…

Works fine :slight_smile:

Not on my Win 7 64 bit VM…

Windows 8.1 on a physical PC. But these particular code points may not be part of the System font used for windows by Windows 7. Windows 8.1 maybe able to fetch characters from another font, which Windows 7 may not.

I found a VB thread about how to change the font in the Windows title bar of windows :
http://visualbasic.ittoolbox.com/groups/technical-functional/vb-dotnet-l/how-to-change-the-font-of-windows-form-title-bar-in-vbnet-4034739

There are several mentions of API methods, but none posted, and from the tone people did not seem too sure about what they were writing.

But there is a very interesting idea there : use a plain box window and fake the regular controls. That would indeed allow placing whatever you want in the pseudo window bar, including a color icon.