GUI Skinning Methods

Post your working scripts, libraries and tools
User avatar
Soft
Posts: 174
Joined: 07 Jan 2015, 13:18
GitHub: visionary1
Location: Seoul
Contact:

Re: GUI skinning using USkin.dll and .msstyles

28 Jan 2015, 10:26

@joedf / thank you so much!
AutoHotkey & AutoHotkey_H v1.1.22.07
User avatar
Soft
Posts: 174
Joined: 07 Jan 2015, 13:18
GitHub: visionary1
Location: Seoul
Contact:

Re: GUI Skinning Methods

02 Feb 2015, 11:56

2015/02/03 + I added SkinSharp.dll method and modified the article
AutoHotkey & AutoHotkey_H v1.1.22.07
User avatar
joedf
Posts: 7356
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada
Contact:

Re: GUI Skinning Methods

02 Feb 2015, 12:28

Very cool find! Do you have the source code for this other dll?
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500 @ 4.00 GHz, 2x8GB G.Skill RipJaws V - DDR4 3280 MHz, NVIDIA GTX 1060 6GB | [About Me] | [ASPDM - StdLib Distribution]
[Populate the AHK MiniCity!] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library] | [About the AHK Foundation]
lblb
Posts: 129
Joined: 30 Sep 2013, 11:31

Re: GUI Skinning Methods

02 Feb 2015, 13:22

Hi Soft,

This is nice! Thanks for your work on this.

I'm encountering a small issue though. On my system (Win 7 64 bit, ahk 1.1.16.05 ANSI 32), if I add for example a FileSelectFile command to the button in your example, the address bar of the FileSelectFile window doesn't show correctly (there is a black bar surrounding it). To reproduce, add "gSelectFile" as a g-label for the Button on your Gui, then add somewhere:

Code: Select all

SelectFile:
FileSelectFile, OutputVar
Msgbox, %OutputVar%
Return
Can you reproduce this issue? If yes, can anything be done about this?
User avatar
Soft
Posts: 174
Joined: 07 Jan 2015, 13:18
GitHub: visionary1
Location: Seoul
Contact:

Re: GUI Skinning Methods

02 Feb 2015, 23:38

@joedf / I saw some parts of source but couldnt find the file. and the article was written in chinese
@lblb / I just tested FileSelectFile window, and it was fine for me

tested script (used 'Ayofe.msstyles')

Code: Select all

DllCall("LoadLibrary", str, A_ScriptDir "\USkin.dll")
DllCall("USkin\USkinInit", Int, 0, Int, 0, AStr ,A_ScriptDir "\Ayofe.msstyles")

FileSelectFile, OutputVar
Msgbox, %OutputVar%
Return
AutoHotkey & AutoHotkey_H v1.1.22.07
User avatar
joedf
Posts: 7356
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada
Contact:

Re: GUI Skinning Methods

02 Feb 2015, 23:45

@Soft ahhh... ok :P
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500 @ 4.00 GHz, 2x8GB G.Skill RipJaws V - DDR4 3280 MHz, NVIDIA GTX 1060 6GB | [About Me] | [ASPDM - StdLib Distribution]
[Populate the AHK MiniCity!] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library] | [About the AHK Foundation]
User avatar
Soft
Posts: 174
Joined: 07 Jan 2015, 13:18
GitHub: visionary1
Location: Seoul
Contact:

Re: GUI Skinning Methods

02 Feb 2015, 23:56

@joedf / Here is SkinSharp API C++ file. Its written in Chinese but you probably can understand the API syntax!
Spoiler
.she theme file editor (Chinese again... can anyone speak chinese? plz translate this)
http://knowledgeisfree.tistory.com/atta ... 257682.zip
AutoHotkey & AutoHotkey_H v1.1.22.07
lblb
Posts: 129
Joined: 30 Sep 2013, 11:31

Re: GUI Skinning Methods

03 Feb 2015, 00:14

Hi Soft,

Thanks for the quick reply.

Did you have Windows Aero turned on during your test? It seems like the bug shows up only when Aero is on. See the attached animated gif. You can see that the address bar has an unwanted black box around it. Also, when I resize the FileSelectFile, you can see that there are all kinds of artifacts that show up. While resizing, a black contour around the FileSelectFile window sometimes shows up. Also, you can see that on the right edge of the FileSelectFile window there are some dark marks that appear from time to time.

