我无法将这段代码(最初在VB中)转换为C#.特别是,如何将负数应用于int. Private Declare Function GetWindowLong Lib "user32" Alias _ "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As LongPrivate Const GWL_STYL
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