Can someone translate me the following code from VB to C#? As far as I understand it is declaration of a function that calls another function from the native library "user32.dll"...
Declare Function SetForegroundWindo开发者_JAVA百科w Lib "user32" (ByVal hwnd As Integer) As Integer
Check out PInvoke:
[DllImport("user32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
static extern bool SetForegroundWindow(IntPtr hWnd);
If you need a code translation from VB.NET to C# or from C# to VB.NET you can go to http://www.developerfusion.com/tools/convert/csharp-to-vb/, here you can convert from one language to another practically any code you can imagine and type.
精彩评论