Jump to content

_UskinLibrary.au3 (UDF) - Skin with DLL free (no ads) and fully functional!


Recommended Posts

Posted

This is a really nice addition to my GUI articles. One point though for anyone that might want to use this really nice skinning UDF, it's a 32 bit DLL so if you're running it on x64, you need to add this line: #AutoIt3Wrapper_UseX64=n at the top of the script so that it is compiled/run using the 32 bit AutoIt3 executable.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Posted

Some skin will have blacklines, to remove that line there exist a stupid method. :)

Yeah. There... there...

; First Method
#include <GuiConstantsEx.au3>
#include <AVIConstants.au3>
#include <TreeViewConstants.au3>
#include "_UskinLibrary.au3"
;--
_Uskin_LoadDLL()
_USkin_Init('C:\WINDOWS\Resources\Themes\Panther\Panther.msstyles')
$form = GuiCreate("First Method", 400, 400)
RemoveStupidBlaklines($form)
GuiSetState()
While GuiGetMsg() <> $GUI_EVENT_CLOSE
WEnd
Func RemoveStupidBlaklines($hwnd)
If Not IsHWnd($hwnd) Then Return
Local $pos=WinGetPos($hwnd,'')
If Not IsArray($pos) Then Return
Return WinMove($hwnd,'',$pos[0],$pos[1])
EndFunc
; Second Method
#Include <WinAPI.au3>
#include <GuiConstantsEx.au3>
#include <AVIConstants.au3>
#include <TreeViewConstants.au3>
#include "_UskinLibrary.au3"
;--
_Uskin_LoadDLL()
_USkin_Init('C:\WINDOWS\Resources\Themes\Panther\Panther.msstyles')
$form = GuiCreate("Second Method", 400, 400)
$button = GUICtrlCreateButton('Control',135,130,120,24)
RemoveStupidBlaklinesCtrl($button)
GuiSetState()
While GuiGetMsg() <> $GUI_EVENT_CLOSE
WEnd
Func RemoveStupidBlaklinesCtrl($ctrl)
Local $hwnd=_WinAPI_GetParent(GUICtrlGetHandle($ctrl))
If Not IsHWnd($hwnd) Then Return
Local $pos=WinGetPos($hwnd,'')
ConsoleWrite($pos)
If Not IsArray($pos) Then Return
Return WinMove($hwnd,'',$pos[0],$pos[1])
EndFunc

# Button. Progressbar - Graphical AutoIt3 Control (UDF) # GTK on AutoIt3 - GTK+ Framework | Widgets

cig computer instruction graphics  http://code.hstn.me

Posted

Ha.. ha... you probably will call function

to remove blacklines every guicreate().. :)

Just register windows message, like this.

; Third Method
#include <GuiConstantsEx.au3>
#include <AVIConstants.au3>
#include <TreeViewConstants.au3>
#include "_UskinLibrary.au3"
;--
_Uskin_LoadDLL()
_USkin_Init('C:\WINDOWS\Resources\Themes\Panther\Panther.msstyles')
GUIRegisterMsg(0x0001, "WM_CREATE")
GuiCreate("Third Method - First Window", 400, 400)
GuiSetState()
GuiCreate("Second Window", 275, 275)
GuiSetState()
GuiCreate("Third Window", 150, 150)
GuiSetState()
While GuiGetMsg() <> $GUI_EVENT_CLOSE
WEnd
Func WM_CREATE($hWnd, $iMsg, $wParam, $lParam)
RemoveStupidBlacklines($hWnd)
EndFunc
Func RemoveStupidBlacklines($hwnd)
If Not IsHWnd($hwnd) Then Return
Local $pos=WinGetPos($hwnd,'')
If Not IsArray($pos) Then Return
Return WinMove($hwnd,'',$pos[0],$pos[1])
EndFunc

# Button. Progressbar - Graphical AutoIt3 Control (UDF) # GTK on AutoIt3 - GTK+ Framework | Widgets

cig computer instruction graphics  http://code.hstn.me

Posted

I have a few visual issues. I don't know if you have them too or not.

1: on some computers, the window streches down to outside the screen. To fix that i always put a winmove with the coordinates and scale requiered after applying the uskin.

2: sometimes i can't see the minimize, maximize and close buttons. They appear after a while, usually after refreshing the gui or creating a new control.

