I have my own DrawLoader to which I add a lot of elements (and this takes time) when the elements are added, the vertical scroll bar continues to decrease, I want to turn off the scroll bar when I start adding, and then turn it back on.
I tried -
LONG old_style=GetWindowLong(hPlayList,GWL_STYLE); LONG new_style= old_style&~WS_VSCROLL; SetWindowLong(hPlayList,GWL_STYLE,new_style); SetWindowPos(hPlayList,HWND_TOP,lstRc.left,lstRc.right,lstRc.right-lstRc.top,lstRc.bottom-lstRc.top, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED); UpdateWindow(hPlayList);
and
ShowScrollBar(hPlayList,SB_VERT,FALSE);
But the scrollbar is still showing, when I add items, the listbox is created as,
hPlayList = CreateWindowEx(WS_EX_CLIENTEDGE, WC_LISTBOX, NULL, LBS_OWNERDRAWFIXED |WS_VSCROLL | WS_HSCROLL |WS_CHILD | WS_TABSTOP | WS_VISIBLE|LBS_NOTIFY|LBS_HASSTRINGS, lbsPos.x, lbsPos.y,350, 400, hWnd, (HMENU) LIST_ID, GetModuleHandle(NULL), NULL);
and I use SendMessage () to add items.
I tried too
ShowWindow(hPlayList,SW_HIDE);
and
SendMessage(hPlayList,WM_SETREDRAW,(WPARAM)FALSE,0);