当前位置: 代码迷 >> 汇编语言 >> 汇编MessageBox
  详细解决方案

汇编MessageBox

热度:6576   发布时间:2013-02-26 00:00:00.0
汇编MessageBox求助
szFormatStr byte 'Brand = %s', 0ah
szBrand byte 49 dup (0)。
在数据段定义了这么一个数据,szBrand在代码段中保存需要的字符串,szBrand对应%s,怎么把它输出在MessageBox中?
另外求助一下怎么输出多行信息?

------解决方案--------------------------------------------------------
调用 wsprintf() 系统函数,将结果整理在个缓冲区里,比如你这里的 szBrand ,然后将地址传给 MessageBox() 函数了。要多行,在需要换行的地方加上 0dh, 0ah 就可以了。
------解决方案--------------------------------------------------------
Assembly code
include  windows.incinclude  user32.incincludelib  user32.libinclude  kernel32.incincludelib  kernel32.lib