3: if you try _guictrltab_setitemstate example , from the autoit help file, the $TCIS_HIGHLIGHTED Doesn't set the tab as highlighted. I haven't found a solution to that, and i consider that as a limitation of uskin.

Those three issues are not really bothering, but if someone have any idea how to fix them i would really appreciate any help.

By the way, i use windows 7 x64 sp1. With aero on or off, i get the same visual issue. Note that i also tried on win xp x64 and i get same problems.

Best regards

Jo

Posted

Haha my bad I missed it. Thanks, I will take a look and see whether it says anything about applying it to just 1 window, and worst case contact the developers and ask them.

Posted

I have thrown together a very short demo for this UDF that displays a GUI with a small collection of controls added that will cycle through the available skin files to show what each one looks like. I found that I was manually changing the skin names to see what each looked like and decided that was silly considering that AutoIt can do it for me. It will display the filename used for the skin in a label on the GUI so you know which one you're looking at. Try it with whatever controls you're interested in displaying, because some of these skins change the controls differently depending on what's being used. Also, try hovering or selecting various controls as it's running to see how that will look as well.

#AutoIt3Wrapper_UseX64=n
#include <GUIConstantsEx.au3>
#include "_UskinLibrary.au3"
#include <File.au3>
;--
$aFileList = _FileListToArray(@ScriptDir & "Skins", "*.msstyles", 1)
_Uskin_LoadDLL()
_USkin_Init(@ScriptDir & "Skins" & $aFileList[1], "BrewManNH", "1234"); <-- Put your skin here...
Opt("GUIOnEventMode", 1)
Global $Form1 = GUICreate("Skinning Demo GUI", 650, 438, 192, 124)
GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit", $Form1)
Global $ListView1 = GUICtrlCreateListView("Test 1|Test 2|Test 3", 30, 27, 337, 219)
GUICtrlSetBkColor($ListView1, 0x00FF00) ; set back ground of ListView to Green
GUICtrlCreateButton(" Does nothing ", 400, 50)
GUICtrlCreateCheckbox("Checkbox 1", 400, 90)
GUICtrlSetState(-1, $GUI_CHECKED)
GUICtrlCreateInput("Sample Input Text", 400, 130, 200)
$Label = GUICtrlCreateLabel($aFileList[1], 30, 300, 400, 100)
GUISetState(@SW_SHOW)
For $I = 1 To 20
    GUICtrlCreateListViewItem("Column 1 Row " & $I & "|Column 2 Row " & $I & "|Column 3 Row " & $I, $ListView1)
Next
For $I = 2 To $aFileList[0]
    Sleep(3000)
    _USkin_LoadSkin(@ScriptDir & "Skins" & $aFileList[$I]); <-- loads new skin file and applies it to the GUI...
    GUICtrlSetData($Label, $aFileList[$I] & @CRLF & " #" & $I & " of " & $aFileList[0] & " available skins")
Next
While 1
    Sleep(100)
WEnd

Func _Exit()
    Exit
EndFunc   ;==>_Exit

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Posted

Hi!

I had already done something similar and yet would post, here's a preview:

; *** Start added by AutoIt3Wrapper ***
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <APIConstants.au3>
;#include <Array.au3>
; *** End added by AutoIt3Wrapper ***

#AutoIt3Wrapper_Add_Constants=n

#include <File.au3>
#include <WinAPIEx.au3>
#include "_UskinLibrary.au3"

Global $iEZS_LTHEMEEVENT = 1, $hPreview
Global Const $sINI = @TempDir & 'Skin.ini'

_LoadSkin()

