well i?m trying to build a slider from a window button class , later i will use a
owner drawn button , so this is the begining , but this code works but very bugy
becouse when i click on the "slider" (button) and move the mouse up or down
the button does not move then when i release the button the slider moves to
the final place... but what i want is that the button after wm_mousedown and
wm_mousemove to move the button (slider) real time ... and not like it is that
only when i release the slider (button) takes the right place in

call MoveWindow, ,124, ,10,11,1





the code is above please give me some help :)
Posted on 2003-04-12 22:11:02 by Nguga
%include '\lab\vasm\inc\nagoa.inc'




..start:

call GetModuleHandleA, NULL
CONST hInst , dd 0
mov , eax
CONST DIALOG_ID, equ 1000
call DialogBoxParamA, ,DIALOG_ID, 0,DialogProc, 0
call ExitProcess,


; = [ MAIN DIALOLOG PROC ] =====================:

proc DialogProc,hdlg,msg,wParam,lParam

cmp dword ,WM_INITDIALOG
je wm_inidialog
cmp dword ,WM_COMMAND
je near wm_command
cmp dword ,WM_CLOSE
je near wm_close
cmp dword ,WM_LBUTTONDOWN
je near BUTTONDOWN
cmp dword ,WM_LBUTTONUP
je near BUTTONUP
cmp dword ,WM_MOUSEMOVE
je near MOUSEMOVE
return FALSE

;; =============
wm_inidialog:

call CreateWindowExA, NULL, "BUTTON","", WS_CHILD | WS_VISIBLE,124,98,10,11,, 101, , NULL
CONST slider1, dd 0
mov ,eax
CONST flagkeydown, dd 0
mov byte ,0
return TRUE

;; =============
wm_command:

return TRUE

;; =============
New1:
return FALSE
;; =============
New2:
return FALSE
;; =============
wm_close:
call ExitProcess,0
return FALSE
;------------

BUTTONDOWN:
sectiondata
pt resb POINT_size
hobjecto dd 0
sectioncode

call GetCursorPos,pt
call ScreenToClient,,pt
m2m ,
cmp dword ,120
jng .outMouseDown
cmp dword ,130
jg .outMouseDown
cmp dword ,20
jl .outMouseDown
cmp dword ,100
jg .outMouseDown
mov byte ,1
call SetCapture,
return FALSE
.outMouseDown
return FALSE


BUTTONUP:
mov byte ,0
call ReleaseCapture,
return FALSE


MOUSEMOVE:
sectiondata
rect resb RECT_size
sectioncode
cmp byte ,1
jne near .out_

call GetCursorPos,pt
call ScreenToClient,,pt
m2m ,
cmp dword ,120
jng .out_
cmp dword ,130
jg .out_
cmp dword ,20
jl .out_
cmp dword ,100
jg .out_
call SetCapture,
call MoveWindow, ,124, ,10,11,1

return FALSE
.out_
return FALSE




endproc ; === [ MAIN DIALOGPROC END ] =============== :
Posted on 2003-04-12 22:11:39 by Nguga
1000 DIALOG 203, 188, 200, 143
STYLE DS_CENTER | WS_MAXIMIZEBOX | WS_MINIMIZEBOX | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME
CAPTION "my dialog name"
LANGUAGE LANG_PORTUGUESE, 0x2
FONT 8, "Helv"
BEGIN
CONTROL "exit", 0, BUTTON, BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 147, 9, 43, 19
CONTROL "", 0, BUTTON, BS_GROUPBOX | WS_CHILD | WS_VISIBLE, 77, 7, 20, 62
END
Posted on 2003-04-12 22:12:14 by Nguga
Is there a reason why you want to build your own?? The standard Sliders (like the one in you volume control panel) are available to use??

:NaN:
Posted on 2003-04-12 23:45:41 by NaN
"Is there a reason why you want to build your own?? The standard Sliders (like the one in you volume control panel) are available to use??" NaN

well i do not want to use standart silder becouse the api will have a general skin bitmap , then the button (that works like slider) will be a bitmap , i will use BS_FLAT style on that button .


its why i?m trying to build my own slider from a window button , but NaN if there is a
way out please tel me :)

Thanks !
Posted on 2003-04-13 06:37:09 by Nguga
Personally, i would write my own custom control. You can find it and many other stuff in the FAQ section...

Or quick link here...

:alright:
NaN
Posted on 2003-04-13 10:16:12 by NaN