简体   繁体   中英

Need code translation from VB to C#

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 SetForegroundWindow Lib "user32" (ByVal hwnd As Integer) As Integer

Check out PInvoke :

[DllImport("user32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
static extern bool SetForegroundWindow(IntPtr hWnd);

如果您需要从VB.NET到C#或从C#到VB.NET的代码转换,则可以转到http://www.developerfusion.com/tools/convert/csharp-to-vb/ ,在这里您可以从一个转换语言到您可以想象和键入的几乎任何代码。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM