The easiest way to change the skin of the GUI - skinsharp

Post your working scripts, libraries and tools for AHK v1.1 and older
tuzi
Posts: 223
Joined: 27 Apr 2016, 23:40

The easiest way to change the skin of the GUI - skinsharp

Post by tuzi » 29 Jan 2021, 22:07

Image

Advantages.
1. Change skin only need 1 line of code.DllCall("SkinH\SkinH_AttachEx", "Str", "skinh.she")
2. Separate skin and code.
2. ansi and unicode32 both have trial version.
3. The trial version only adds a small extra copyright image to the interface.

Disadvantages.
1.x64 has no trial version.

If you know other better ways - such as completely free or x64-supported - please let me know.

Download:https://github.com/telppa/skinsharp/releases
User avatar
Tigerlily
Posts: 377
Joined: 04 Oct 2018, 22:31

Re: The easiest way to change the skin of the GUI - skinsharp

Post by Tigerlily » 30 Jan 2021, 16:42

@tuzi

I've been able to partially reskin all windows system-wide using my Screen Dimmer app (its v2-only, but also compiled version is on GitHub in case you want to test out the skinning feature without installing AHK v2). If you use my app, look under background modes to change individual system elements partially, and use background themes to change system elements completely. My app only covers COLORS and not changing the windows to different styles like in the screenshots shown above.

Here is an excerpt of the background modes code in my app that might be useful to you:

Code: Select all