Func _LoadSkin($sSkinsFolder = "")
        Local $aFileList, $hWinhandle, $iButton1, $iButton2, $iButton3, $iMsg
        Local $iCoordMode, $iEventMode, $sColuns, $iLVCtrlID, $iLVICtrlID
        Local $sListItem, $sDatFile, $sCol1, $sCol2, $sCol3, $sCol4
        Local $hFile, $hInstance, $hResource, $hData, $pData, $tData

        If $sSkinsFolder = "" Then $sSkinsFolder = @ScriptDir & "Skins"

        While 1
                $aFileList = _FileListToArray($sSkinsFolder, "*.msstyles", 1)
                If @error Then
                        $sSkinsFolder = FileSelectFolder("Selecione a pasta com skins.", "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}", 2, @ScriptDir)
                        If @error Then
                                Return 0
                        EndIf
                        ContinueLoop
                EndIf
                ExitLoop
        WEnd
        _USkin_Init( $sSkinsFolder & "" & $aFileList[1])
        $iCoordMode = Opt("GUICoordMode", 1)
        $iEventMode = Opt("GUIOnEventMode", 0)
        $hWinhandle = GUICreate("Skins", 706, 405, -1, -1, BitOR($WS_CAPTION, $WS_SYSMENU), BitOR($WS_EX_APPWINDOW, $WS_EX_TOPMOST));$WS_EX_TOOLWINDOW
        GUISwitch($hWinhandle)

        $sColuns = "Nome" & "                     | " & _
                        "Autor" & "                             | " & _
                        "Versão" & "    | " & "Link" & "                               | " & "Caminho" & "                               "
        $iLVCtrlID = GUICtrlCreateListView($sColuns, 14, 30, 472, 308, BitOR(0x0001, 0x0004, 0x0008, 0x8000, 0x0010, 0x00100000, 0x00200000), BitOR(0x00000200, 0x00000020))
        GUICtrlCreateLabel("Label1" & ":", 500, 27, 191, 20, 0x0B + 0x08000000)
        ;GUICtrlSetColor(-1, $vDAT_COLOR_FONTFRONT)
        GUICtrlCreateLabel("Label2" & ":", 15, 10, 100, 17, 0x0B + 0x08000000)
        ;GUICtrlSetColor(-1, $vDAT_COLOR_FONTFRONT)
        GUICtrlCreateButton("", 14, 354, 677, 2, 0x08000000, 0x00020000)
        $iButton1 = GUICtrlCreateButton("OK", 234, 368, 75, 21)
        $iButton2 = GUICtrlCreateButton("Cancelar", 396, 368, 75, 21)
        $iButton3 = GUICtrlCreateButton("Verificar mais temas na web...", 500, 260, 190, 24)
        GUICtrlSetState($iButton1, 512)

        For $i = 1 To $aFileList[0]
                $sDatFile = $sSkinsFolder & "" & $aFileList[$i]
                ;
                ;----> Load .msstyles to memory
                $hInstance = _WinAPI_LoadLibraryEx($sDatFile, $LOAD_LIBRARY_AS_DATAFILE)
                ; Load INI file resource...
                $hResource = _WinAPI_FindResource($hInstance, 'TEXTFILE', "THEMES_INI")
                $iSize = _WinAPI_SizeOfResource($hInstance, $hResource)
                $hData = _WinAPI_LoadResource($hInstance, $hResource)
                $pData = _WinAPI_LockResource($hData)
                ;--
                ; Save resource to .ini file
                $hFile = FileOpen($sINI, 2 + 16)
                $tData = DllStructCreate('byte[' & $iSize & ']', $pData)
                FileWrite($hFile, DllStructGetData($tData, 1))
                FileClose($hFile)
                _WinAPI_FreeLibrary($hInstance)
                ;<---- Unload .msstyles from memory
                ;
                $sCol1 = IniRead($sINI, "Documentation", "DisplayName", "")
                $sCol2 = IniRead($sINI, 'Documentation', 'Author', '')
                $sCol3 = IniRead($sINI, 'Documentation', 'Version', '')
                $sCol4 = IniRead($sINI, 'Documentation', 'URL', '')
                $sCol5 = $sDatFile
                $iLVICtrlID = GUICtrlCreateListViewItem($sCol1 & "|" & $sCol2 & "|" & $sCol3 & "|" & $sCol4 & "|" & $sCol5, $iLVCtrlID)
                ;If $sDatFile = $sEZS_SKINPATH Then GUICtrlSetState($iLVICtrlID, 384)
        Next

        GUISetState(@SW_SHOW, $hWinhandle)
        $hPreview = GUICreate("", 190, 140, 498, 62, BitOR($WS_CAPTION, $WS_SYSMENU, $WS_CHILD), -1, $hWinhandle)
        GUISetState(@SW_SHOWNOACTIVATE, $hPreview)

        GUIRegisterMsg($WM_SYSCOMMAND, "On_WM_SYSCOMMAND")
        $iEZS_LTHEMEEVENT = 0
        GUIRegisterMsg(0x004E, "__EzSkinThemeEvents"); $WM_NOTIFY

        While 1
                $iMsg = GUIGetMsg()
                ; These lines implement the reading of the key Enter and they activate the button 1
                If $iMsg = $iButton1 Then
                        $sListItem = GUICtrlRead(GUICtrlRead($iLVCtrlID))
                        If $sListItem <> "" Then
                                ;$sDatFile = StringSplit($sListItem, "|")
                                ;$sEZS_SKINPATH = $sDatFile[4]
                                ExitLoop
                        EndIf
                ElseIf $iMsg = $iButton2 Or $iMsg = -3 Then ; $GUI_EVENT_CLOSE
                        Opt("GUIOnEventMode", $iEventMode)
                        Opt("GUICoordMode", $iCoordMode)
                        GUIDelete($hWinhandle)
                        GUIRegisterMsg(0x004E, "")
                        Return 0
                ElseIf $iMsg = $iButton3 Then
                        ;
                EndIf
        WEnd
        GUIDelete($hWinhandle)

        ;_EzSkinMsgBox(262208, __EzSkinTranslateMsg('14'), __EzSkinTranslateMsg('64'), -1, "", -1, -1, True)
        Exit