Thanks in advance for any input you may have.
Attachments
Skins_FileSelectFile.gif
User avatar
Soft
Posts: 174
Joined: 07 Jan 2015, 13:18
GitHub: visionary1
Location: Seoul
Contact:

Re: GUI Skinning Methods

03 Feb 2015, 00:21

@lblb / oh same for me, the black box appears while resizing. I will figure it out. Thanks for the report
AutoHotkey & AutoHotkey_H v1.1.22.07
User avatar
huyaowen
Posts: 100
Joined: 28 Jul 2014, 01:15

Re: GUI Skinning Methods

03 Feb 2015, 01:55

The second method maybe has bug,click button cannt change his skin sometimes.
Attachments
xsss.gif
User avatar
Soft
Posts: 174
Joined: 07 Jan 2015, 13:18
GitHub: visionary1
Location: Seoul
Contact:

Re: GUI Skinning Methods

03 Feb 2015, 03:50

@hyaowen / try this script

Code: Select all

; Cool preview gui script written by 'garry'

#NoEnv
#SingleInstance force

setworkingdir,%a_scriptdir%
Gui,1:default
f2=%a_scriptdir%\GuiStyle_Soft.ahk
RSSINI=%A_scriptdir%\RSSINI.ini
Loop, %a_scriptdir%\*.she,,1
  e .= A_LoopFileFullPath . "`r`n"
n=0
z=0
Gui,1:Font, CDefault, FixedSys
Gui,1:Color,Black

;- use button Next
;  or
;- use gosub next2 which displays for 5 seconds

Gui,1:add,edit    ,x10 y10 h25 w120 vE1 readonly cYellow,
Gui,1:add,button  ,x10 y50 h25 w100 gNextx,NEXT>
Gui,1:show, x200 y400 h90 w140
gosub,create2
;gosub,next2
return


nextx:
Gui,1:submit,nohide
n++
Loop,parse,e,`n,`r
 {
 z++
 y:=A_LoopField
 if (y="")
    {
    n:=(n-1)
    GuiControl,1:,e1,%n%-styles END
    n=0
    return
    }
 if (n=z)
    {
    z=0
    break
    }
 }
IniWrite,%y%   , %rssini% ,A1   , KEY1
SplitPath,y,name, dir, ext, name_no_ext, drive
run,%f2%
GuiControl,1:,e1, %name_no_ext%
return

;--------------
next2:
Gui,1:submit,nohide
Loop,parse,e,`n,`r
 {
 y:=A_LoopField
 if (y="")
   continue
 ;msgbox, 262208, ,%y% ,
 IniWrite,%y%   , %rssini% ,A1   , KEY1
 SplitPath,y,name, dir, ext, name_no_ext, drive
 run,%f2%
 GuiControl,1:,e1, %name_no_ext%
 sleep,5000
 }
return

Guiclose:
exitapp
;---------------------------------------
create2:
Gui,1:submit,nohide
e4x=
(
#NoEnv
#SingleInstance force
pr:= a_scriptdir . "\SkinH_EL.dll"
IniRead, aa1, %rssini% , A1 , Key1
aa1:= aa1
SkinForm(Apply,pr,aa1)

OnExit, GetOut
Gui,2: +LastFound +hwndMainF
Gui,2: add, button,xm w100 h40, Button
Gui,2: add, edit, xm y+20 w100 h20, Edit
Gui,2: add, listbox,xm y+20, ListBox
Gui,2: add, checkbox,xm y+20, checkbox
Gui,2: add, DDL, xm y+20, DropDownList
Gui,2: Show, w200 , GUI_Style
return
;-----------------------------------

GetOut:
2GuiClose:
Gui,2: Hide
SkinForm(0)
ExitApp
;-----------------------------------

SkinForm(Param1 = "Apply", DLL = "", SkinName = ""){
    if(Param1 = Apply){
        DllCall("LoadLibrary", str, DLL)
        DllCall(DLL . "\SkinH_AttachEx", AStr,SkinName, Str,"mhgd")
    }else if(Param1 = 0){
      DllCall(DLL . "\SkinH_Detach", Int, MainF)
        }
}
)
ifnotexist,%f2%
  fileappend,%e4x%,%f2%
e4x=
return
;========================================================


AutoHotkey & AutoHotkey_H v1.1.22.07
User avatar
huyaowen
Posts: 100
Joined: 28 Jul 2014, 01:15