ChangeBackgroundMode(radio, *){

    static userBg := DllCall("user32\GetSysColor", "int", 1) ; Get user's desktop background color
    static backgroundModes := Map(
    "Normal"  , Map(0x000000, 0xC8C8C8, 1, userBg,   2, 0xD1B499, 3, 0xDBCDBF, 4, 0xF0F0F0, 5, 0xFFFFFF, 6, 0x646464, 7, 0x000000, 8, 0x000000, 9, 0x000000, 10, 0xB4B4B4, 11, 0xFCF7F4, 12, 0xABABAB, 13, 0xD77800, 14, 0xFFFFFF, 15, 0xF0F0F0, 16, 0xA0A0A0, 17, 0x6D6D6D, 18, 0x000000, 19, 0x000000, 20, 0xFFFFFF, 21, 0x696969, 22, 0xE3E3E3, 23, 0x000000, 24, 0xE1FFFF, 26, 0xCC6600, 27, 0xEAD1B9, 28, 0xF2E4D7, 29, 0xD77800, 30, 0xF0F0F0),
    "Morning" , Map(0x000000, 0xC7EDCC, 1, userBg,   2, 0xD1B499, 3, 0xC7EDCC, 4, 0xC7EDCC, 5, 0xC7EDCC, 6, 0x646464, 7, 0x000000, 8, 0x000000, 9, 0x000000, 10, 0xB4B4B4, 11, 0xFCF7F4, 12, 0xC7EDCC, 13, 0xD77800, 14, 0xFFFFFF, 15, 0xC7EDCC, 16, 0xA0A0A0, 17, 0x6D6D6D, 18, 0x000000, 19, 0x000000, 20, 0xFFFFFF, 21, 0x696969, 22, 0xE3E3E3, 23, 0x000000, 24, 0xE1FFFF, 26, 0xCC6600, 27, 0xEAD1B9, 28, 0xF2E4D7, 29, 0xD77800, 30, 0xF0F0F0),
    "Day"	  , Map(0x000000, 0xABABAB, 1, userBg,   2, 0xD1B499, 3, 0xABABAB, 4, 0xABABAB, 5, 0xABABAB, 6, 0x646464, 7, 0x000000, 8, 0x000000, 9, 0x000000, 10, 0xB4B4B4, 11, 0xFCF7F4, 12, 0xABABAB, 13, 0xD77800, 14, 0xFFFFFF, 15, 0xABABAB, 16, 0xA0A0A0, 17, 0x6D6D6D, 18, 0x000000, 19, 0x000000, 20, 0xFFFFFF, 21, 0x696969, 22, 0xE3E3E3, 23, 0x000000, 24, 0xE1FFFF, 26, 0xCC6600, 27, 0xEAD1B9, 28, 0xF2E4D7, 29, 0xD77800, 30, 0xF0F0F0),
    "Night"	  , Map(0x000000, 0x000000, 1, 0x000000, 2, 0x595757, 3, 0x595757, 4, 0x595757, 5, 0x595757, 6, 0x000000, 7, 0x000000, 8, 0xC6C8C5, 9, 0xC6C8C5, 10, 0x000000, 11, 0x000000, 12, 0x595757, 13, 0x5A5A57, 14, 0xC6C8C5, 15, 0x595757, 16, 0x000000, 17, 0x808080, 18, 0xC6C8C5, 19, 0xC6C8C5, 20, 0x5A5A57, 21, 0x000000, 22, 0x5A5A57, 23, 0xC6C8C5, 24, 0x000000, 26, 0xF0B000, 27, 0x000000, 28, 0x000000, 29, 0x5A5A57, 30, 0x000000),
    "Evening" , Map(0x000000, 0x000000, 1, 0x000000, 2, 0x222223, 3, 0x222223, 4, 0x222223, 5, 0x222223, 6, 0x000000, 7, 0x000000, 8, 0xC6C8C5, 9, 0xC6C8C5, 10, 0x000000, 11, 0x000000, 12, 0x222223, 13, 0x5A5A57, 14, 0xC6C8C5, 15, 0x222223, 16, 0x000000, 17, 0x808080, 18, 0xC6C8C5, 19, 0xC6C8C5, 20, 0x5A5A57, 21, 0x000000, 22, 0x5A5A57, 23, 0xC6C8C5, 24, 0x000000, 26, 0xF0B000, 27, 0x000000, 28, 0x000000, 29, 0x5A5A57, 30, 0x000000),
    "Midnight", Map(0x000000, 0x000000, 1, 0x000000, 2, 0xC6C8C5, 3, 0x000000, 4, 0x000000, 5, 0x000000, 6, 0x000000, 7, 0x000000, 8, 0xC6C8C5, 9, 0xC6C8C5, 10, 0x000000, 11, 0x000000, 12, 0x000000, 13, 0x5A5A57, 14, 0xC6C8C5, 15, 0x000000, 16, 0x000000, 17, 0x808080, 18, 0xC6C8C5, 19, 0xC6C8C5, 20, 0x000000, 21, 0x000000, 22, 0x000000, 23, 0xC6C8C5, 24, 0x000000, 26, 0xF0B000, 27, 0x000000, 28, 0x000000, 29, 0x5A5A57, 30, 0x000000),
    "Twilight", Map(0x000000, 0x000000, 1, 0x000000, 2, 0x8C3230, 3, 0x000000, 4, 0x000000, 5, 0x000000, 6, 0x000000, 7, 0x000000, 8, 0x8C3230, 9, 0xC6C8C5, 10, 0x000000, 11, 0x000000, 12, 0x000000, 13, 0x080816, 14, 0xC04B48, 15, 0x000000, 16, 0x000000, 17, 0x808080, 18, 0x8C3230, 19, 0x8C3230, 20, 0x000000, 21, 0x000000, 22, 0x000000, 23, 0x8C3230, 24, 0x000000, 26, 0xC04B48, 27, 0x000000, 28, 0x000000, 29, 0x5A5A57, 30, 0x000000))

    for displayElement, color in backgroundModes[radio.Name]
        try DllCall("user32\SetSysColors", "Int", 1, "IntP", displayElement, "UIntP", color)
}
the app uses a radio control to activate each mode, but i'm sure you can take what you need.

As you may notice, you dont require any dependencies (DLLs or 3rd party software) for this - just support for the WIN APIs. There are ways to reskin like how you are showing above without downloading other DLLs or 3rd party software, but I wasn't able to figure it out since it appeared to be a very complicated process.

For the themes aspect, I hardcoded .theme files to be high-contrast themes in order for it to allow complete color reskinning - additionally it allows the background mode changes to go from partially skinning to complete skinning. Feel free to reach out with questions. On a side note, I'll be releasing a new version of my app later this month with a better UI if you like its features.

Cheers.
-TL
User avatar
kunkel321
Posts: 1170
Joined: 30 Nov 2015, 21:19

Re: The easiest way to change the skin of the GUI - skinsharp

Post by kunkel321 » 30 Jan 2021, 20:17

THis is really cool!
Is the editor written in ahk too?
Also, is it possible to change the editor language to Eng?
ste(phen|ve) kunkel
tuzi
Posts: 223
Joined: 27 Apr 2016, 23:40

Re: The easiest way to change the skin of the GUI - skinsharp

Post by tuzi » 30 Jan 2021, 21:34

