flat assembler
Message board for the users of flat assembler.

Index > Windows > Why it doesn`t works?

Author
Thread Post new topic Reply to topic
Barf



Joined: 17 Sep 2004
Posts: 34
Location: Poland
Barf
I have a problem with programming GDI on assembler. I do everything i did on delphi, but it doesn`t works - program works, but it doesn`t draw anything.
Please help me.


Description:
Download
Filename: editor.ASM
Filesize: 6.41 KB
Downloaded: 86 Time(s)

Post 09 Jun 2005, 07:57
View user's profile Send private message Reply with quote
shoorick



Joined: 25 Feb 2005
Posts: 1605
Location: Ukraine
shoorick
i did not understand clear what do you want to draw, but here is a part from program i've wrote once - it is a masm example, but i think you will need just refer to it - may this will help. it was just drawing with mouse when or left, either right button pressed (when my daughter was too small, she pressed mostly right button with all fingers Smile )

Code:
        .elseif uMsg==WM_RBUTTONDOWN
                jmp lbd
        .ELSEIF uMsg==WM_LBUTTONDOWN
lbd:    mov eax,lParam
                and eax,0ffffh
                mov lastpoint.x,eax
                mov eax,lParam
                shr eax,16
                mov lastpoint.y,eax
                mov dopaint,TRUE
        .elseif uMsg==WM_MOUSEMOVE
                .if dopaint
                        mov eax,lParam
                        and eax,0ffffh
                        mov hitpoint.x,eax
                        mov eax,lParam
                        shr eax,16
                        mov hitpoint.y,eax
                        invoke GetDC,hWnd
                        mov    hdc,eax
                        invoke MoveToEx,hdc,lastpoint.x,lastpoint.y,NULL
                        invoke LineTo,hdc,hitpoint.x,hitpoint.y
                        mov eax,hitpoint.x
                        mov lastpoint.x,eax
                        mov eax,hitpoint.y
                        mov lastpoint.y,eax
                        invoke ReleaseDC,hWnd,hdc
                .endif
        .elseif uMsg==WM_RBUTTONUP
                jmp lbu
        .elseif uMsg==WM_LBUTTONUP
lbu:    mov eax,lParam
                and eax,0ffffh
                mov hitpoint.x,eax
                mov eax,lParam
                shr eax,16
                mov hitpoint.y,eax
                invoke GetDC,hWnd
                mov    hdc,eax
                invoke MoveToEx,hdc,lastpoint.x,lastpoint.y,NULL
                invoke LineTo,hdc,hitpoint.x,hitpoint.y
                invoke ReleaseDC,hWnd,hdc
                mov dopaint,FALSE
    

regards!
Post 09 Jun 2005, 08:53
View user's profile Send private message Visit poster's website Reply with quote
Barf



Joined: 17 Sep 2004
Posts: 34
Location: Poland
Barf
thanks
Post 09 Jun 2005, 09:55
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.