EndFunc   ;==>_LoadSkin

Func On_WM_SYSCOMMAND($hWnd, $Msg, $wParam, $lParam)
        Switch $hWnd
                Case $hPreview
                        If BitAND($wParam, 0xFFF0) = 0xF010 Or BitAND($wParam, 0xFFF0) = 0xF060 Then Return False
        EndSwitch

        Return $GUI_RUNDEFMSG
EndFunc   ;==>On_WM_SYSCOMMAND

; #INTERNAL_USE_ONLY# ===========================================================================================================
; Name...........: __EzSkinThemeEvents
; Description ...: WM_NOTIFY event for _EzSkinLoadTheme().
; Syntax.........: __EzSkinThemeEvents( WndGUI, MsgID, WParam, LParam )
; Author ........: jscript
; Example .......; __EzSkinThemeEvents()
; ===============================================================================================================================
Func __EzSkinThemeEvents($hWndGUI, $MsgID, $wParam, $lParam)
        Local $iCtrlID = _WinAPI_LoWord($wParam), $nResult = GUICtrlRead($iCtrlID)

        If $nResult <> $iEZS_LTHEMEEVENT And $nResult <> 0 Then
                Local $sListItem = GUICtrlRead($nResult), $aDatFile = StringSplit($sListItem, "|")
                If @error Then Return 'GUI_RUNDEFMSG'
                _USkin_LoadSkin($aDatFile[5])
                $iEZS_LTHEMEEVENT = $nResult
        EndIf
        Return 'GUI_RUNDEFMSG'
EndFunc   ;==>__EzSkinThemeEvents

Regards,

João Carlos.

http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!)

Somewhere Out ThereJames Ingram

somewh10.png

dropbo10.pngDownload Dropbox - Simplify your life!
Your virtual HD wherever you go, anywhere!

Posted (edited)

@Jscript made ​​some changes to the script I posted:

- Looking for more skin on the Internet.

- Allows to convert the skin file. AU3 equipment (using CreateFilesEmbedded)

- Posted 65 skins with the scripts.

Link 1: http://www.4shared.com/rar/4WqImpgI/Skin_tool.html

Link 2: https://rapidshare.com/files/678729513/skin_tool.rar

Edited by Belini
Posted

@Jscript made ​​some changes to the script I posted:

- Looking for more skin on the Internet.

- Allows to convert the skin file. AU3 equipment (using CreateFilesEmbedded)

- Posted 65 skins with the scripts.

Link download: http://www.4shared.com/rar/4WqImpgI/Skin_tool.html

Note: If you have more skins please post too.

I got severe spasms from all the button purporting to be the download link.

Posted (edited)

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Compression=0
#AutoIt3Wrapper_UseUpx=n
#AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
; *** Start added by AutoIt3Wrapper ***
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <GuiStatusBar.au3>
#include <ListViewConstants.au3>
#include <SliderConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <APIConstants.au3>
#include <IE.au3>
;#include <Array.au3>
; *** End added by AutoIt3Wrapper ***

#include <File.au3>
#include <WinAPIEx.au3>
#include "_UskinLibrary.au3"
#include "Imbutir.au3"

Global $iEZS_LTHEMEEVENT = 1, $hPreview
Global Const $sINI = @TempDir & 'Skin.ini'

; instala a hotkey
HotKeySet('{ESC}', '_sair')

if not FileExists(@ScriptDir & "Pasta skin's.ini") Then
FileWriteLine(".Pasta skin's.ini","[pasta com skins]" & @CRLF & "caminho = " & @ScriptDir & "skins")
endif

