calling a shell32 function from C#

  • Thread starter vikram Nayak via .NET 247
  • Start date
V

vikram Nayak via .NET 247

Any tutorials / samples on how to call a shell32,user, kernel function from C#

thanks,
 
G

Guest

You should pinovke the function ,

This is the example from http://www.gotdotnet.com which calls MessageBox
function from User32.dll

HTH

-----------------------------------------

using System.Runtime.InteropServices;

public class Win32 {
...
[DllImport("User32.dll", EntryPoint="MessageBox",
CharSet=CharSet.Auto)]
public static extern int MsgBox(int hWnd, String text, String
caption, uint type);
}

public class TestPInvoke {
public static void Main() {
...
String date = ...;

Win32.MsgBox(0, date, "PInvoke Sample", 0);
}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top