Fresh IDE . Artifact [140b408001]
Not logged in

This repository is a mirror!

The original is located on: https://fresh.flatassembler.net/fossil/repo/fresh
If you want to follow the project, please update your remote-url

Artifact 140b4080019f580429108349534a010ea82d6907:


; _______________________________________________________________________________________
;|                                                                                       |
;| ..::FreshLib::..  Free, open source. Licensed under "BSD 2-clause" license."          |
;|_______________________________________________________________________________________|
;
;  Description: Provides unified access to standard mouse cursors.
;
;  Target OS: Win32
;
;  Dependencies:
;
;  Notes:
;_________________________________________________________________________________________

; ToDo: Arbitrary mouse cursors, B&W for the begining.


body SetMouseCursor     ;, .hWindow, .hCursor
begin
        push    ecx edx
        invoke  SetCursor, [.hCursor]
        pop     edx ecx
        return
endp



body GetStockCursor     ;, .index
begin
        push    ecx edx
        mov     eax, [.index]
        cmp     eax, mcCount
        jb      @f
        xor     eax, eax
@@:
        movzx   eax, [_cursors+2*eax]
        invoke  LoadCursorW, 0, eax
        pop     edx ecx
        return
endp

if used _cursors
  _cursors dw IDC_ARROW, IDC_IBEAM, IDC_CROSS, IDC_SIZEWE, IDC_SIZENS, IDC_SIZENWSE, IDC_SIZENESW, IDC_WAIT, IDC_HAND, IDC_HAND, IDC_ARROW
end if



body __MouseCapture     ;, .hwnd
begin
        push    eax ecx edx
        cmp     [.hwnd], 0
        je      .release

        invoke  SetCapture, [.hwnd]

.finish:
        pop     edx ecx eax
        return

.release:
        invoke  ReleaseCapture
        jmp     .finish
endp


body ZeroMouseMove
.point POINT
begin
        pushad

        lea     eax, [.point]
        invoke  GetCursorPos, eax
        invoke  SetCursorPos, [.point.x], [.point.y]

        popad
        return
endp