Skincrafter UDF

« Older   Newer »
  Share  
Lahace
CAT_IMG Posted on 16/6/2009, 13:12     +1   -1




SPOILER (click to view)
#cs ----------------------------------------------------------------------------
AutoIt Version: 3.3.0.0
Author: Kenneth P. Morrissey (ken82m)

UDF Function: Enabled skinning of AutoIT GUI's using SkinCrafter
(Tested with SkinCrafter 3.3.3)

Example
#include <skincrafter.au3>
_LoadSkinCrafter("SkinCrafterDLL.dll");Load SkinCrafter DLL

;GUI With Initial Skin
$GUI_1 = GuiCreate("Test", -1, -1, 0, 0)
_InitializeSkinCrafter($GUI_1, "ice-cold.skf")
GUICtrlCreateButton("Test", 50, 50, 50)
GUISetState()

;GUI With Additional Skin Loaded & Applied
$GUI_2 = GuiCreate("Test2", -1, -1, 200, 0)
GUICtrlCreateButton("Test", 10, 10, 50)
_LoadSkin("skinastic.skf", 2)
_ApplySkin($GUI_2, 2)
GUISetState()

;GUI with no skin applied
$GUI_3 = GuiCreate("Test3", -1, -1, 400, 0)
GUICtrlCreateButton("Test", 10, 10, 50)
_ExcludeSkin($GUI_3)
GUISetState()

;GUI with initial skin automatically applied
$GUI_4 = GuiCreate("Test4", -1, -1, 600, 0)
GUICtrlCreateButton("Test", 10, 10, 50)
GUISetState()

While 1
If GuiGetMsg()=-3 Then Exit
WEnd
#ce ----------------------------------------------------------------------------
Global $nSkinCrafterDll



#cs===================================================================================
Fuction _LoadSkinCrafter ( $nDLL )

Description Loads the SkinCrafter DLL into Memory
This should be run before any GUI's are created.

Parameter $nDLL The path to SkinCrafterDLL.dll

Return Success 1
Failure 0 Sets @error: 1 - $nDLL Does Not Exist
2 - DLLOpen Failed

Author Kenneth P. Morrissey (ken82m)
#ce===================================================================================
Func _LoadSkinCrafter($nDLL)
$nSkinCrafterDll = DllOpen($nDLL)
If Not FileExists($nDLL) Then
SetError(1)
Return 0
EndIf
If $nSkinCrafterDll = -1 Then
SetError(2)
Return 0
EndIf
DllCall($nSkinCrafterDll, "int:cdecl", "InitLicenKeys", "wstr","SKINCRAFTER", "wstr","SKINCRAFTER.COM", "wstr", "[email protected]","wstr","DEMOSKINCRAFTERLICENCE")
DllCall($nSkinCrafterDll, "int:cdecl", "DefineLanguage", "int", 0)
Return 1
EndFunc



#cs===================================================================================
Fuction _InitializeSkinCrafter ( $nHWND , $nSkin )

Description Load Initial Skin and Apply to GUI (Only Run ONCE)
This should be run AFTER the GUI is created but BEFORE any controls.

This skin will apply to all future GUI's by default.

Parameter $nHWND Handle to the first GUI created
$nSkin Path to Skin File (SKF)

Return Success 1
Failure 0 Sets @error: 1 - $nInitialGUI Does Not Exist
2 - $nSkin Does Not Exist

Author Kenneth P. Morrissey (ken82m)
#ce===================================================================================
Func _InitializeSkinCrafter($nHWND, $nSkin)
If Not WinExists($nHWND) Then
SetError(1)
Return 0
EndIf
If Not FileExists($nSkin) Then
SetError(2)
Return 0
EndIf
DllCall($nSkinCrafterDll, "int:cdecl", "InitDecoration", "int", 1)
DllCall($nSkinCrafterDll, "int:cdecl", "LoadSkinFromFile", "wstr", $nSkin)
DllCall($nSkinCrafterDll, "int:cdecl", "ApplySkin")
DllCall($nSkinCrafterDll, "int:cdecl", "DecorateAs","long",$nHWND,"long",1)
Return 1
EndFunc



#cs===================================================================================
Fuction _ApplySkin ( $nHWND , $nSkinID )

Description Load Initial Skin and Apply to GUI (Only Run ONCE)
No restrictions, this can be run at any time during the script after InitializeSkinCrafter()

Parameter $nHWND Handle to the first GUI created
$nSkinID ID of loaded skin to apply (Must be greater than 1)

Return Success 1
Failure 0 Sets @error: 1 - $nHWND Does Not Exist
2 - $nSkinID is invalid

Author Kenneth P. Morrissey (ken82m)
#ce===================================================================================
Func _ApplySkin($nHWND, $nSkinID)
If Not WinExists($nHWND) Then
SetError(1)
Return 0
EndIf
If $nSkinID > 1 Then
DllCall($nSkinCrafterDll, "int:cdecl", "ApplyAddedSkin","long",$nHWND,"long",$nSkinID)
Return 1
Else
SetError(2)
Return 0
EndIf
EndFunc



