1 2 3 4
|
hWindow = CreateWindowEx(NULL, L"Class", NULL,
WS_CHILD | WS_VISIBLE | WS_VSCROLL,
0, 0, 500, 80,
hWnd, (HMENU) 1, hInstance, NULL);
|
Where did you get the name of a class named "Class"? As far as I know there is no such Windows control. What goes in the second parameter of the CreateWindowEx() function is a null terminated string containing the name of some class Windows recognizes, such as a standard windows control such as "edit", "button", "scrollbar", "listbox", "static", etc. Or, a common control such as the calendar or tab control. Or, even further, a registered ActiveX control or what not. Or, even further, a Window Class you yourself have registered with RegisterClassEx(). The key word in all of this is 'Registered'.
Also, you must clearly understand that there are two basic ways of having a scroll bar (either verticle or horiz or both) in your window.
First, it can be done without creating the scrollbar yourself by simply creating a top level WS_OVERLAPPEDWINDOW window and or'ing the WS_VSCROLL style in the dwStyles parameter. If you do that however, the scroll bar might not show up or only show up inactivated until you set various scroll bar metrics using perhaps SetScrollInfo().
Secondly, you can create a scroll bar control whose parent is any window you choose. I do this occasionally, but its usually easier to attach the scroll bar through styles as described above.
As Lamblion intimated, you really need about 6 months with nPetzold to grasp all this. Its somewhat involved.
As a matter of fact, I've written very detailed tutorials on all this but the code & tutorials are in various PowerBASIC related forums. I don't have any C/C++ translations around fit to post. However, the PowerBASIC translations are straight Sdk Api code. If you want the links let me know.