我在将这段代码(最初在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
答案 0 :(得分:8)
特别是,如何对int应用否定值。
我猜你坚持的线是最后一条线。代码似乎有点清楚。在C#中你可以这样做:
lStyle &= ~WS_MAXIMIZEBOX