In the past, I used the press-key Wizard to write some scripts. At that time, I often used this script to hook up FB or something.
A netizen asked me that day, so he answered
It is nothing more than grasping the handle, and then positioning the coordinates or sending messages to a fixed form
The Code is as follows:
1 // capture the window handle ////////// //// // 2 3 dim hwnd 4 5 hwnd = plugin. window. mousepoint () 6 7 swindow = plugin. window. iswindow (hwnd) 8 9 If swindow =-1 then 10 11 hwnd = plugin. window. foreground () 12 13 end if14 15 srect = plugin. window. getclientrect (hwnd) 16 17 18 xyarray = Split (srect, "|") 19 20 dx = clng (xyarray (0) 21 22 DY = clng (xyarray (1 )) 23 24 /// // The End Of The Window handle ///////// /// // 25 // /// // The above is not understood, you can ignore // 26 ////////// //// // write the following code by yourself //////////////// /// // 27 call plugin. bkgnd. moveTo (hwnd, 830-dx, 247-dy) // move the mouse to the specified position 28 call plugin. bkgnd. rightclick (hwnd, 830-dx, 247-dy) // right-click 29 call plugin. bkgnd. keydown (hwnd, 112) // Press F1, and the other key values are Baidu 30 delay 20031 call plugin. bkgnd. keyup (hwnd, 112) // open f132 delay 43000
A script for sending messages in the background by pressing the key wizard