I need to develop an automation that opens a certain application and increases the search screen. The activity would be to click with the “mouse” in a certain “hold” position and drag the line to enlarge the field. In this image is the Windows event viewer screen, I need the “mouse” this way to be able to drag and enlarge the field.
Have a look at this post. I think thats what you need. Just with BTN_LEFT for your case.
If your coordinates are not static you need to work with variable type [Rectangle] and [Position]
but there might be an easier approach:
Try:
Get Attribute Activity on the ↔ Element and get the Attribute “position”
Set Attribute Activity on the ↔ Element with CInt(coordinatevariablet.Rectangle.Value.Left.ToString) + amount
amount (Int32) is your shift to the right.
Find an element where is possible to change its size.
Get its position (Offset X and Offset Y)
Use click activity setting click type property to CLICK_DOWN. Also, we need to provide values to Options > Cursor Position > Offset X and Offset Y, based on values from step 2. In addition, there is a trick here… We need to subtract a value from the Offset X, then the “mouse” will be above the size adjustment bar.
Use click activity setting click property to CLICK_UP. Again, proving Offset X and Y, but now you will add value do Offset X, this increases its size.
If you have any doubt, you can check the solution attached.
follows the error image. In the second image, it tells what I want to do, get out of point (1 and get to point 2). If you need I can make a video and send it to you.
About the first image… The first activity is just to open Event Viewer. Did you copied exactly the same as the project attached?
About the second one… I understood, but in this example it will adjust the other size bar. The one between the center div and the left div. But don’t worry, we can change this easily. Let’s just solve the problem mentioned above before
Yes, I copied exactly what you asked for, but I still couldn’t execute it … in the “Event Viewer” when I opened it to indicate that the selector is not valid so it presents the error.
From what I am checking I will have to take the size of the element, and find the position of the column, so the mouse can find and drag to the sides, because the value is not static.
Yes, with this selector it is valid, it works perfectly, but as I said only for the first column. As I understand it, the first “click” activity is -3 the column, correct? how did you get that value? because if you have other situations the value may be different …
Try to save this selector again, and after that check if its equals to this:
"<wnd app='mmc.exe' cls='MMCMainFrame' title='Visualizador de Eventos' /><wnd cls='MMCChildFrm' title='Visualizador de Eventos (Local)' /><wnd cls='AfxFrameOrView42u' />"
I ask this, because sometimes we hit enter to save. But the change it is not saved.
Here is working properly.
About the -3, it works like this…
We need to find the position of the element that has the size bar, in this case, the size bar is to the left of our element. So, example, it return that the element is in the Offset X 500, then the size bar is a little bit before 500. Then we subtract to reach the size bar.
Yes… this value may up to change. But don’t think as a table, columns and rows think as “eixo X e Y da tela” (by the way, I am Brazilian as well)