V vikram Nayak via .NET 247 Apr 9, 2005 #1 Any tutorials / samples on how to call a shell32,user, kernel function from C# thanks,
G Guest Apr 9, 2005 #2 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); } }
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); } }
T Tim Wilson Apr 9, 2005 #3 You can usually find the p/invoke that you're looking for here. http://www.pinvoke.net/ If not, you can always add it once you've written and tested it. It's a wiki.
You can usually find the p/invoke that you're looking for here. http://www.pinvoke.net/ If not, you can always add it once you've written and tested it. It's a wiki.