Re: GUI Skinning Methods

04 Feb 2015, 02:31

Soft wrote:@hyaowen / try this script

Code: Select all

; Cool preview gui script written by 'garry'

#NoEnv
#SingleInstance force

setworkingdir,%a_scriptdir%
Gui,1:default
f2=%a_scriptdir%\GuiStyle_Soft.ahk
RSSINI=%A_scriptdir%\RSSINI.ini
Loop, %a_scriptdir%\*.she,,1
  e .= A_LoopFileFullPath . "`r`n"
n=0
z=0
Gui,1:Font, CDefault, FixedSys
Gui,1:Color,Black

;- use button Next
;  or
;- use gosub next2 which displays for 5 seconds

Gui,1:add,edit    ,x10 y10 h25 w120 vE1 readonly cYellow,
Gui,1:add,button  ,x10 y50 h25 w100 gNextx,NEXT>
Gui,1:show, x200 y400 h90 w140
gosub,create2
;gosub,next2
return


nextx:
Gui,1:submit,nohide
n++
Loop,parse,e,`n,`r
 {
 z++
 y:=A_LoopField
 if (y="")
    {
    n:=(n-1)
    GuiControl,1:,e1,%n%-styles END
    n=0
    return
    }
 if (n=z)
    {
    z=0
    break
    }
 }
IniWrite,%y%   , %rssini% ,A1   , KEY1
SplitPath,y,name, dir, ext, name_no_ext, drive
run,%f2%
GuiControl,1:,e1, %name_no_ext%
return

;--------------
next2:
Gui,1:submit,nohide
Loop,parse,e,`n,`r
 {
 y:=A_LoopField
 if (y="")
   continue
 ;msgbox, 262208, ,%y% ,
 IniWrite,%y%   , %rssini% ,A1   , KEY1
 SplitPath,y,name, dir, ext, name_no_ext, drive
 run,%f2%
 GuiControl,1:,e1, %name_no_ext%
 sleep,5000
 }
return

Guiclose:
exitapp
;---------------------------------------
create2:
Gui,1:submit,nohide
e4x=
(
#NoEnv
#SingleInstance force
pr:= a_scriptdir . "\SkinH_EL.dll"
IniRead, aa1, %rssini% , A1 , Key1
aa1:= aa1
SkinForm(Apply,pr,aa1)

OnExit, GetOut
Gui,2: +LastFound +hwndMainF
Gui,2: add, button,xm w100 h40, Button
Gui,2: add, edit, xm y+20 w100 h20, Edit
Gui,2: add, listbox,xm y+20, ListBox
Gui,2: add, checkbox,xm y+20, checkbox
Gui,2: add, DDL, xm y+20, DropDownList
Gui,2: Show, w200 , GUI_Style
return
;-----------------------------------

GetOut:
2GuiClose:
Gui,2: Hide
SkinForm(0)
ExitApp
;-----------------------------------

SkinForm(Param1 = "Apply", DLL = "", SkinName = ""){
    if(Param1 = Apply){
        DllCall("LoadLibrary", str, DLL)
        DllCall(DLL . "\SkinH_AttachEx", AStr,SkinName, Str,"mhgd")
    }else if(Param1 = 0){
      DllCall(DLL . "\SkinH_Detach", Int, MainF)
        }
}
)
ifnotexist,%f2%
  fileappend,%e4x%,%f2%
e4x=
return
;========================================================


aha,looks ok!thanks.
Could U write some ways to support .Skn skin file?
User avatar
Soft
Posts: 174
Joined: 07 Jan 2015, 13:18
GitHub: visionary1
Location: Seoul
Contact:

Re: GUI Skinning Methods

04 Feb 2015, 02:58

@huyaowen / I dont know about .skn file. Where can I find .skn file?
with dll and c++ source maybe I can help you
AutoHotkey & AutoHotkey_H v1.1.22.07
User avatar
huyaowen
Posts: 100
Joined: 28 Jul 2014, 01:15

Re: GUI Skinning Methods

06 Feb 2015, 00:55

.skn and .ssk can also used for changing skin.
FSViewer.exe is an example.but I don't know much.
Can you dig dig and dig it?
tmplinshi
Posts: 1549
Joined: 01 Oct 2013, 14:57

Re: GUI Skinning Methods

12 Feb 2015, 17:49

SkinH is a shareware. Unregistered version will have a small T-shirt icon in the title bar and menu.

