Tout fonctionne bien (en fonction du nom des diapo d'un pps, le script déclanche des actions), sauf a la numero 8 ou je fais un zoom grâce a <GDIPlus.au3>, mon Gui s'affiche bien mais il me bloque tout.
Le pps n'avance plus et le Gui refuse de se "killer"!!
Pourquoi?
Je bataille mais ca vient pas!!
► Afficher le texte
Code : Tout sélectionner
#include <GDIPlus.au3>; include pour le zoom
#include <ScreenCapture.au3>
#include <WinAPI.au3>
#include <GuiConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Powerpoint.au3>; include pour le pps
Global $objPPT = _PPT_PowerPointApp()
Global $objPPS = _PPT_PresentationOpen($objPPT, "C:\1.pps")
Global $hBMP, $hGUI1, $hGUI2, $hBitmap, $hGraphic1, $hGraphic2, $x, $y, $w , $z, $l, $h, $g, $gh
HotKeySet("{a}","zoompps")
HotKeySet("{z}","close")
While 1
Switch $objPPS.SlideShowWindow.view.Slide.Name
Case "slide3" ;si la diapo 3 est active alors
graph ();appel la fonction
Sleep(10000) ;attend x millisecondes que la diapo passe
Case "slide5"
graph ()
Sleep(10000)
Case "slide7"
graph ()
Sleep(10000)
Case "slide8"
zoompps()
Sleep(6000)
endzoomed()
EndSwitch
WEnd
func graph ()
Sleep(1000);attend x millisecondes que le webbrowser s'affiche bien
MouseClick("left", 200, 200, 1, 3) ;on bouge et click sur le graph pour le mettre en plein ecran
MouseMove(0,1080,1) ;cache la souris
EndFunc
Func zoompps ()
Sleep(1000);attend x millisecondes que le webbrowser s'affiche bien
;capture de l'image d'origine
;$x et $y =coordonnées haut gauche du rectangle de capture de l'image d'origine
$x = 0
$Y = 163
;$w = dimension largeur rectangle de capture de l'image d'origine
$w = 715
;$Z = dimension hauteur rectangle de capture de l'image d'origine
$z = 200
; dimesion de l'image zoomer
$l=1920 ;largeur
$h=600 ;hauteur
; coordonnées x y du coin superieur gauche de la fenetre zoomer
$g=2
$gh=160
; Capture top left corner of the screen
$hBMP = _ScreenCapture_Capture("", $x, $y, $w+$x, $z+$y)
; Create a GUI for the zoomed image
$hGUI2 = GUICreate("Zoomed" , $l, $h, $g, $gh, $WS_POPUP + $WS_BORDER);on eleve les bords de la fenetre
GUISetState()
; Initialize GDI+ library and load image
_GDIPlus_Startup()
$hBitmap = _GDIPlus_BitmapCreateFromHBITMAP($hBMP)
; Draw 2x zoomed image
$hGraphic2 = _GDIPlus_GraphicsCreateFromHWND($hGUI2)
_GDIPlus_GraphicsDrawImageRectRect($hGraphic2, $hBitmap, 0, 0, $w, $z, 0, 0, $l, $h)
; Release resources
_GDIPlus_GraphicsDispose($hGraphic1)
_GDIPlus_GraphicsDispose($hGraphic2)
_GDIPlus_ImageDispose($hBitmap)
_WinAPI_DeleteObject($hBmp)
_GDIPlus_Shutdown()
; Loop until user exits
do
until GUIGetMsg() = $GUI_EVENT_CLOSE
EndFunc
Func endzoomed()
WinKill("Zoomed")
EndFunc
Func close ()
_PPT_PresentationClose($objPPS) ; ferme la presentation
_PPT_PowerPointQuit ($objPPT);Exit PowerPoint
EndFunc



