How do I determine whether the scroll button is pressed or depressed and if so, depress it ! - page 4

 
Zhunko:

If Leo was attentive, the link to the library is my WinUser32.mqh. It has all the commands and functions needed. There is no need to export anything.


33017 - remove/set autoscroll;
or something else ?
 
LEOK:

33017 - remove/set autoscroll;
or something else ?
Spy++ is a help.
Take the information straight from the source.
 
LEOK:

33017 - remove/set autoscroll;
or something else ?
For control, yes. For status, you need the graph properties.
 

Personally, I still don't understand what the problem with using TB_GETSTATE is. What window activity were we talking about? It's a normal window message sent to the control, just like WM_GETTEXT, BM_GETSTATE etc. Always used these messages - no problems at all. And application receives information from controls with these messages in the same way.

And it doesn't matter if the window is active or not.

 
Meat:

Personally, I still don't understand what the problem with using TB_GETSTATE is. What window activity were we talking about? It's a normal window message sent to the control, just like WM_GETTEXT, BM_GETSTATE etc. Always used these messages - no problems at all. And application receives information from controls with these messages in the same way.

It doesn't matter if the window is active or not.

This panel works only with the active chart. What will happen if, at the moment before sending the message, the window's activity changes? Another chart window will become active. Accordingly, you will get the button position for the other window rather than your own. In this case, how can you synchronize the activity of the window for which you want to get the position of the button with the message to be sent? If this is not done, there will be a lot of unexpected errors. Even with DLL this is not obvious.

It's easier and more reliable to get it through graph properties.

 
Zhunko:

This panel only works with the active timetable. What happens if the window activity changes a moment before the message is sent? Another graph window becomes active. Correspondingly, you will get the button position for another window rather than your own. In this case, how can you synchronize the activity of the window for which you want to get the position of the button with the message to be sent? If this is not done, there will be a lot of unexpected errors. Even with DLL this is not obvious.

It's easier and more reliable to get it through graph properties.


Please give me an example of how to use (code): how to get it via graph properties?!
 
LEOK:
Please give me an example of how to use (code): how to get this through the graph properties ?!
Imitate the command to open the chart properties.
Wait for modal dialog.
Find it.
Find the required element.
Close modal dialog.

What questions you have...
 
Zhunko:

This panel only works with the active timetable. What happens if the window activity changes a moment before the message is sent? Another graph window becomes active. Correspondingly, you will get the button position for another window rather than your own. In this case, how can you synchronize the activity of the window for which you want to get the position of the button with the message to be sent? If this is not done, there will be a lot of unexpected errors. Even with DLL this is not obvious.

It's easier and more reliable to get it through chart properties.

Well, you can force the required chart to be activated first. And also for reliability, check the name of the main terminal window. It should contain the name of the desired chart. However, I do not insist, perhaps your version is still more convenient, because you do not need to switch the chart. But the chart properties window will be flashing :)

 
Meat:

Well, you can first forcibly activate the required chart. Also check the name of the main terminal window to be sure. It should contain the name of the required chart. However, I do not insist, probably, your version is still more convenient, because there is no need to switch the chart. But the window of chart properties will pop up :).

Certainly, it is possible to activate. But how to synchronize it? The window activity can be deactivated by any program or by the user himself at any moment. How can this be solved? It is a very inconvenient way.

Yes. The window flickers, but very quickly. If the computer's not busy, it's almost imperceptible.

LEOK:

Give me a use case (code): how can you get this via graph properties ?!

Look in my WinUser32.mqh. There are command codes there. You don't have to look in Spy. You already know the rest.

Andrei wrote it correctly:

jartmailru:
Simulate the command to open the chart properties.
Wait for the modal dialog.
Find it.
Find the desired item.
Close the modal dialog.
Only you will have to switch the tab before you can find the item.
 
Meat:

Well, you can first forcibly activate the required chart. Also check the name of the main terminal window to be sure. It should contain the name of the required chart. However, I do not insist, probably, your version is still more convenient, because there is no need to switch the chart. But the window of chart properties will be flashing :)

The speed at which MT will update the state of the button is unknown. Therefore it is desirable to insert a pause between activation of the window and reading the status, which in some cases will be insufficient and the program logic will fail. So what Vadim is doing is in a sense an "industrial way".