C语言中嵌入汇编代码实现弹出对话框

出处: 作者: 日期:2007年11月26日 15时11分
   由于实际需要在C语言中嵌入汇编代码实现弹出对话框: 
#include <windows.h> 
#include <stdio.h> 
char format[] = "%s %s\n"; 
char hello[] = "Hello"; 
char world[] = "world"; 
HWND hwnd; 
void main( void ) 

   __asm 
   { 
        //push NULL 
        //call dword ptr GetModuleHandle 
        //mov hwnd,eax 
        push MB_OK 
      mov eax, offset world 
      push eax 
      mov eax, offset hello 
      push eax 
        push 0//说明此处不能将前面注释掉代码处得到的hwnd压栈,否则对话框弹不出来。 
        call dword ptr MessageBox 
   } 
}
最后更新时间:2008-05-28 12:26:43
文章评论
共有 0 位网友发表了评论
用户名: 新注册) 密码: 匿名评论 [查看所有评论]

评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
您可以用以下几种方式找到此文章

考试全流程