GetProcAddress(GetModuleHandle("User32.dll"),"MessageBox");

解决方案 »

  1.   

    int iReturnVal;
    typedef int (CALLBACK* LPFNDLLFUNC1)(UINT);HINSTANCE hDLL;              // Handle to DLL
    LPFNDLLFUNC1 lpfnDllFunc1;    // Function pointerhDLL = LoadLibrary("USER32.dll");
    if (hDLL != NULL)
    {
      lpfnDllFunc1 = (LPFNDLLFUNC1)GetProcAddress(hDLL,
                                              "MessageBeep");
      if (!lpfnDllFunc1)
      {
          // handle the error
          FreeLibrary(hDLL);      
          return 0;
      }
      else
      {
          // call the function
          iReturnVal = lpfnDllFunc1(MB_OK);
      FreeLibrary(hDLL);
      return (iReturnVal);
      }
    }