Lazarus

Other Languages => Portuguese => Topic started by: affonso on November 14, 2012, 12:11:59 pm

Title: free pascal com assembly
Post by: affonso on November 14, 2012, 12:11:59 pm
ola a todos

utilizando o compilador free pascal e possível chamar a biblioteca USER32 do windows usando a linguagem assembly para criar uma messagemBox ola mundo.

ser possível podem posta um código como exemplo.


agradeço desde já. 
Title: Re: free pascal com assembly
Post by: affonso on November 16, 2012, 04:02:43 pm
este problema foi resolvido no forum ingles

solução

 uses windows;
var
  title: PChar = 'hello, world test';
  content: PChar = 'hello, world';
begin
  {$asmmode intel}
  asm
    push dword 0 // MB_OK
    push title
    push content
    push dword 0 // HWND of desktop
    call MessageBoxA // note that you have to know EXACTLY the symbol to call
  end;
end.

código do usuário Leledumbo
TinyPortal © 2005-2018