$le_endereco = iniread(".Pasta skin's.ini", "pasta com skins", "caminho", "")
$sSkinsFolder = InputBox("Indique uma pasta com skin's",'Clique e "OK" para manter o endereço atual ou "CANCEL" para procurar em outro lugar.',$le_endereco,"",450)

if $sSkinsFolder <> " " then IniWrite(".Pasta skin's.ini", "pasta com skins", "caminho",$sSkinsFolder)

_LoadSkin()

Func _LoadSkin()
    Local $aText[3] = ["Canto esquerdo", @TAB & "Centralizado", @TAB & @TAB & "Canto direito"]
    Local $aParts[3] = [200, 400, -1]
    Local $aFileList, $hWinhandle, $iButton1, $iButton2, $iButton3, $iMsg
    Local $iCoordMode, $iEventMode, $sColuns, $iLVCtrlID, $iLVICtrlID
    Local $sListItem, $sDatFile, $sCol1, $sCol2, $sCol3, $sCol4
    Local $hFile, $hInstance, $hResource, $hData, $pData, $tData

    While 1
        $aFileList = _FileListToArray($sSkinsFolder, "*.msstyles", 1)
        If @error Then
            $sSkinsFolder = FileSelectFolder("Selecione uma pasta que tenha arquivos .msstyles", "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}", 2, @ScriptDir)
            IniWrite(".Pasta skin's.ini", "pasta com skins", "caminho",$sSkinsFolder)
            If @error Then
                Return 0
            EndIf
            ContinueLoop
        EndIf
        ExitLoop
    WEnd

    SplashTextOn("Listando:", "Listando arquivos...", 230, 52, -1, -1, 1, "", 18)

    _USkin_Init($sSkinsFolder & "" & $aFileList[1])
    $iCoordMode = Opt("GUICoordMode", 1)
    $iEventMode = Opt("GUIOnEventMode", 0)
    $hWinhandle = GUICreate("Skin tool.exe", 710, 389, -1, -1, BitOR($WS_CAPTION, $WS_SYSMENU), BitOR($WS_EX_APPWINDOW, $WS_EX_TOPMOST));$WS_EX_TOOLWINDOW
    GUISwitch($hWinhandle)

    $sColuns = "Nome" & "                     | " & _
            "Autor" & "                             | " & _
            "Versão" & "   | " & "Link" & "                                | " & "Caminho" & "                               "
    $iLVCtrlID = GUICtrlCreateListView($sColuns, 14, 20, 680, 250, BitOR(0x0001, 0x0004, 0x0008, 0x8000, 0x0010, 0x00100000, 0x00200000), BitOR(0x00000200, 0x00000020))
    GUICtrlCreateButton("", 14, 13, 682, 2, -1, $WS_EX_STATICEDGE)
    GUICtrlCreateButton("", 14, 277, 682, 2, -1, $WS_EX_STATICEDGE)

