I'm having trouble converting this piece of code (originally in VB) to C#. In particular, how does one apply a negative to an 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.
I guess the line you are stuck on is the last one. The code seems to be clearing a bit. In C# you can do it like this:
lStyle &= ~WS_MAXIMIZEBOX
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With