i added a scrollbar to my window trought the Window Style parameter of CreateWindowEx but i found that when i set it the scroll box stays in the same place and don't move, it only change the size of the box.
im using Iczelion skeleton of a win32 app:

This is the code, i just will write the specific code:

---- CODE ----

.data?

hwnd HWND ? <---- I changed the main window var to global so i can reference it
outside of WinMain and WndProc
ScrBar SCROLLINFO <> <---- ScrollBar Structure

.code
start:



Init_Scroll proc

mov ScrBar.cbSize, sizeof ScrBar
mov ScrBar.fMask, SIF_ALL
mov ScrBar.nMin, 0
push dword ptr 48
pop ScrBar.nMax
mov ScrBar.nPage, 1
mov ScrBar.nPos, 0
mov ScrBar.nTrackPos, NULL

invoke SetScrollInfo,hwnd,SB_HORZ,addr ScrBar,TRUE


ret
Init_Scroll endp

end start

--- END CODE ---

Well i think that is enough to set a scroll bar...
CAN SOMEBODY TELL ME WHY DOESN'T MOVE???? :confused:
Posted on 2002-12-10 17:46:03 by IrOn
Ir0n, Im assuming that you cant figure out why the scrollbar wont move
when you try to drag it with your mouse? Well you need to use the abovecode
to respond to these messages: WM_HSCROLL,SB_THUMBTRACK,SB_THUMBPOSITION,
SB_LINEUP,SB_LINEDOWN,SB_PAGEUP,SB_PAGEDOWN. Windows does not control the
scrollbar for you. So you need to update the scrollbar position,etc. using the code above(SetScrollInfo).

MSDN_MESSAGES: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/scrollbars/scrollbarreference/scrollbarmessages/wm_hscroll.asp
Posted on 2002-12-10 18:14:51 by natas
Thanks natas
Posted on 2002-12-11 09:31:25 by IrOn