[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

How to create a trackbar at runtime?

Posted on 1999-12-10
1
Medium Priority
?
353 Views
Last Modified: 2013-12-03
I want to create a Trackbar control into a modal dialog box (using VisualC++) at runtime.
When I put the control into the dialog template in the dialog-editor, everything is ok, but
when I try to create it in the dialog window procedure (WM_INITDIALOG) at runtime,
the returned hwndTB becomes 0 (see my code sniplet below).
I can create buttons or scrollbars at runtime, but cant create a trackbar.

INITCOMMONCONTROLSEX icc;
icc.dwSize=sizeof(INITCOMMONCONTROLSEX);
icc.dwICC=ICC_BAR_CLASSES;
if(!InitCommonControlsEx(&icc))return;
HWND hwndTB;
hwndTB=CreateWindowEx(0,"TRACKBAR_CLASS","Trackbar",WS
_VISIBLE|WS_CHILD|TBS_AUTOTICKS|TBS_ENABLESELRANGE
,10,10,200,30,dialoghwnd,NULL,instance,NULL);

The result, hwndTB=NULL.
What's wrong?


0
Comment
Question by:hzsombor
1 Comment
 
LVL 23

Accepted Solution

by:
chensu earned 400 total points
ID: 2272940
Use TRACKBAR_CLASS instead of "TRACKBAR_CLASS".
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to make a Windows 7 gadget that extends its U/I with a flyout panel -- a window that pops out next to the gadget.  The example gadget shows several additional techniques:  How to automatically resize a gadget or flyout panel t…
If you have ever found yourself doing a repetitive action with the mouse and keyboard, and if you have even a little programming experience, there is a good chance that you can use a text editor to whip together a sort of macro to automate the proce…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Get the source code for a fully functional Access application shell with several popular security features that Access VBA application developers desire, but find difficult or impossible to figure out how to code. You get the source code for managi…
Suggested Courses

613 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question