kunkel321 wrote:
30 Jan 2021, 20:17
THis is really cool!
Is the editor written in ahk too?
Also, is it possible to change the editor language to Eng?
The answer is no and no.
The skinsharp author last updated 7 years ago. But I have provided official website and some English documents in the demo.
Last edited by tuzi on 02 Feb 2021, 06:15, edited 1 time in total.
tuzi
Posts: 223
Joined: 27 Apr 2016, 23:40

Re: The easiest way to change the skin of the GUI - skinsharp

Post by tuzi » 30 Jan 2021, 21:47

Tigerlily wrote:
30 Jan 2021, 16:42
@tuzi

I've been able to partially reskin all windows system-wide using my Screen Dimmer app (its v2-only, but also compiled version is on GitHub in case you want to test out the skinning feature without installing AHK v2). If you use my app, look under background modes to change individual system elements partially, and use background themes to change system elements completely. My app only covers COLORS and not changing the windows to different styles like in the screenshots shown above.

Here is an excerpt of the background modes code in my app that might be useful to you:

Code: Select all

ChangeBackgroundMode(radio, *){

    static userBg := DllCall("user32\GetSysColor", "int", 1) ; Get user's desktop background color
    static backgroundModes := Map(
    "Normal"  , Map(0x000000, 0xC8C8C8, 1, userBg,   2, 0xD1B499, 3, 0xDBCDBF, 4, 0xF0F0F0, 5, 0xFFFFFF, 6, 0x646464, 7, 0x000000, 8, 0x000000, 9, 0x000000, 10, 0xB4B4B4, 11, 0xFCF7F4, 12, 0xABABAB, 13, 0xD77800, 14, 0xFFFFFF, 15, 0xF0F0F0, 16, 0xA0A0A0, 17, 0x6D6D6D, 18, 0x000000, 19, 0x000000, 20, 0xFFFFFF, 21, 0x696969, 22, 0xE3E3E3, 23, 0x000000, 24, 0xE1FFFF, 26, 0xCC6600, 27, 0xEAD1B9, 28, 0xF2E4D7, 29, 0xD77800, 30, 0xF0F0F0),
    "Morning" , Map(0x000000, 0xC7EDCC, 1, userBg,   2, 0xD1B499, 3, 0xC7EDCC, 4, 0xC7EDCC, 5, 0xC7EDCC, 6, 0x646464, 7, 0x000000, 8, 0x000000, 9, 0x000000, 10, 0xB4B4B4, 11, 0xFCF7F4, 12, 0xC7EDCC, 13, 0xD77800, 14, 0xFFFFFF, 15, 0xC7EDCC, 16, 0xA0A0A0, 17, 0x6D6D6D, 18, 0x000000, 19, 0x000000, 20, 0xFFFFFF, 21, 0x696969, 22, 0xE3E3E3, 23, 0x000000, 24, 0xE1FFFF, 26, 0xCC6600, 27, 0xEAD1B9, 28, 0xF2E4D7, 29, 0xD77800, 30, 0xF0F0F0),
    "Day"	  , Map(0x000000, 0xABABAB, 1, userBg,   2, 0xD1B499, 3, 0xABABAB, 4, 0xABABAB, 5, 0xABABAB, 6, 0x646464, 7, 0x000000, 8, 0x000000, 9, 0x000000, 10, 0xB4B4B4, 11, 0xFCF7F4, 12, 0xABABAB, 13, 0xD77800, 14, 0xFFFFFF, 15, 0xABABAB, 16, 0xA0A0A0, 17, 0x6D6D6D, 18, 0x000000, 19, 0x000000, 20, 0xFFFFFF, 21, 0x696969, 22, 0xE3E3E3, 23, 0x000000, 24, 0xE1FFFF, 26, 0xCC6600, 27, 0xEAD1B9, 28, 0xF2E4D7, 29, 0xD77800, 30, 0xF0F0F0),
    "Night"	  , Map(0x000000, 0x000000, 1, 0x000000, 2, 0x595757, 3, 0x595757, 4, 0x595757, 5, 0x595757, 6, 0x000000, 7, 0x000000, 8, 0xC6C8C5, 9, 0xC6C8C5, 10, 0x000000, 11, 0x000000, 12, 0x595757, 13, 0x5A5A57, 14, 0xC6C8C5, 15, 0x595757, 16, 0x000000, 17, 0x808080, 18, 0xC6C8C5, 19, 0xC6C8C5, 20, 0x5A5A57, 21, 0x000000, 22, 0x5A5A57, 23, 0xC6C8C5, 24, 0x000000, 26, 0xF0B000, 27, 0x000000, 28, 0x000000, 29, 0x5A5A57, 30, 0x000000),
    "Evening" , Map(0x000000, 0x000000, 1, 0x000000, 2, 0x222223, 3, 0x222223, 4, 0x222223, 5, 0x222223, 6, 0x000000, 7, 0x000000, 8, 0xC6C8C5, 9, 0xC6C8C5, 10, 0x000000, 11, 0x000000, 12, 0x222223, 13, 0x5A5A57, 14, 0xC6C8C5, 15, 0x222223, 16, 0x000000, 17, 0x808080, 18, 0xC6C8C5, 19, 0xC6C8C5, 20, 0x5A5A57, 21, 0x000000, 22, 0x5A5A57, 23, 0xC6C8C5, 24, 0x000000, 26, 0xF0B000, 27, 0x000000, 28, 0x000000, 29, 0x5A5A57, 30, 0x000000),
    "Midnight", Map(0x000000, 0x000000, 1, 0x000000, 2, 0xC6C8C5, 3, 0x000000, 4, 0x000000, 5, 0x000000, 6, 0x000000, 7, 0x000000, 8, 0xC6C8C5, 9, 0xC6C8C5, 10, 0x000000, 11, 0x000000, 12, 0x000000, 13, 0x5A5A57, 14, 0xC6C8C5, 15, 0x000000, 16, 0x000000, 17, 0x808080, 18, 0xC6C8C5, 19, 0xC6C8C5, 20, 0x000000, 21, 0x000000, 22, 0x000000, 23, 0xC6C8C5, 24, 0x000000, 26, 0xF0B000, 27, 0x000000, 28, 0x000000, 29, 0x5A5A57, 30, 0x000000),
    "Twilight", Map(0x000000, 0x000000, 1, 0x000000, 2, 0x8C3230, 3, 0x000000, 4, 0x000000, 5, 0x000000, 6, 0x000000, 7, 0x000000, 8, 0x8C3230, 9, 0xC6C8C5, 10, 0x000000, 11, 0x000000, 12, 0x000000, 13, 0x080816, 14, 0xC04B48, 15, 0x000000, 16, 0x000000, 17, 0x808080, 18, 0x8C3230, 19, 0x8C3230, 20, 0x000000, 21, 0x000000, 22, 0x000000, 23, 0x8C3230, 24, 0x000000, 26, 0xC04B48, 27, 0x000000, 28, 0x000000, 29, 0x5A5A57, 30, 0x000000))

    for displayElement, color in backgroundModes[radio.Name]
        try DllCall("user32\SetSysColors", "Int", 1, "IntP", displayElement, "UIntP", color)
}
the app uses a radio control to activate each mode, but i'm sure you can take what you need.

