Sous Windows 7, un script AutoHotKey faisait automatiquement un clic droit sur une icône de la barre d'état.Cliquez avec le bouton droit sur l'icône de la barre d'état dans Windows 10 avec AutoHotKey
#Include %A_Scriptdir%\TrayIcon.ahk
TrayIcon_Button("CCC.exe", "R")
qui a utilisé la bibliothèque TrayIcon.ahk de FanaticGuru's post.
Voici un lien de téléchargement direct à la bibliothèque: https://autohotkey.com/boards/codeboxplus/download/9186-1
Cela a fonctionné très bien sur Windows 7, mais ne fonctionne plus sur Windows 10.
est-il un moyen de faire un clic droit sur un TrayIcon dans un script AutoHotKey sur Windows 10?
Voici la fonction TrayIcon_Button de la bibliothèque. Je me suis abstenu d'afficher toute la bibliothèque car elle est assez longue.
; ----------------------------------------------------------------------------------------------------------------------
; Function .....: TrayIcon_Button
; Description ..: Simulate mouse button click on a tray icon.
; Parameters ...: sExeName - Executable Process Name of tray icon.
; ..............: sButton - Mouse button to simulate (L, M, R).
; ..............: bDouble - True to double click, false to single click.
; ..............: index - Index of tray icon to click if more than one match.
; ----------------------------------------------------------------------------------------------------------------------
TrayIcon_Button(sExeName, sButton := "L", bDouble := false, index := 1)
{
Setting_A_DetectHiddenWindows := A_DetectHiddenWindows
DetectHiddenWindows, On
WM_MOUSEMOVE = 0x0200
WM_LBUTTONDOWN = 0x0201
WM_LBUTTONUP = 0x0202
WM_LBUTTONDBLCLK = 0x0203
WM_RBUTTONDOWN = 0x0204
WM_RBUTTONUP = 0x0205
WM_RBUTTONDBLCLK = 0x0206
WM_MBUTTONDOWN = 0x0207
WM_MBUTTONUP = 0x0208
WM_MBUTTONDBLCLK = 0x0209
sButton := "WM_" sButton "BUTTON"
oIcons := {}
oIcons := TrayIcon_GetInfo(sExeName)
msgID := oIcons[index].msgID
uID := oIcons[index].uID
hWnd := oIcons[index].hWnd
if bDouble
PostMessage, msgID, uID, %sButton%DBLCLK, , ahk_id %hWnd%
else
{
PostMessage, msgID, uID, %sButton%DOWN, , ahk_id %hWnd%
PostMessage, msgID, uID, %sButton%UP, , ahk_id %hWnd%
}
DetectHiddenWindows, %Setting_A_DetectHiddenWindows%
return
}
Votre solution a fonctionné parfaitement !!! Merci de votre aide! – SimCard
Ne fonctionne plus avec Windows 10 1709. Une idée de comment résoudre ce problème? Peut-être que de la [dernière version] (https://autohotkey.com/boards/viewtopic.php?p=9186#p9186) de la bibliothèque aussi bien? – Otiel
@Otiel Voilà pourquoi j'aime la mise à jour de Windows. Je vais mettre à jour Windows ce week-end. J'espère essayer de trouver une solution d'ici lundi. –