There is a SHEditor.exe in the official downloads, which can used to create or edit the .she skin file. It also can convert .msstyles file to .she file :P .

SkinH supports loading .she skin from memory, then by using HotkeyIt's _MemoryLibrary we can generate a standalone exe (contains dll and .she in it).
SkinH_AttachRes Sample.ahk
SkinH_AttachRes Sample.7z
Some .she skins (49 files)
Last edited by tmplinshi on 22 Jan 2017, 13:50, edited 1 time in total.
User avatar
evilC
Posts: 4742
Joined: 27 Feb 2014, 12:30

Re: GUI Skinning Methods

13 Feb 2015, 15:27

A little technique I use to add USkin to any UI:

In your C:\Program Files\Autohotkey\Lib folder, Make a Uskin folder and place inside it your Uskin.dll and msstyles files.
In the main lib folder, make a file USkin.ahk, paste in the following code and alter to your needs:

Code: Select all

; set path to files here
path := "C:\Program Files\AutoHotkey\Lib\Uskin\"
; Set style
Style := path "Milikymac.msstyles"
; Do not edit below here
dll := path "USkin.dll"
SkinForm(Apply, dll, Style)
; normal skinform func
SkinForm(Param1 = "Apply", DLL = "", SkinName = ""){
	if(Param1 = Apply){
		DllCall("LoadLibrary", str, DLL)
		DllCall(DLL . "\USkinInit", Int,0, Int,0, AStr, SkinName)
	}else if(Param1 = 0){
		DllCall(DLL . "\USkinExit")
		}
}
Add the code #include *i <USkin> to the start of any script you wish to try USkin with.

The *i means it will skip if file not found, so if you give someone else the script and forget to take the include out, no biggie, it will ignore the include and they will just get normal ahk gui.
This means you can use Uskin in GitHub repos without having it as a dependency.

By the way, USkin does not seem to play well with scrollable GUIs. any ideas on that?
Last edited by evilC on 13 Feb 2015, 15:56, edited 1 time in total.
User avatar
evilC
Posts: 4742
Joined: 27 Feb 2014, 12:30

Re: GUI Skinning Methods

13 Feb 2015, 15:56

Same technique, but for SkinSharp:

Code: Select all

; set path to files here
path := "C:\Program Files\AutoHotkey\Lib\SkinSharp\"
; Set style
Style := path "aero.she"
; Do not edit below here
dll := path "SkinH_EL.dll"
DllCall("LoadLibrary", str, dll) ;Opens the DLL
DllCall(dll "\SkinH_AttachEx", AStr, Style, Str,"mhgd")
put files in C:\Program Files\Autohotkey\Lib\SkinSharp, include with #include *i <SkinSharp>

Unlike USkin, SkinSharp does NOT break ScrollGui :thumbup:
User avatar
tomoe_uehara
Posts: 210
Joined: 05 Oct 2013, 12:37
Contact:

Re: GUI Skinning Methods

19 Feb 2015, 01:27

I suggest you to make a mirror for the download link, because in the past we had sooo many broken links when autohotkey.net is down.
Image

I don't say that your personal blog will be down, but nobody knows the future, so I suggest you to make a mirror to prevent that thing from happening again

Image
Guest

Re: GUI Skinning Methods

19 Feb 2015, 09:06

evilC wrote:Same technique, but for SkinSharp:

Code: Select all

; set path to files here
path := "C:\Program Files\AutoHotkey\Lib\SkinSharp\"
; Set style
Style := path "aero.she"
; Do not edit below here
dll := path "SkinH_EL.dll"
DllCall("LoadLibrary", str, dll) ;Opens the DLL
DllCall(dll "\SkinH_AttachEx", AStr, Style, Str,"mhgd")
put files in C:\Program Files\Autohotkey\Lib\SkinSharp, include with #include *i <SkinSharp>

Unlike USkin, SkinSharp does NOT break ScrollGui :thumbup:
What does "mhgd" mean?
User avatar
Soft
Posts: 174
Joined: 07 Jan 2015, 13:18
GitHub: visionary1
Location: Seoul
Contact:

Re: GUI Skinning Methods

19 Feb 2015, 09:36

skinsharp.dll's password
AutoHotkey & AutoHotkey_H v1.1.22.07

Return to “Scripts and Functions”

Who is online

Users browsing this forum: sikongshan and 51 guests