quote:
Originally posted by Felu
Try using [Library] SliderControl?
That shouldn't be necessary.
What message are you looking for?
For horizontal scrollbars, you'll want to look for WM_HSCROLL. However, since your scrollbar is vertical, you'll want to register a notification for WM_VSCROLL. However, you will need to do further processing on wParam to find the specific action being executed on the scrollbar.
This code is not tested but should probably work (it does not check specifically what is happening with the scrollbar):
code:
var WM_HSCROLL = 0x0114;
var WM_VSCROLL = 0x0115;
function OnEvent_Initialize(bMessengerStart){
// Create a window that theoretically contains both a horizontal and vertical scrollbar.
var pWnd = MsgPlus.CreateWnd("ScrollbarExample.xml", "ScrollbarWnd");
// Register message notifications for each type of scrollbar
pWnd.RegisterMessageNotification(WM_HSCROLL);
pWnd.RegisterMessageNotification(WM_VSCROLL);
}
// An event for the window
function OnScrollbarWndEvent_MessageNotification(pWnd, nMessage, wParam, lParam){
// check which message it is
switch(nMessage){
case WM_HSCROLL: // if it is the horizontal one
Debug.Trace("Horizontal scrollbar changed!");
break; // so it doesn't go on
case WM_VSCROLL: // if it is the vertical one
Debug.Trace("Vertical scrollbar changed!");
break; // so it doesn't go on
}
// let Windows process the message like normal
return -1;
}