Merci d'avance
► Afficher le texte
Code : Tout sélectionner
;Includes
;--------------------------------------------------------------------------------------------
#Include <GDIPlus.au3>
#Include <File.au3>
#include <GuiConstants.au3>
#Include <WinAPI.au3>
Opt("GUIOnEventMode", 1)
;--------------------------------------------------------------------------------------------
; Global Constants
;--------------------------------------------------------------------------------------------
Global Const $AC_SRC_ALPHA      = 1
Global Const $ULW_ALPHA         = 2
;--------------------------------------------------------------------------------------------
;Setting PNG image to use and Attributes
;-----------------------------------------#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=1.ico
#AutoIt3Wrapper_outfile=11.exe
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
;--------------------------------------------------------------------------------------------
; Hey there Here is a basic Script to take a PNG image and display it as a Splash screen
; The Inage will be always ontop and will allow you to click through it, There
; is no limit to the shape or size, save the size should be believable, 
; I wouldn'T recomend more than say 640 x 480 but use your discretion
;--------------------------------------------------------------------------------------------
; Done By Digi
;  Special Thanks to
;    Lor3n  - PNG usage and basic Scripting.
;    AutoIT crew For all assist and development of a killer Applet
;    Simphax For a lil help with the Click start app command
;-----------------------------------------------------------------------------------------------------------------------------------------------
_GDIPlus_Startup()
$pngSrc = @scriptdir & "\Splash.jpg"
$hImage = _GDIPlus_ImageLoadFromFile($pngSrc)
$width =  _GDIPlus_ImageGetWidth ($hImage)
$height = _GDIPlus_ImageGetHeight($hImage)
;--------------------------------------------------------------------------------------------
;Creating the GUI
;--------------------------------------------------------------------------------------------
$GUI = GUICreate("Digi's Splash", $width, $height, -1, -1, $WS_POPUP, $WS_EX_LAYERED)
SetBitMap($GUI, $hImage, 255)
GUISetState()
WinSetOnTop($gui,"",1)
_GDIPlus_Shutdown()
;--------------------------------------------------------------------------------------------
; Display time for the Splash and If mouse click
;--------------------------------------------------------------------------------------------
;GUISetOnEvent ($GUI_EVENT_PRIMARYDOWN, "RunApp" )
Sleep(3000)
;RunApp()
;--------------------------------------------------------------------------------------------
; Mouse Click Run App.
;--------------------------------------------------------------------------------------------
[b]Func RunApp()
    RUN("traqueur.exe")
    Exit
EndFunc[/b]
;--------------------------------------------------------------------------------------------
; Placing the Image and setting attributes
;--------------------------------------------------------------------------------------------
Func SetBitmap($hGUI, $hImage, $iOpacity)
  Local $hScrDC, $hMemDC, $hBitmap, $hOld, $pSize, $tSize, $pSource, $tSource, $pBlend, $tBlend
  $hScrDC  = _WinAPI_GetDC($hGUI)
  $hMemDC  = _WinAPI_CreateCompatibleDC($hScrDC)
  $hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage)
  $hOld    = _WinAPI_SelectObject ($hMemDC, $hBitmap)
  $tSize   = DllStructCreate($tagSIZE)
  $pSize   = DllStructGetPtr($tSize  )
  DllStructSetData($tSize, "X", _GDIPlus_ImageGetWidth ($hImage))
  DllStructSetData($tSize, "Y", _GDIPlus_ImageGetHeight($hImage))
  $tSource = DllStructCreate($tagPOINT)
  $pSource = DllStructGetPtr($tSource)
  $tBlend  = DllStructCreate($tagBLENDFUNCTION)
  $pBlend  = DllStructGetPtr($tBlend)
  DllStructSetData($tBlend, "Alpha" , $iOpacity    )
  DllStructSetData($tBlend, "Format", $AC_SRC_ALPHA)
  _WinAPI_UpdateLayeredWindow($hGUI, $hScrDC, 0, $pSize, $hMemDC, $pSource, 0, $pBlend, $ULW_ALPHA)
  _WinAPI_ReleaseDC   (0, $hScrDC)
  _WinAPI_SelectObject($hMemDC, $hOld)
  _WinAPI_DeleteObject($hBitmap)
  _WinAPI_DeleteDC    ($hMemDC)
EndFunc


