The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: Ksbunker on November 02, 2009, 06:45:03 AM

Title: Superclassed Listbox's - Parallel Vertical Scrolling
Post by: Ksbunker on November 02, 2009, 06:45:03 AM
I'm attempting to link two listboxes together sharing only one vertical scroll bar.

I've superclassed two Listbox's together, with the intent of vertical scrolling the contents of listbox 2 (IDC_LB2) whenever listbox 1 (IDC_LB1) is vertically scrolled - so they scroll in parallel.

I have processed for WM_VSCROLL but am uncertain about what to do next or in what direction to head. I read I can programmatically send the same scroll information from LB1 to LB2 using SendDlgItemMessage and lParam, but am uncertain.

ListBoxProc proc hWnd:DWORD, uMsg:UINT, wParam:WPARAM, lParam:LPARAM

.if uMsg == WM_VSCROLL
      int 3
invoke GetDlgCtrlID, hWnd
.if eax == IDC_LB1
invoke SendDlgItemMessage, IDC_LB2, [...]
.endif
    .endif

    invoke CallWindowProc, lpListBox, hWnd, uMsg, wParam, lParam
    ret

ListBoxProc endp


As always, cheers in advance...
Ksb
Title: Re: Superclassed Listbox's - Parallel Vertical Scrolling
Post by: evlncrn8 on November 02, 2009, 08:03:55 AM
might be easier to just use the syslistview32 ? just with 2 columns, which would also only have 1 scrollbar and have less overhead for you
as you wouldn't need to superclass etc..
Title: Re: Superclassed Listbox's - Parallel Vertical Scrolling
Post by: jj2007 on November 02, 2009, 10:20:47 AM
Check this thread (http://www.masm32.com/board/index.php?topic=11769.0), Farabi had the same question.