Bonjour, je cherche à faire croire à une application que la touche Enter a été enfoncé.

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
 
import win32com.client as comclt
import win32gui
hwnd = win32gui.FindWindowEx(0,0,0, "app name")
win32gui.SetForegroundWindow(hwnd)            
wsh= comclt.Dispatch("WScript.Shell")
wsh.AppActivate("app name") # select another application
wsh.SendKeys("a") # send the keys you want, this works
L'instruction wsh.SendKeys("a") fonctionne correctement, mais
wsh.SendKeys("\n") ou wsh.SendKeys("Enter") ne permettent pas d'obtenir le résultat.

Avez vous des idées ?
Merci d'avance