C語言中嵌入?yún)R編代碼實(shí)現(xiàn)彈出對(duì)話框

字號(hào):

由于實(shí)際需要在C語言中嵌入?yún)R編代碼實(shí)現(xiàn)彈出對(duì)話框:
    #include
    #include
    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壓棧,否則對(duì)話框彈不出來。
     call dword ptr MessageBox
     }
    }