As you may notice, you dont require any dependencies (DLLs or 3rd party software) for this - just support for the WIN APIs. There are ways to reskin like how you are showing above without downloading other DLLs or 3rd party software, but I wasn't able to figure it out since it appeared to be a very complicated process.

For the themes aspect, I hardcoded .theme files to be high-contrast themes in order for it to allow complete color reskinning - additionally it allows the background mode changes to go from partially skinning to complete skinning. Feel free to reach out with questions. On a side note, I'll be releasing a new version of my app later this month with a better UI if you like its features.

Cheers.
Thank you for providing so much information. I tried your app, but perhaps because my system is a long supported version of Win10, most features are not visible changes in my case.

But the ability to adjust RGB & brightness directly works great! :thumbup: :thumbup:
tuzi
Posts: 223
Joined: 27 Apr 2016, 23:40

Re: The easiest way to change the skin of the GUI - skinsharp

Post by tuzi » 02 Feb 2021, 07:39

lblb wrote:
02 Feb 2021, 01:55
You might want to link to:
https://www.autohotkey.com/boards/viewtopic.php?f=6&t=5841&hilit=gui+skin
Thanks, I have now created a demo based on the USkin, but it still doesn't support 64-bit. :thumbup:
User avatar
JnLlnd
Posts: 490
Joined: 29 Sep 2013, 21:29
Location: Montreal, Quebec, Canada
Contact:

Re: The easiest way to change the skin of the GUI - skinsharp

Post by JnLlnd » 19 Oct 2022, 11:22

+1 Still looking for a 64-bit skin tool...
:thumbup: Author of freeware Quick Access Popup, the powerful Windows folders, apps and documents launcher!
:P Now working on Quick Clipboard Editor
:ugeek: The Automator's Courses on AutoHotkey
Post Reply

Return to “Scripts and Functions (v1)”