Slide bar for speed control

How to insert a slidebar in a child window? I want to control speed of my object through this interface. All my attempts have failed.
What is the name of the class for Slider and what flags should I use? It is pure Win32. Please give some hint.
CreateWindowEx (WS_EX_LEFT, “Slider”,
NULL,
WS_CHILD | WS_VISIBLE| WS_BORDER | WS_TABSTOP,
3, 3,
8, 8,
hwnd, (HMENU) 1,
((LPCREATESTRUCT) lParam)->hInstance, NULL) ;

It’s a bit difficult to explain all the details here, have a look at msdn.microsoft.com for all the details please:

InitCommonControls(); // loads common control’s DLL

hwndTrack = CreateWindowEx(
0, // no extended styles
TRACKBAR_CLASS, // class name
“Trackbar Control”, // title (caption)
WS_CHILD | WS_VISIBLE |
TBS_AUTOTICKS | TBS_ENABLESELRANGE, // style
10, 10, // position
200, 30, // size
hwndDlg, // parent window
ID_TRACKBAR, // control identifier
g_hinst, // instance
NULL // no WM_CREATE parameter
);

Mikael

Thank you very much, your answer is more than I expected. Hmm, I thought that all this control classes are already loaded.

For some stupid reason you have to call InitCommonControls() before you use any of the new controls that came with Windows95, I am not sure about the reason, but I agree it’s not very logical.

Mikael