All pastes #284788 Raw Edit

Someone

public text v1 · immutable
#284788 ·published 2006-12-19 08:52 UTC
rendered paste body
// create window with scrollbar and stuff =p above

var SB_CTL = 2;
	
	var SIF_DISABLENOSCROLL = 0x8;
	var SIF_PAGE = 0x2;
	var SIF_POS = 0x4;
	var SIF_RANGE = 0x1;
	
	var ESB_ENABLE_BOTH = 0x0;
	var ESB_DISABLE_BOTH = 0x3;
	
	var HWND = wnd.GetControlHandle("scrollBar");
	
	var infoScroll = Interop.Allocate(512 +2);
	infoScroll.WriteDWORD(0, 28); //cbSize
	infoScroll.WriteDWORD(4, SIF_DISABLENOSCROLL|SIF_PAGE|SIF_POS|SIF_RANGE); //fMask
	infoScroll.WriteDWORD(8, 0); //nMin
	infoScroll.WriteDWORD(12, 150); //nMax
	infoScroll.WriteDWORD(16, 10); //nPage
	infoScroll.WriteDWORD(20, 50); //nPos
	infoScroll.WriteDWORD(24, 0); //nTrackPos
	 
	var WM_VSCROLL = 0x115
	wnd.RegisterMessageNotification(WM_VSCROLL, true);
	 
	var EnableScrollBar = Interop.Call("User32", "EnableScrollBar", HWND, SB_CTL, ESB_ENABLE_BOTH);
	
	var SetScrollInfo = Interop.Call("User32", "SetScrollInfo", HWND, SB_CTL, infoScroll, true);


//end section (do the above to enable the scrollbar)


// now in this section to move the scrollbar up or down you will have to resend the infoScroll structure and change the npos, otherwise the scrollbar wont move 
function OnWINDOWIDEvent_MessageNotification(PlusWnd, Message, wParam, lParam){
	switch(wParam){
		case SB_LINEDOWN : Debug.Trace("Line Down"); break;
		case SB_LINEUP : Debug.Trace("Line Up"); break;
	}
	
	return true
}