#include <WinAPI.au3>
#include <SendMessage.au3>
Run("calc.exe","", @SW_MAXIMIZE)
sleep(1000)
local $Hwnd = WinGetHandle("计算器")
Sleep(1000)
Local $iPID = Run("notepad.exe", "", @SW_SHOWMAXIMIZED)
Sleep(1000)
;-------点击清除键C
_SendMessage(_WinAPI_GetDlgItem($Hwnd, 81), 0x0201, 0)
_SendMessage(_WinAPI_GetDlgItem($Hwnd, 81), 0x0202, 0)
;-------点击5
_SendMessage(_WinAPI_GetDlgItem($Hwnd, 135), 0x0201, 0)
_SendMessage(_WinAPI_GetDlgItem($Hwnd, 135), 0x0202, 0)
;-------点击+
_SendMessage(_WinAPI_GetDlgItem($Hwnd, 93), 0x0201, 0)
_SendMessage(_WinAPI_GetDlgItem($Hwnd, 93), 0x0202, 0)
;-------点击5
_SendMessage(_WinAPI_GetDlgItem($Hwnd, 135), 0x0201, 0)
_SendMessage(_WinAPI_GetDlgItem($Hwnd, 135), 0x0202, 0)
;-------等于
_SendMessage(_WinAPI_GetDlgItem($Hwnd, 121), 0x0201, 0)
_SendMessage(_WinAPI_GetDlgItem($Hwnd, 121), 0x0202, 0)
;操作是点击:5+5=
ProcessClose($iPID)
sleep(1000)
WinActive($Hwnd)
sleep(1000)
MsgBox(262208,"看到了没有","结果是10吧!",3,$Hwnd)
WinClose($Hwnd)
以上代码来源于: