当前位置 : 主页 > 编程语言 > c语言 >

如何将此VB代码转换为C#?

来源:互联网 收集:自由互联 发布时间:2021-06-24
我无法将这段代码(最初在VB中)转换为C#.特别是,如何将负数应用于int. Private Declare Function GetWindowLong Lib "user32" Alias _ "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As LongPrivate Const GWL_STYL
我无法将这段代码(最初在VB中)转换为C#.特别是,如何将负数应用于int.

Private Declare Function GetWindowLong Lib "user32" Alias _
  "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Const GWL_STYLE = (-16)
Private Const WS_MAXIMIZEBOX = &H10000
dim lStyle as long

lStyle = GetWindowLong(Lhwnd, GWL_STYLE)
lStyle = lStyle And Not WS_MAXIMIZEBOX

In particular, how does one apply a negative to an int.

我想你坚持的线是最后一条线.代码似乎有点清楚.在C#中你可以这样做:

lStyle &= ~WS_MAXIMIZEBOX
网友评论