Hey people,
Im working on creating a trackbar on my current project and I cant get it to work. Dont I have to use CreateTrackBar? Or CreateWindowEx? If so how would I create a track bar using CreateWindowEx? Also if I need to use CreateTrackBar, what includes do I use to make it possible? comctrl32.inc and .lib dont work. I also would like to know how to set more then two ticks on it. Thx.
Posted on 2002-08-06 01:10:18 by resistance_is_futile

Hey people,
I also would like to know how to set more then two ticks on it.


You should send to your trackbar message TBM_SETTICFREQ. Also, one of your trackbar styles should be TBS_AUTOTICKS.
Posted on 2002-08-06 01:56:04 by Aquila
But you dont know how to actually make the trackbar? Or how would I send a message to it without actually making it in my .asm file. Because I am using radasm and I know how to put one on the actual program but cant send messages to it because I dont know how to make it in the .asm file.
Posted on 2002-08-06 14:50:56 by resistance_is_futile
hi !

this is how you can built a Trackbar :

.data
TrackBarClass db "msctls_trackbar32",0
.code

invoke CreateWindowEx,NULL,ADDR TrackBarClass,0,
TBS_AUTOTICKS or WS_TABSTOP or WS_VISIBLE or WS_CHILD,
a,b,wd,ht,hParent,ID,hInst,0


and send y this message to set the tic range:

invoke SendMessage,HtrackBar,TBM_SETRANGE,fRedraw,Max*1000h+Min

and this for tics frequence :

invoke SendMessage,HtrackBar,TBM_SETTICFREQ,wFreq,NULL


bye ! :)
Posted on 2002-08-06 15:14:05 by kylekiller
okay here is what I have. Dont think its working too well lol.:


invoke CreateWindowEx,NULL,ADDR TrackBarClass,0,TBS_AUTOTICKS or WS_TABSTOP or WS_VISIBLE or WS_CHILD,6,108,283,19,hWin,IDC_TRACK,hwndTrack,0

invoke SendMessage,hwndTrack,TBM_SETRANGE,TRUE,10h*10h+0h
invoke SendMessage,hwndTrack,TBM_SETTICFREQ,50,NULL

and here is all the stuff in the .inc file


.data
TrackBarClass db "msctls_trackbar32",0

.data?
.data?

hInstance dd ?
CommandLine dd ?
hWnd dd ?
theprocess dd ?
phandle dd ?
dwprocessid dd ?
hwndStatus dd ?
hwndTrack dd ?
CurrentStep dd ?

Doesnt work though...anyone see a problem?
Posted on 2002-08-06 16:26:29 by resistance_is_futile

But you dont know how to actually make the trackbar?

I know. I've made it in one of my assembly apps ;). If you want to source code click here: http://wasm.ru/src/1/bac25src.zip.


Or how would I send a message to it without actually making it in my .asm file.


Do it in .inc file :).


Because I am using radasm and I know how to put one on the actual program but cant send messages to it because I dont know how to make it in the .asm file.


Use SendMessage (or SendDlgItemMessage) during dialog form initialization.
Posted on 2002-08-07 02:00:50 by Aquila
hey i d/led ur source and it doesnt start up :mad: but it helped..not enough to where i could get it to work though....:(
Posted on 2002-08-07 13:03:21 by resistance_is_futile
Maybe this will help.

KetilO
Posted on 2002-08-07 13:46:23 by KetilO

hey i d/led ur source and it doesnt start up :mad: but it helped..not enough to where i could get it to work though....:(

Probably, you have some NT-based OS. Due to some reasons (if really, I don't know why) it didn't work under NTs (inc. Win2k and XP). Under Win9x it works perfectly :).
Posted on 2002-08-08 02:03:36 by Aquila
Hi resistance_is_futile !

I've made for you a quick example to Create a TrackBar Control !

it works under Xp !

good learning :)

Bye !
Posted on 2002-08-08 07:14:11 by kylekiller
okay everyone thanks for the replies finally got it working... After much fustration :mad: :grin:
Posted on 2002-08-08 14:03:12 by resistance_is_futile