[ ] Calculator.SetActive()
[ ] Calculator.N1.Click()
[ ] Calculator.N1.Click()
[ ] sleep(1)
[ ] // Press Left key of mouse
[ ] PostMessage(hdWnd, WM_LBUTTONDOWN, 0, 0 )
[ ] sleep(4)
[ ] // Release Left key of mouse
[ ] PostMessage(hdWnd, WM_LBUTTONUP,0, 0)
[ ]
你同样可以通过SendMessage实现相同的功能,他们二者的差别就是一个是异步消息,一个是同步消息。如果你想了解更多,可以google下二者具体的区别。
另外附上一些Windows常用消息号。
view plaincopy to clipboardprint?
01.WM_NULL = 0x00
02.WM_CREATE = 0x01
03.WM_DESTROY = 0x02
04.WM_MOVE = 0x03
05.WM_SIZE = 0x05
06.WM_ACTIVATE = 0x06
07.WM_SETFOCUS = 0x07
08.WM_KILLFOCUS = 0x08
09.WM_ENABLE = 0x0A
10.WM_SETREDRAW = 0x0B
11.WM_SETTEXT = 0x0C
文章来源于领测软件测试网 https://www.ltesting.net/