對於簡單的消息框,檢查http://pinvoke.net/,我得到的如何使用PInvoke方法聲明以下內容?
[DllImport("user32.dll")]
static extern MessageBoxResult MessageBox(IntPtr hWnd, string text, string caption, int type);
但是編譯器報告MessageBoxResult找不到。如果我將MessageBoxResult更改爲int,那麼它編譯得很好。有關這個問題的任何暗示?
因爲該方法返回一個int。 – Joe 2012-02-07 13:52:50