Skip to content

Commit adba6fe

Browse files
authored
Create AccessUnmanagedMessageBox.cs
Access unmanaged message box an API from user32.dll
1 parent 2869b89 commit adba6fe

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

Diff for: AccessUnmanagedMessageBox.cs

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using System.Runtime.InteropServices;
2+
3+
namespace ConsoleApp87
4+
{
5+
public class API
6+
{
7+
[DllImport("user32.dll", EntryPoint = "MessageBox")]
8+
public static extern int ShowMessage(int hwnd, string text, string caption, uint type);
9+
}
10+
class Program
11+
{
12+
static void Main()
13+
{
14+
string caption = "Message Box";
15+
string text = "Hello Harshal Raverkar";
16+
API.ShowMessage(0,text, caption,0);
17+
18+
}
19+
}
20+
}

0 commit comments

Comments
 (0)