Automation with button and mouse click interception. - page 6

 
HIDDEN >> :

How do the menus that open on the first button of the mouse get intercepted? When you switch to another program from the terminal, the menu disappears and you just can't catch it. Maybe you need to freeze the programme somehow?

from the context menu many items have a code for WM_COMMAND

 
HIDDEN >> :

And how do intercept menus which open by the right mouse button. Switching to another program from the terminal, the menu disappears and just can not catch it. May be some way to stop the program?

When using the Spy++ utility there is no problem.

In the software, select the desired window from the list of windows. Start Windows Message Interceptor (Spy -> Messages...).

Configure message filter (Messages tab) in the window that appears.


You can then perform various operations in the programme under investigation, including right-clicking the menu and seeing what the utility shows.

 
Ilnur >> :

When using the Spy++ utility there is no problem.

In the software, select the desired window from the list of windows. Start Windows Message Interceptor (Spy -> Messages...).

Configure the message filter in the window that appears (Messages tab).


After that you can do different operations in the program you're investigating, including right-click menu and see what the utility shows.

Question for you, if you have such great knowledge in everything you wrote here why don't you make the tester run automatically, optimize it, set the right variables, etc.

 

How to press the Enter key programmatically

Something about this doesn't work.

Enter DOM_VK_ENTER 13 0x0D
 
HIDDEN >> :

Question for you, if you are so knowledgeable in everything you've written here, why don't you do an automatic tester run, optimisation, substitution of the right variables, etc.

I don't have great knowledge in everything I've laid out here. I have never claimed that.


I've never been interested in software control of the tester. That's why I don't want to implement something like that.

There were some technical questions in this thread about the use of WinAPI functions, so I decided to get involved.

 
   Print("Запуск тестера стратегий");
   string sButtonStartName = "";
   while(!IsStopped()) 
   {
      Sleep(3000);
      GetWindowTextA( hButtonStart, sButtonStartName,6); //считываем текст кнопки запуска тестера
      if( sButtonStartName=="Старт")                    
      {
         Print("Работа тестера завершена");
         break;
      }
   }

We need

string sButtonStartName = "";

At least initialize with length 6(StringLen("Start")+1), or preferably with length 255 characters.

Otherwise, after sButtonStartName is returned from GetWindowTextA, the adjacent variable in memory gets trashed.

In my example with RestoreScripts in the neighboring branch, the value of the string defined by #define changes if it doesn't do so.

 
Erics >> :

We need

string sButtonStartName = "";

At least initialize with length 6(StringLen("Start")+1), or preferably with length 255 characters.

Otherwise, after sButtonStartName is returned from GetWindowTextA, the adjacent variable in memory gets trashed.

In my example with RestoreScripts in the next branch, the value of the string defined by #define changes, if not done so.

Yes, this is correct. I was writing it quickly and missed this point.

 
Ilnur >> :

There have been some technical questions in this thread about the use of WinAPI functions, so I decided to get involved.

I found an interesting window. It's almost impossible to catch anything in it. The window is called "Save As". Can you tell me how to press the "Save as" button?



If you select the save button specifically, then we have the button code 00000001



But when you access it by this code, nothing happens. What is this window that has no name?

 
HIDDEN >> :

Found an interesting window. It is almost impossible to catch anything in it. The window is called "Save as". Can you tell me how to press the "Save as" button?


If you select the save button specifically, the button code is 00000001


But when you access it by this code, nothing happens. What kind of a window is this unnamed one.

The dialog is standard Shell IIANM. And the "save" button is a rebranded ID_OK button.

 
TheXpert >> :

The dialog is standard Shell IIANM. And the "save" button is a rebranded ID_OK button.

Appealing to the OK button does nothing


PostMessageA(GetDlgItem(hTerminal,0x53),WM_COMMAND,IDOK,0);