$input_exemplo = GUICtrlCreateInput("", 534, 296, 102, 21)
$Button_exemplo = GUICtrlCreateButton("Exemplo", 637, 293, 59, 25)
$Button_skins = GUICtrlCreateButton("Procurar mais skin's na internet", 14, 336, 211, 25)
$Button_converter = GUICtrlCreateButton("Converter para arquivo .au3", 250, 336, 211, 25)
$Button_fechar = GUICtrlCreateButton("Fechar o visualizador de skin's", 486, 336, 211, 25)
$Radio1 = GUICtrlCreateRadio("Rádio", 105, 295, 57, 17)
$Checkbox = GUICtrlCreateCheckbox("Checkbox", 14, 295, 73, 17)
$Slider = GUICtrlCreateSlider(232, 291, 102, 29)
GUICtrlSetLimit(-1, 0)
$Combo = GUICtrlCreateCombo("Combo", 457, 296, 57, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
$Group = GUICtrlCreateGroup("Group", 350, 291, 89, 31)
$Label1 = GUICtrlCreateLabel("Texto", 175, 293, 43, 24)
GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
$hStatus = _GUICtrlStatusBar_Create($hWinhandle, $aParts, $aText)


    For $i = 1 To $aFileList[0]
        $sDatFile = $sSkinsFolder & "" & $aFileList[$i]
        ;
        ;----> Load .msstyles to memory
        $hInstance = _WinAPI_LoadLibraryEx($sDatFile, $LOAD_LIBRARY_AS_DATAFILE)
        ; Load INI file resource...
        $hResource = _WinAPI_FindResource($hInstance, 'TEXTFILE', "THEMES_INI")
        $iSize = _WinAPI_SizeOfResource($hInstance, $hResource)
        $hData = _WinAPI_LoadResource($hInstance, $hResource)
        $pData = _WinAPI_LockResource($hData)
        ;--
        ; Save resource to .ini file
        $hFile = FileOpen($sINI, 2 + 16)
        $tData = DllStructCreate('byte[' & $iSize & ']', $pData)
        FileWrite($hFile, DllStructGetData($tData, 1))
        FileClose($hFile)
        _WinAPI_FreeLibrary($hInstance)
        ;<---- Unload .msstyles from memory
        ;
        $sCol1 = IniRead($sINI, "Documentation", "DisplayName", "")
        $sCol2 = IniRead($sINI, 'Documentation', 'Author', '')
        $sCol3 = IniRead($sINI, 'Documentation', 'Version', '')
        $sCol4 = IniRead($sINI, 'Documentation', 'URL', '')
        $sCol5 = $sDatFile
        $iLVICtrlID = GUICtrlCreateListViewItem($sCol1 & "|" & $sCol2 & "|" & $sCol3 & "|" & $sCol4 & "|" & $sCol5, $iLVCtrlID)
        ;If $sDatFile = $sEZS_SKINPATH Then GUICtrlSetState($iLVICtrlID, 384)
    Next

    GUISetState(@SW_SHOW, $hWinhandle)

      WinWaitActive("Skin tool.exe",""); espera a janela existir e ficar ativa
     SplashOff(); fecha a mensagem

    GUIRegisterMsg($WM_SYSCOMMAND, "On_WM_SYSCOMMAND")
    $iEZS_LTHEMEEVENT = 0
    GUIRegisterMsg(0x004E, "__EzSkinThemeEvents"); $WM_NOTIFY

    While 1

        $dados = GUICtrlRead(GUICtrlRead($iLVCtrlID))
        ;$nome = StringMid($dados, 1, StringInStr($dados, "|", 2, 1) - 1)
        $link = StringMid(StringTrimLeft($dados, StringInStr($dados, "|", 2, 3)), 1, _
                StringInStr(StringTrimLeft($dados, StringInStr($dados, "|", 2, 3)), "|", 2, 1) - 1)
        $caminho = StringMid(StringTrimLeft($dados, StringInStr($dados, "|", 2, 4)), 1 _
                , StringInStr(StringTrimLeft($dados, StringInStr($dados, "|", 2, 4)), "|", 2, 1) - 1)

        $nMsg = GUIGetMsg()
        Switch $nMsg
            Case $GUI_EVENT_CLOSE; fecha a gui e o script
                Exit
            Case $Button_exemplo; caso seja pressionado
            $procura_pasta = FileSelectFolder("procurando", '')
            If Not @error Then GUICtrlSetData($input_exemplo, $procura_pasta)
            Case $Button_skins; caso seja pressionado
                $confere_link = StringInStr($link, "http://", 2, 1)
                If $confere_link = 0 Then $link = "http://" & $link
                $oIE = _IECreate()
                _IENavigate($oIE, $link)
            Case $Button_converter; caso seja pressionado
                 SplashTextOn("Iniciando:", "Abrindo programa...", 270, 52, -1, -1, 1, "", 18)
                 $bData = _imbutir(); Onde a variável $bData contém o binário do executável
                 GUICtrlSetState($Button_converter, $GUI_DISABLE); desabilita o botão
                 ShellExecute(_imbutir(True), '"' & $caminho & '" ' & '"' & @ScriptDir & '"')
                 WinWaitActive("[CLASS:AutoIt v3 GUI]")
                 SplashOff()
                 GUISetState(@SW_HIDE, $hWinhandle)
                 ProcessWaitClose("imbutir.exe")
                 GUISetState(@SW_SHOW, $hWinhandle)
                 GUICtrlSetState($Button_converter, $GUI_ENABLE); habilita o botão
            Case $Button_fechar; fecha a gui e o script
                Exit
        EndSwitch

    WEnd
    GUIDelete($hWinhandle)

    ;_EzSkinMsgBox(262208, __EzSkinTranslateMsg('14'), __EzSkinTranslateMsg('64'), -1, "", -1, -1, True)
    Exit
EndFunc   ;==>_LoadSkin

Func On_WM_SYSCOMMAND($hWnd, $Msg, $wParam, $lParam)
    Switch $hWnd
        Case $hPreview
            If BitAND($wParam, 0xFFF0) = 0xF010 Or BitAND($wParam, 0xFFF0) = 0xF060 Then Return False
    EndSwitch

    Return $GUI_RUNDEFMSG
EndFunc   ;==>On_WM_SYSCOMMAND

; #INTERNAL_USE_ONLY# ===========================================================================================================
; Name...........: __EzSkinThemeEvents
; Description ...: WM_NOTIFY event for _EzSkinLoadTheme().
; Syntax.........: __EzSkinThemeEvents( WndGUI, MsgID, WParam, LParam )
; Author ........: jscript
; Example .......; __EzSkinThemeEvents()
; ===============================================================================================================================

Func __EzSkinThemeEvents($hWndGUI, $MsgID, $wParam, $lParam)
    Local $iCtrlID = _WinAPI_LoWord($wParam), $nResult = GUICtrlRead($iCtrlID)

    If $nResult <> $iEZS_LTHEMEEVENT And $nResult <> 0 Then
        Local $sListItem = GUICtrlRead($nResult), $aDatFile = StringSplit($sListItem, "|")
        If @error Then Return 'GUI_RUNDEFMSG'
        _USkin_LoadSkin($aDatFile[5])
        $iEZS_LTHEMEEVENT = $nResult
    EndIf
    Return 'GUI_RUNDEFMSG'
EndFunc   ;==>__EzSkinThemeEvents

; instala a hotkey
HotKeySet('{ESC}', '_sair')

Func _sair()
    Exit
EndFunc   ;==>_sair

It includes the need to build

Edited by Belini
  • 1 month later...
  • 2 weeks later...
Posted

I'm really liking this skinning tool. I had a music player that I have been writing and added skins to it with this project. It makes the GUI look so much better.

One thing I noticed while using this though is that some of the skins (msstyles files) don't properly skin a progressbar, so if you're going to want to skin one of your GUI's you'll want to avoid using the skins that have this issue if you have a progressbar on it. Obviously if you don't plan on having any type of progress bar on your GUI, then it won't matter, and it's not an issue with this UDF, just that some of skin files aren't 100% complete. BTW, this works just as well on Windows 7, Vista or XP.

These are the skins that come with this archive that cause a progressbar to not show up correctly.

Arcadia

Axis

Cosmo

Joker

Luminati

Pacifica

Reflex

Safari

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Posted (edited)

Ok... I'll check each one!

But tells me if it happens with the embedded skin or in every way.

One detail: They are packed with UPX, try unpack and test again.

Regards,

João Carlos.

Edited by JScript

http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!)

