getwindow - Lets you get a pointer to a window or control at the specified coordinates of the top window.
Syntax:
win w= getwindow (0, X, Y);
The first parameter is if 0 receives the main window pointer. if 1 gets a control which is by these coordinates.
The second third is the x y coordinate
win w= getwindow ();
Gets the pointer of the active main window.
When you get the pointer, the win structure becomes available:
wind.width=window width
wind.height=height of the window
wind.left=x position relative to the left edge of the screen
wind.top=y position relative to the left edge of the screen
wind.widthclient=width of the client side of the window (without the system menu and the frame)
wind.heightclient=height of the client side of the window (without the system menu and the frame)
wind.leftclient=the position of the client side of x relative to the left edge of the screen
wind.topclient=the position of the client side of y relative to the left edge of the screen
wind.name=name of the window
wind.class=class name
Example:
Цитата: win w;
int x, y;
int ind=1; // if 0 is on the main window
textbkcolor (0,65535);
a: getmouse (x, y);
w=getwindow (ind, x, y);
textout (4, x + 20, y + 20, "Name:" + w.name + "Class:" + w.class + "Size X:" + format (w.widthclient) + "Size Y:" + format (w .heightclient), 1);
sleep (100);
goto a;
An example of implementing a binding to two identical windows
Цитата:
win w, w1;
int Xv, Yv;
if (messageboxyn ("Click YES.") Point the mouse on the game in the first browser and press E. To cancel, press NO. ") == - 1) goto er;
r: if (getkeystate (192)!=1) {sleep (50); goto r;}
getmouse (Xv, Yv);
w=getwindow (1, Xv, Yv);
if (messageboxyn ("Click YES.) Move your mouse over the game in the second browser and press E. To cancel, press NO.") == - 1) goto er;
r1: if (getkeystate (192)!=1) {sleep (50); goto r1;}
getmouse (Xv, Yv);
w1=getwindow (1, Xv, Yv);
sw :;
activate (w);
sleep (2000);
activate (w1);
goto sw;
er :;
.................................................. ..
update - updates the screen or window.
Syntax:
update (w);
update (-1);
Accepted parameter is a pointer to the window. If -1 is the whole screen.
----- The Visual Code Editor is Kibor. Creating bots without knowledge of programming.
Learning function for recognizing text.
----- |