GUI Skinning Methods
Re: GUI skinning using USkin.dll and .msstyles
@joedf / thank you so much!
AutoHotkey & AutoHotkey_H v1.1.22.07
Re: GUI Skinning Methods
2015/02/03 + I added SkinSharp.dll method and modified the article
AutoHotkey & AutoHotkey_H v1.1.22.07
Re: GUI Skinning Methods
Very cool find! Do you have the source code for this other dll?
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
Re: GUI Skinning Methods
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:
Can you reproduce this issue? If yes, can anything be done about this?
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
Re: GUI Skinning Methods
@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')
@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
Re: GUI Skinning Methods
@Soft ahhh... ok
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
Re: GUI Skinning Methods
@joedf / Here is SkinSharp API C++ file. Its written in Chinese but you probably can understand the API syntax!
http://knowledgeisfree.tistory.com/atta ... 257682.zip
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
Re: GUI Skinning Methods
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.
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.
Re: GUI Skinning Methods
@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
Re: GUI Skinning Methods
The second method maybe has bug,click button cannt change his skin sometimes.
Re: GUI Skinning Methods
@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
Re: GUI Skinning Methods
aha,looks ok!thanks.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 ;========================================================
Could U write some ways to support .Skn skin file?
Re: GUI Skinning Methods
@huyaowen / I dont know about .skn file. Where can I find .skn file?
with dll and c++ source maybe I can help you
with dll and c++ source maybe I can help you
AutoHotkey & AutoHotkey_H v1.1.22.07
Re: GUI Skinning Methods
.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?
FSViewer.exe is an example.but I don't know much.
Can you dig dig and dig it?
Re: GUI Skinning Methods
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 .
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).
Some .she skins (49 files)
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 .
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.7zSome .she skins (49 files)
Last edited by tmplinshi on 22 Jan 2017, 13:50, edited 1 time in total.
Re: GUI Skinning Methods
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:
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?
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")
}
}
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.
Re: GUI Skinning Methods
Same technique, but for SkinSharp:
put files in C:\Program Files\Autohotkey\Lib\SkinSharp, include with #include *i <SkinSharp>
Unlike USkin, SkinSharp does NOT break ScrollGui
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")
Unlike USkin, SkinSharp does NOT break ScrollGui
- tomoe_uehara
- Posts: 213
- Joined: 05 Oct 2013, 12:37
- Contact:
Re: GUI Skinning Methods
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.
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
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
Re: GUI Skinning Methods
What does "mhgd" mean?evilC wrote:Same technique, but for SkinSharp:put files in C:\Program Files\Autohotkey\Lib\SkinSharp, include with #include *i <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")
Unlike USkin, SkinSharp does NOT break ScrollGui
Return to “Scripts and Functions (v1)”
Who is online
Users browsing this forum: No registered users and 74 guests