Somewhere Out ThereJames Ingram

somewh10.png

dropbo10.pngDownload Dropbox - Simplify your life!
Your virtual HD wherever you go, anywhere!

Posted

WOW !!! How is that for ONE word that says it all ! :oops:

I have been looking at the various skinning methods & tools here and, no offence to anyone but this is the "Cat's Meow" and is just what I needed ! One stop shopping, easy to implement & change, virtually effortless really and best part, no need to use all sorts of custom functions for buttons, menus etc ! Considering I spent nearly 3 days playing with all the other skinning systems :bye: trying to make them work, this just did it without ANY fuss at all !

Looking at these, I would love to actually reskin my Windows 7/64 with a couple of these, is there a way to do that ?

(just thought of it, have not searched to see how)

@Belini

Is there another place to download your application from another site which does not require registration or special software to download ? The one in Post # 52

I tried your script in Post # 54 but it won't run without #include "Imbutir.au3" which I can't locate here in the forums.

Thanks for this amazingly great skinning capability !

WhiteStar

~ WhiteStar Magic

Always tuned to http://www.superbluesradio.com/  Tune in at http://87.117.217.41:8036/

Posted

@WhiteStar

I'm glad you liked it.

Looking at these, I would love to actually reskin my Windows 7/64 with a couple of these, is there a way to do that ?

(just thought of it, have not searched to see how)

Unfortunately no, but you can use WindowBlinds for this!

Regards,

João Carlos.

http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!)

Somewhere Out ThereJames Ingram

somewh10.png

dropbo10.pngDownload Dropbox - Simplify your life!
Your virtual HD wherever you go, anywhere!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...