需要从VB code转换到C# [英] Need code translation from VB to C#

查看:146
本文介绍了需要从VB code转换到C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以翻译我下面的code从VB到C#?据我的理解是声明的函数的调用由本地库user32.dll中......

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"...

声明函数SetForegroundWindow库USER32(BYVAL HWND为整数)作为整数

Declare Function SetForegroundWindow Lib "user32" (ByVal hwnd As Integer) As Integer

推荐答案

查看 PInvoke的< /一>:

Check out PInvoke:

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

这篇关于需要从VB code转换到C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