Actuellement, je code un script, et au sein de celui ci, j'aurais besoin d'ouvrir un programme, de le rendre non visible, et de capturer la fenêtre...
Quand je dis "non visible", et non pas "invisible", je parle de déplacer la fenêtre hors champ, avec un petit winmove...
Après recherche, pour faire une capture simple, j'ai pris l'exemple avec le bloc note, que voici :
#include <GUIConstantsEx.au3>
$img = @DesktopDir & "\img.jpg"
FileDelete($img)
$hWnd = "[CLASS:Notepad]"
ProcessClose("notepad.exe")
Run("notepad.exe")
WinWait($hWnd)
$objCurrentWindow = WinGetHandle($hWnd)
WinActivate($hWnd)
;~ WinSetState($hWnd,"",@SW_HIDE)
;~ sleep(1000)
_ScreenCapture_CaptureWnd($img, $objCurrentWindow)
ShellExecute($img)
Mais si je fais un WinMove pour mettre la fenêtre hors champ, on voit sur l'image, la fenetre coupé en deux.
En gros, on voit 'l'hors champ' ^^
Comment faire pour capturer une fenêtre, sans qu'elle soit visible ? Telle est la question.
Ce que j'ai fait, au final :
#include <GUIConstantsEx.au3>
$img = @DesktopDir & "\img.jpg"
FileDelete($img)
$hWnd = "[CLASS:Notepad]"
ProcessClose("notepad.exe")
Run("notepad.exe")
WinWait($hWnd)
$objCurrentWindow = WinGetHandle($hWnd)
WinActivate($hWnd)
WinMove($hWnd,"",-500,-500)
;~ WinSetState($hWnd,"",@SW_HIDE)
sleep(1000)
_ScreenCapture_CaptureWnd($img, $objCurrentWindow)
ShellExecute($img)
Merci de vouloir m'aider à trouver des pistes...
++