NO

Author Topic: Trackbar control  (Read 3543 times)

Offline Vortex

  • Member
  • *
  • Posts: 864
    • http://www.vortex.masmcode.com
Trackbar control
« on: April 09, 2024, 11:14:28 AM »
Simple trackbar demo :

Code: [Select]
WndProc PROC hWnd:DWORD,uMsg:DWORD,wParam:DWORD,lParam:DWORD

    .IF uMsg==WM_DESTROY
   
        invoke  PostQuitMessage,NULL

    .ELSEIF uMsg==WM_CREATE

        invoke  CreateWindowEx,0,ADDR TBAR_CLASS,0,\
                WS_CHILD or WS_VISIBLE or TBS_BOTTOM,\
                50,50,200,30,hWnd,0,hInstance,0

        mov     hSlider,eax

        invoke  SendMessage,eax,TBM_SETRANGE,TRUE,\
                0 or (100 shl 16)
               
        invoke  SendMessage,hSlider,TBM_SETPOS,TRUE,50
.
.
Code it... That's all...

Offline Vortex

  • Member
  • *
  • Posts: 864
    • http://www.vortex.masmcode.com
Re: Trackbar control
« Reply #1 on: September 06, 2024, 11:11:45 PM »
64-bit version :

Code: [Select]
WndProc PROC hWnd:QWORD,uMsg:QWORD,wParam:QWORD,lParam:QWORD PARMAREA=12*QWORD

LOCAL _hWnd:QWORD

    .IF uMsg==WM_DESTROY
   
        invoke  PostQuitMessage,NULL

    .ELSEIF uMsg==WM_CREATE

        mov     _hWnd,rcx

        invoke  CreateWindowEx,0,ADDR TBAR_CLASS,0,\
                WS_CHILD or WS_VISIBLE or TBS_BOTTOM,\
                50,50,200,30,_hWnd,0,hInstance+rip,0

        mov     hSlider+rip,rax

        invoke  SendMessage,rax,TBM_SETRANGE,TRUE,\
                0 or (100 shl 16)
               
        invoke  SendMessage,hSlider+rip,TBM_SETPOS,TRUE,50

    .ELSE
   
        invoke  DefWindowProc,rcx,rdx,r8,r9       
        ret
       
    .ENDIF
   
    xor     rax,rax
    ret

WndProc ENDP
Code it... That's all...