#cs===================================================================================
Fuction _LoadSkin ( $nSkin , $nSkinID )

Description Load additional skin file.

Parameter $nSkin Path to the skin file being loaded
$nSkinID ID to associate with the skin (Must be a number greater than 1)

Return Success 1
Failure 0 Sets @error: 1 - $nSkin Does Not Exist
2 - $nSkinID is Inavlid

Author Kenneth P. Morrissey (ken82m)
#ce===================================================================================
Func _LoadSkin($nSkin, $nSkinID)
If Not FileExists($nSkin) Then
SetError(1)
Return 0
EndIf
If $nSkinID > 1 Then
DllCall($nSkinCrafterDll, "int:cdecl", "AddSkinFromFile", "wstr", $nSkin, "short",$nSkinID)
Return 1
Else
SetError(2)
Return 0
EndIf
EndFunc



#cs===================================================================================
Fuction _ExcludeSkin ( $nHWND )

Description Excludes a GUI from all loaded skins.

Parameter $nHWND Handle to the GUI to exclude

Return Success 1
Failure 0 Sets @error: 1 - $nHWND Does Not Exist

Author Kenneth P. Morrissey (ken82m)
#ce===================================================================================
Func _ExcludeSkin($nHWND)
If Not WinExists($nHWND) Then
SetError(1)
Return 0
EndIf
DllCall($nSkinCrafterDll, "int:cdecl", "ExcludeWnd", "long", $nHWND)
Return 1
EndFunc

ecco l'udf per far si che le skin di skincrafter funzionino su autoit

nella cartella del progetto devi copiare la dll di skincrafter (SkinCrafterDll_vs2005.dll o SkinCrafterDll_vs2008.dll il loro funzionamento dipende dalle librerie in possesso) e devo usare i comandi
CODICE
_LoadSkinCrafter("SkinCrafterDll_vs2005.dll")

per caricare la dll e invece
CODICE
_initializeskincrafter($gui , "Vista_Style.skf")

per caricare la skin (la skin copiala nella cartella del progetto XD)
 
Top
antru
CAT_IMG Posted on 16/6/2009, 15:50     +1   -1




Grazie, ora provo.
 
Top
stoke
CAT_IMG Posted on 20/6/2009, 23:14     +1   -1




non capisco, dice che la variabile $gui non esiste, perchè?
 
Top
MatteoJug
CAT_IMG Posted on 20/6/2009, 23:20     +1   -1




$gui sarebbe l'handle della finestra che crei, il ritorno della funzione GuiCreate()...
[ $gui = GuiCreate([..])]
 
Top
stoke
CAT_IMG Posted on 21/6/2009, 13:01     +1   -1




ho capito, con koda sarebbe Form1, ho fatto tutto, ho incluso skincrafter.au3 ho messo la dll,ho provato sia con la 2005 sia con la 2008, ma non funziona, perchè?
 
Top
MatteoJug
CAT_IMG Posted on 21/6/2009, 13:09     +1   -1




Posta il codice e vediamo...
 
Top
stoke
CAT_IMG Posted on 21/6/2009, 14:32     +1   -1




ho risolto, ma con un'altra UDF, quella del memory benchmark di I.ren, è più facile è funziona meglio
 
Top
Kelmar
CAT_IMG Posted on 12/4/2010, 17:29     +1   -1




Anche io sarei interessato, potrei avere più info plz, grazie
 
Top
-Anubi-
CAT_IMG Posted on 12/4/2010, 18:10     +1   -1




Iscriviti
 
Top
Kelmar
CAT_IMG Posted on 12/4/2010, 18:41     +1   -1




CITAZIONE (-Anubi- @ 12/4/2010, 19:10)
Iscriviti

A cosa?

Qualcuno ha il dll 2008 patchato da passarmi?

grazie
 
Top
-Anubi-
CAT_IMG Posted on 12/4/2010, 19:01     +1   -1




Presentati voleva dire Anubi xD
 
Top
danyweb
CAT_IMG Posted on 27/7/2011, 14:26     +1   -1




Salve... ma il tutto funziona anche se ora ci sono le dll skincrafter del 2010?? o cambia qualcosa?
 
Top
*Sym98*
CAT_IMG Posted on 27/7/2011, 14:45     +1   -1




Non uppare post vecchi. ;)
 
Top
Cale92
CAT_IMG Posted on 27/7/2011, 18:26     +1   -1




quoto sym.. comunque non ricordo, penso di si ma non ne sono sicuro. in ogni caso se non funzionasse basta una velocissima ricerca in google per recuperare la dll vecchia
 
Top
13 replies since 16/6/2009, 13:12   739 views
  Share