calling a shell32 function from C#

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

vikram Nayak via .NET 247

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

thanks,
 
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);
}
}
 
Back
Top