The MASM Forum Archive 2004 to 2012

Project Support Forums => 64 Bit Assembler => Topic started by: Duracell on August 15, 2010, 07:41:55 AM

Title: dialogboxparam x64 [resolved]
Post by: Duracell on August 15, 2010, 07:41:55 AM

I have a little problem with this code.


Main proc
    xor rcx, rcx
    call GetModuleHandleA
sub rsp, 30h
    mov rsp, 0
    lea r9, DialogMain
    mov r8, 0
    mov rdx, 1000h
    mov rcx, rax
    call DialogBoxParamA
add rsp, 30h
ret

DialogMain proc ;hDlg=rcx uMsg=rdx wParam=r8 lParam= r9
    cmp rdx,  WM_CLOSE
    jne @F
    sub rsp, 12h
    End_Dialog rcx, 0
    add rsp, 12h
@@:
    xor rax, rax
    ret

DialogMain endp
Exit_Process
Main endp
end


It's compiled but don't worked...

any suggestions?
Title: Re: dialogboxparam x64
Post by: evlncrn8 on August 20, 2010, 11:25:49 AM
you need to handle WM_INITDIALOG too, and return TRUE for it if i remember right
Title: Re: dialogboxparam x64 [resolved]
Post by: Duracell on August 20, 2010, 05:33:57 PM
It doesn't work because memory was wrong. Should be 38h reserved.