Quantcast
Channel: VBForums - CodeBank - Visual Basic 6 and earlier
Viewing all articles
Browse latest Browse all 1528

Call PrintF,MessageboxW by Asm,Call windows api--Vfb(Visual Freebasic),vb7,WinFBE

$
0
0
Code:

dim as string frmt = !"%s %s\n"
dim as string hello = "Hello"
dim as string world = "world"
asm
      mov  eax, [world]
      push eax
      mov  eax, [hello]
      push eax
      mov  eax, [frmt]
      push eax
      call printf
      'clean up the stack so that main can exit cleanly
      'use the unused register ebx to do the cleanup
      pop  ebx
      pop  ebx
      pop  ebx
end asm   

Sub AsmMessageboxW()
  Dim sText as WString*50="Info"
  Dim sCaption as WString*50="TitleStr"
  Asm
      push 0
      lea edi,[sCaption]
      lea esi,[sText]
      PUSH EDI
      push esi
      push 0
      Call MessageBoxw
  End asm
End Sub

Code:

Sub AsmMessageboxA()
Dim sText as String
sText="Info" 
Dim sCaption as String
sCaption ="TitleStr"       

  Asm
      push 0
      lea edi,[sCaption]
      lea esi,[sText]
      PUSH [edi]
      push [esi]
      push 0
      Call MessageBoxA   
  End asm

End Sub

Code:

  Sub AsmMessageboxW()
'Need to set the properties of the project to :UNICODE mode
' This is the standard way of writing. Remember, the string that interacts with the API must be a zStr or wStr pointer.
Dim sText as WString PTR
Dim sCaption as WString PTR
sText=@"Info" 
sCaption =@"TitleStr"       

  Asm
      push 0
      push [sCaption]
      push [sText]
      push 0
      Call MessageBoxW   
  End asm
End Sub

VB6 has stopped updating for 25 years. We have a development tool similar to VB6. Everyone is welcome to use it together and let the VISUAL BASIC syntax last forever.

vfb(visual freebasic),ide like vb6,vb7.support x64,createthread,asm code
(94) Vfb IDE【Visual Freebasic】Like vb6,vb7,Update2021-2-23 - freebasic.net
https://www.freebasic.net/forum/view...hp?f=8&t=28522
download vfb ide:
https://github.com/xiaoyaocode163/VisualFreeBasic
http://www.yfvb.com/soft-48.htm (version 5.5.3,update:2021-2-23)

Viewing all articles
Browse latest Browse all 1528

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>