[Closed] UIAccessor and SpinnerControl
Hi guys,
I’m trying to find a way to change the value in a SpinnerControl through the UIAccessor interface. I can access the spinner’s hwnd as well as some of the nearby controls (an Edit, a CustEdit, and an EDITDUMMY). Of course the reason I’m doing this is because the value isn’t directly exposed to MXS.
I can use UIAccessor.SetWindowText to change the Edit control’s value, but the moment I adjust the spinner value by hand the value jumps back to what it was originally (I’m guessing because the Edit control is merely a string representation of the actual value).
I’m using some low-level windows messages to manipulate comboboxes and checkboxes, but since the SpinnerControl is an ICustomControl, it doesn’t behave the same way. I found a couple of windows messages for it in the SDK:
// LOWORD(wParam) = ctrlID,
// HIWORD(wParam) = TRUE if user is dragging the spinner interactively.
// lParam = pointer to ISpinnerControl
#define CC_SPINNER_CHANGE WM_USER + 600
// LOWORD(wParam) = ctrlID,
// lParam = pointer to ISpinnerControl
#define CC_SPINNER_BUTTONDOWN WM_USER + 601
// LOWORD(wParam) = ctrlID,
// HIWORD(wParam) = FALSE if user cancelled - TRUE otherwise
// lParam = pointer to ISpinnerControl
#define CC_SPINNER_BUTTONUP WM_USER + 602
…but these don’t let me set the value. Is there a #define for CC_SPINNER_SETVALUE? I can’t find one anywhere. Or can I use a standard windows message (and if so, which one?) to change this value?
Any help would be appreciated.
edit
The messages above come from the spinner itself through user interaction… so I can’t use them to send messages to the spinner. I think I need access to the underlying value associated with the spinner from MXS, and the closest thing to low-level access from MXS are windows messages. The problem is that windows messages will only let me manipulate the control object, and not the value, so I guess its off-limits.
Solution: I tested a little more and am going to use messages to right-click the spinner (to set its value to its lowerbounds) then loop left-click messages until the Edit control reads the value I want. Hacky but it works, haha.