Pelles C forum

Assembly language => Assembly discussions => Topic started by: Vortex on April 09, 2024, 11:14:28 AM

Title: Trackbar control
Post by: Vortex on April 09, 2024, 11:14:28 AM
Simple trackbar demo :

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
.
.

Title: Re: Trackbar control
Post by: Vortex on September 06, 2024, 11:11:45 PM
64-bit version :

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