Controlling a trackbar
Ok, I have written a program that controls a trackbar on another program. I have succeeded in making this trackbar move using set_range and set_pos. Unfourtunatly the target program will not acknowledge the fact that the slider has moved. For example, there is static text next to the trackbar giving it's current value. When you move the slider with the mouse the static text changes. When you move it using the set_pos the track bar moves but the staic text doesnt change. This tells me that the variable being linked the trackbar is not being refreshed or something else may be wrong.
Just for future reference, the program I'm trying to control was not written by me so I'm using SendMessage() to give it commands. Also, If I move the bar and than click it with the mouse the value on the static text refreshes.
Does anyone know how I could simulate a user exactly through windows messages? Or if possibly there is a message I can send it to refresh the variable attached to it. Either way, this is my last problem for my final project with is due in two weeks so I'd be very grateful to anyone who can get me back on track.
Using SPY++ I notice that the program I am trying to control send these messages when using the trackbar with the mouse:
The reason it it doing this is because when you scroll the slider in the other program, it sends more than one type of message saying that it has been scrolled (Most likely WM_HSCROLL is one of them) and that the value must be refreshed, but when you set it with your program, it only sends the message needed to set the trackbar, it doesn't send anything else.