#include #include #include #include Opt ("TrayIconDebug", 1) Example() Func Example() ; Retrieve the handle of the Notepad window using the classname of Notepad. ;Local $hWnd = WinGetHandle("XXXX") Local $hWnd = WinGetHandle("Untitled - Notepad") If @error Then MsgBox($MB_SYSTEMMODAL, "", "An error occurred when trying to retrieve the window handle of Notepad.") Exit EndIf ; Display the handle of the Notepad window. ;MsgBox($MB_SYSTEMMODAL, "", $hWnd) WinActivate($hWnd) SendKeepActive($hWnd) WinWaitActive($hWnd) Sleep(500) ; _WinAPI_Keybd_Event(0x12, 0) ;ControlSend ($hWnd, "", "", "{ALTDOWN}") Send("{ALT down}") ;SendInput("!f") Sleep(500) ;ControlSend ($hWnd, "", "", "f") Send("{f down}") ; _WinAPI_Keybd_Event(0x46, 0) Sleep(500) Send("{f up}") ; _WinAPI_Keybd_Event(0x46, 2) Sleep(500) Send("{s down}") Sleep(500) Send("{s up}") ;ControlSend ($hWnd, "", "", "{ALTUP}") Send("{ALT up}") Sleep(500) ;_WinAPI_Keybd_Event(0x12, 2) EndFunc ;==>Example