How would I add a Trackbar control to my window (using createWindowEx, not dialog), msdn says "use TRACKBAR_CLASS" but it isn't working, I am including the common controls dll. I've added other controls (buttons/Edits/Statics/Listboxes..etc) but can't seem to get this to work.
Posted on 2003-06-15 22:08:23 by KewLexX
'msctl_trackbar'
Posted on 2003-06-15 23:20:56 by seasea
For future Reference: (from ToutEnMasm)

WC_HEADER equ "SysHeader32"
TOOLBARCLASSNAME equ "ToolbarWindow32"
REBARCLASSNAME equ "ReBarWindow32"
TOOLTIPS_CLASS equ "tooltips_class32"
STATUSCLASSNAME equ "msctls_statusbar32"
TRACKBAR_CLASS equ "msctls_trackbar32"
UPDOWN_CLASS equ "msctls_updown32"
PROGRESS_CLASS equ "msctls_progress32"
HOTKEY_CLASS equ "msctls_hotkey32"
WC_LISTVIEW equ "SysListView32"
WC_TREEVIEW equ "SysTreeView32"
WC_COMBOBOXEX equ "ComboBoxEx32"
WC_TABCONTROL equ "SysTabControl32"
ANIMATE_CLASS equ "SysAnimate32"
MONTHCAL_CLASS equ "SysMonthCal32"
DATETIMEPICK_CLASS equ "SysDateTimePick32"
WC_IPADDRESS equ "SysIPAddress32"
WC_PAGESCROLLER equ "SysPager"

I believe these will be included in the next update of Windows.inc.
Posted on 2003-06-16 00:45:55 by donkey
No go,



include \masm32\include\Comdlg32.inc
includelib \masm32\lib\Comdlg32.lib

.data
ClassnameTrack db "msctl_trackbar", 0

.data?
hwndTrack dd ?

.const
TrackID equ 301

.code
push 0
push hInstance
push TrackID
push hWnd
push 90 ;h
push 200 ;w
push 90 ;y
push 90 ;x
push WS_CHILD Or WS_VISIBLE
push 0
push offset ClassnameTrack
push WS_EX_CLIENTEDGE
call CreateWindowEx
mov hwndTrack, eax


Also if I add progress bar or trackbar using the visual resource editor, my program compiles but won't run (runs but doesn't show actually).
Posted on 2003-06-16 08:37:29 by KewLexX
Did you call InitCommonCtrl?
Posted on 2003-06-16 09:10:56 by roticv
No. I just tried it and I get error error A2006: undefined symbol : InitCommonCtrl tho.. Google brings up nothing .
Posted on 2003-06-16 10:55:47 by KewLexX
My mistake, the api name is InitCommonControls. It is defined in comctl32.inc and comctrl32.lib
Posted on 2003-06-16 11:53:06 by roticv
I did this before calling WinMain()


.data?
ICCE INITCOMMONCONTROLSEX <?>

mov ICCE.dwSize, sizeof INITCOMMONCONTROLSEX
mov ICCE.dwICC, ICC_BAR_CLASSES
invoke InitCommonControlsEx, offset ICCE


and then CreateWindowEx, with ClassnameTrack db "msctl_trackbar", 0, still doesn't work.
Posted on 2003-06-16 12:40:47 by KewLexX
Well, donkey lists this:
TRACKBAR_CLASS equ "msctls_trackbar32"
Posted on 2003-06-16 16:31:15 by tenkey