► Afficher le texte
Code : Tout sélectionner
#include <ButtonConstants.au3>
#include <File.au3>
#include <GDIPlus.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Global $Ft = "RR"
Global $skinpath = @ScriptDir&"\"
;Global $PaintEditor = @SystemDir&"\mspaint.exe"
;Global $PaintEditor = @ProgramFilesDir&"\Paint.NET\PaintDotNet.exe"
;Global $PaintEditor = @ProgramFilesDir&"\GIMP-2.0\bin\gimp-2.6.exe"
Global $PaintEditor = @ProgramFilesDir&"\Adobe\Adobe Photoshop CS4\Photoshop.exe"
Dim $ScreenName[7]
Dim $ScreenPic[7]
$MainGUI = GUICreate("Skinner Tool ", 500, 603, -1, -1)
$ScreenDS = GUICtrlCreateButton("Screen" & @CRLF &$Ft, 370, 185, 60, 35, BitOR($BS_MULTILINE,$WS_GROUP))
GUISetState()
;Gui Screen
$ScreenGUI = GUICreate("", 490, 372, 0, 220,BitOR($WS_SYSMENU,$WS_DLGFRAME,$WS_POPUP,$WS_CLIPSIBLINGS),bitor($WS_EX_MDICHILD,$WS_EX_CLIENTEDGE),$MainGUI)
$ScreenPic[0] = GUICtrlCreatePic("", 3, 23, 240, 140)
$ScreenPic[1] = GUICtrlCreatePic("", 248, 23, 240, 140)
$ScreenPic[2] = GUICtrlCreatePic("", 3, 188, 240, 140)
$ScreenPic[3] = GUICtrlCreatePic("", 248, 188, 240, 140)
$PaintScreenDS = GUICtrlCreateButton("", 2, 2, 20, 20, $BS_ICON)
GUICtrlSetTip(-1,"Paint editor")
GUICtrlSetImage(-1, @SystemDir & '\mspaint.exe', 1, 0)
$ScreenName[0] = GUICtrlCreateLabel("generic_empty.skin",80,3,280,20)
GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
$ScreenName[1] = GUICtrlCreateLabel("generic_off.skin",320,3,280,20)
GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
$ScreenName[2] = GUICtrlCreateLabel("generic_on.skin",80,167,280,20)
GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
$ScreenName[3] = GUICtrlCreateLabel("generic_down.skin",320,167,280,20)
GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
;positions des icones de liste
GUICtrlCreatePic("barre.jpg", 2, 328, 488, 5)
$ScreenPic[4] = GUICtrlCreatePic("", 100, 338, 32,32)
$ScreenPic[5] = GUICtrlCreatePic("", 270, 338, 32,32)
$ScreenPic[6] = GUICtrlCreatePic("", 440, 338, 32,32)
$ScreenName[4] = GUICtrlCreateLabel("logo1",10,345,80,20)
GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
$ScreenName[5] = GUICtrlCreateLabel("logo2",180,345,80,20)
GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
$ScreenName[6] = GUICtrlCreateLabel("logo3",350,345,80,20)
GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
GUISetState(@SW_HIDE,$ScreenGUI)
$ScreenGUIStatus = False
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
exit
Case $ScreenDS
GUISwitch($ScreenGUI)
If $ScreenGUIStatus = true Then
GUISetState(@SW_HIDE,$ScreenGUI)
$ScreenGUIStatus=False
Else
GUISetState(@SW_SHOW,$ScreenGUI)
$ScreenGUIStatus=True
EndIf
$screen = $skinpath&"\menu.skin"
Local $i,$aRecords
If Not _FileReadToArray($screen,$aRecords) Then
MsgBox(4160,"Error", " Error reading log to Array error:" & @error)
Exit
EndIf
; Msgbox(0,'Record:' , $aRecords[3])
$Name = StringSplit($aRecords[3],",")
; Msgbox(0,'Record:' , $Name[0])
If StringRight($Name[1],3)<> "png" Then
For $i = 0 To $Name[0]-1
GUICtrlSetImage($ScreenPic[$i], $Name[$i+1])
GUICtrlSetData($ScreenName[$i],$Name[$i+1])
Next
Else
For $i = 0 To $Name[0]-1
GUICtrlSetData($ScreenName[$i],$Name[$i+1])
Next
_GUICtrlCreatePicPNG($skinpath&$Name[1], 3, 23, 240, 140, $ScreenGUI)
_GUICtrlCreatePicPNG($skinpath&$Name[2], 248, 23, 240, 140, $ScreenGUI)
_GUICtrlCreatePicPNG($skinpath&$Name[3], 3, 188, 240, 140, $ScreenGUI)
_GUICtrlCreatePicPNG($skinpath&$Name[4], 248, 188, 240, 140, $ScreenGUI)
EndIf
; If $Name > 3 Then
For $i = 4 To $Name[0]-1
GUICtrlSetImage($ScreenPic[$i], $Name[$i+1])
GUICtrlSetData($ScreenName[$i],$Name[$i+1])
Next
; EndIf
Case $PaintScreenDS;édition des 4 fichiers formant le screen actif
$screen = $skinpath&"\menu.skin"
Local $i,$aRecords
If Not _FileReadToArray($screen,$aRecords) Then
MsgBox(4160,"Error", " Error reading log to Array error:" & @error)
Exit
EndIf
$Name = StringSplit($aRecords[3],",")
For $i = 0 To $Name[0]-1
ShellExecute($PaintEditor, Chr(34) & $SkinPath & "\" & $Name[$i+1] & Chr(34), $SkinPath, "open")
Next
EndSwitch
Wend
Func _GUICtrlCreatePicPNG($file, $xpos, $ypos, $xsize, $ysize, $hGUI)
; Load PNG image
_GDIPlus_StartUp()
$hImage = _GDIPlus_ImageLoadFromFile($file)
; Draw PNG image
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI)
_GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage, $xpos, $ypos, $xsize, $ysize )
; Clean up resources
_GDIPlus_GraphicsDispose ($hGraphic)
_GDIPlus_ImageDispose($hImage)
_GDIPlus_Shutdown ()
EndFuncCliquez sur le buton 'Paint Editor' dans l'écran 'Screen RR'
Merci de votre aide par avance


